diff -r fd30d51f876b -r b6db4fd4947b calendarui/views/dayview/inc/calendaymodelmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/dayview/inc/calendaymodelmanager.h Mon Jun 28 15:22:02 2010 +0530 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model manager holds models for three day views +* +*/ +#ifndef CALENDAYMODELMANAGER_H +#define CALENDAYMODELMANAGER_H + +#include +#include +#include + +#include "calendaycommonheaders.h" + +class QAbstractItemModel; +class MCalenServices; +class CalenDayModel; + +class CalenDayModelManager : public QObject +{ + Q_OBJECT + +public: + enum ModelDay { + PreviousDay = 0, + CurrentDay = 1, + NextDay = 2, + NumberOfDays + }; + +public: + CalenDayModelManager(MCalenServices &services, bool emptyModels, + QObject *parent = 0); + ~CalenDayModelManager(); + + QAbstractItemModel &getModel(CalenDayModelManager::ModelDay day); + + void refreshAllModels(); + void refreshSingleModel(CalenDayModelManager::ModelDay day); + MCalenServices &getServices() { + return mServices; + } + +public slots: + void viewsScrollingFinished(CalenScrollDirection scrollTo); + +private: + void createAllModels(); + void moveBackward(); + void moveForeward(); + +private: + QMap mModels; + MCalenServices &mServices; + QDateTime mCurrentDayTime; +}; + +#endif//CALENDAYMODELMANAGER_H