calendarui/views/inc/calenmonthview.h
branchRCL_3
changeset 30 bd7edf625bdd
parent 29 12af337248b1
equal deleted inserted replaced
29:12af337248b1 30:bd7edf625bdd
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  CalenMonthView class definition.
    14 * Description:   For month view of calendar application.
    15 *
    15  *
    16 */
    16 */
    17 
    17 
    18 #ifndef CALENMONTHVIEW_H  
    18 
       
    19 
       
    20 #ifndef CALENMONTHVIEW_H
    19 #define CALENMONTHVIEW_H
    21 #define CALENMONTHVIEW_H
    20 
    22 
    21 // System includes
    23 //  INCLUDES
    22 #include <QGraphicsLinearLayout>
       
    23 #include <qdatetime.h>
       
    24 #include <hblabel.h>
       
    25 #include <hbextendedlocale.h>
       
    26 #include <hbframeitem.h>
       
    27 
       
    28 // User includes
       
    29 #include "calennativeview.h"
    24 #include "calennativeview.h"
    30 
    25 
    31 // Forward declarations
    26 // FORWARD DECLARATIONS
    32 class QStandardItemModel;
    27 class CCalenMonthContainer;
    33 class HbAction;
    28 class CAknNavigationDecorator;
    34 class HbGridView;
       
    35 class HbExtendedLocale;
       
    36 class XQSettingsManager;
       
    37 class XQSettingsKey;
       
    38 class AgendaUtil;
       
    39 class AgendaEntry;
       
    40 class MCalenContext;
       
    41 class CalenMonthData;
       
    42 class MCalenServices;
       
    43 class CalenPreviewPane;
       
    44 class CalenDocLoader;
       
    45 class CalenThickLinesDrawer;
       
    46 class CalenMonthGrid;
       
    47 class CalenPluginLabel;
       
    48 
    29 
    49 // Constants
    30 //  CLASS DEFINITIONS
    50 const int KNumOfVisibleRows = 6;
    31 /**
       
    32  *  For Month View of calendar application
       
    33  */
       
    34 NONSHARABLE_CLASS( CCalenMonthView ) : public CCalenNativeView
       
    35     {
       
    36     public:
       
    37         /**
       
    38          * Two-phased constructor.
       
    39          */
       
    40         IMPORT_C static CCalenMonthView* NewL( MCalenServices& aServices );
    51 
    41 
    52 #ifdef  CALENVIEWS_DLL
    42         /**
    53 #define CALENMONTHVIEW_EXPORT Q_DECL_EXPORT
    43          * Destructor.
    54 #else
    44          */
    55 #define CALENMONTHVIEW_EXPORT Q_DECL_IMPORT
    45         virtual ~CCalenMonthView();
    56 #endif
       
    57 
    46 
    58 class CALENMONTHVIEW_EXPORT CalenMonthView : public CalenNativeView
    47     public:    // New function
    59 {
    48         void SetStatusPaneFromActiveContextL();
    60 	Q_OBJECT
    49 
    61 	
    50     private:    // New function
    62 public:
    51         /**
    63 	CalenMonthView( MCalenServices &services );
    52          * C++ constructor.
    64 	virtual ~CalenMonthView();
    53          */
    65 	
    54         CCalenMonthView( MCalenServices& aServices );
    66 public:  // From CCalenView
    55 
    67 	virtual void doPopulation();
    56         /**
    68 	void setupView(CalenDocLoader *docLoader);
    57          * By default Symbian OS constructor is private.
    69 	void doLazyLoading();
    58          */
    70 	void handleGridItemActivated();
    59         void ConstructL();
    71 	void setContextForActiveDay(int index);
    60 
    72 	QDateTime getCurrentDay();
    61     public:  // From CCalenView
    73 	QDateTime getActiveDay();
    62         virtual TNextPopulationStep ActiveStepL();
    74 	int rowsInPrevMonth();
    63         virtual void CancelPopulation();
    75 	int rowsInFutMonth();
    64         virtual TCyclePosition CyclePosition() const;
    76 	int getCurrGridIndex();
    65         virtual const TDesC& LocalisedViewNameL( CCalenView::TViewName aViewName );
    77 	void setCurrGridIndex(int index);
    66         virtual CGulIcon* CCalenMonthView::ViewIconL() const;
    78 	void populatePrevMonth();
    67 
    79 	void populateNextMonth();
    68     protected:   // From CCalenNativeView
    80 	void onLocaleChanged(int reason);
    69         /**
    81 	QList<CalenMonthData>& monthDataList();
    70          * Clears view specific data
    82 	void updateModelWithPrevMonth();
    71          */
    83 	void updateModelWithFutureMonth();
    72         virtual void ClearViewSpecificDataL();
    84 	void populatePreviewPane(QDateTime &dateTime);
    73     
    85 	void handlePreviewPaneGesture(bool rightGesture);
    74         /**
    86 	QDateTime firstDayOfGrid();
    75          *  Updates preview pane/preview popup
    87 	void fetchEntriesAndUpdateModel();
    76          */
    88 	void launchDayView();
    77         void UpdatePreviewPaneL();
    89 	void disconnectAboutToQuitEvent();
    78 
    90 	
    79         /**
    91 private:
    80          * Hides preview pane/preview popup
    92 	void createGrid();
    81          */
    93 	void populateWithInstanceView();
    82         void HidePreviewPane();
    94 	void completePopulation();
    83         
    95 	void prepareForPopulation();
    84     private:    // From CCalenView
    96 	QDateTime dateFromContext( const MCalenContext &context );
    85         /**
    97 	void setActiveDay(QDateTime day);
    86          * From CCalenView CCalenView::DoActivateL() calls DoActivateImplL()
    98 	void setDate();
    87          */
    99 	void getInstanceList(QList<QDate> &list,
    88         void DoActivateImplL(	const TVwsViewId& aPrevViewId,
   100                          QDateTime rangeStart, QDateTime rangeEnd);
    89                                 TUid aCustomMessageId,
   101 	void handleChangeOrientation();
    90                                 const TDesC8& aCustomMessage );
   102 	void setDateToLabel();
    91 
   103 	void updateWeekNumGridModel();
    92         /**
   104 	void addWeekNumbers();
    93          * From CCalenView
   105 	void removeWeekNumbers();
    94          * CCalenView::DoDeactivateL() calls DoDeactivateImplL()
   106 	void addBackgroundFrame();
    95          */
   107 	void refreshViewOnGoToDate();
    96         void DoDeactivateImpl();
   108 	void showHideRegionalInformation();
    97 
   109 	void onContextChanged();
    98         /**
   110 	void updateDayLabel();
    99          * From CCalenView Creates CCalenContainer
   111 	
   100          */
   112 private slots:
   101         CCalenContainer* CreateContainerImplL();
   113 	void createEditor();
   102 
   114 	void goToToday();
   103         /**
   115 	void updateMonthDataArrayWithActiveDates();
   104          * From CCalenView Called when cross over midinight or locale change.
   116 	void handleLeftEffectCompleted(const HbEffect::EffectStatus &status);
   105          */
   117 	void handleRightEffectCompleted(const HbEffect::EffectStatus &status);
   106         void OnLocaleChangedL(TInt aReason);
   118 	void addRemoveActionsInMenu();
   107 
   119 	void changeOrientation(Qt::Orientation orientation);
   108         /**
   120 	void handleThemeChange();
   109          * From CCalenView Redraw status pane when Form is closed
   121 	
   110          */
   122 private:
   111         void RedrawStatusPaneL();
   123 	bool mIsFirstTimeLoad;
   112 
   124 	CalenDocLoader *mDocLoader;
   113         /**
   125 	CalenThickLinesDrawer *mDayNameWidget;
   114          * From CCalenView. Normal command handling method.
   126 	CalenMonthGrid *mMonthGrid;
   115          * needed for MSK.
   127 	HbWidget* mPrevPaneParent;
   116          */
   128 	HbWidget* mPrevPaneLayoutWidget;
   117         void HandleCommandL(TInt aCommand);
   129 	QGraphicsLinearLayout* mPrevPaneLayout;
   118 
   130 	HbWidget* mCurrPaneParent;
   119     private:
   131 	HbWidget* mCurrPaneLayoutWidget;
   120         // From CAknView
   132 	QGraphicsLinearLayout* mCurrPaneLayout;
   121         TUid Id() const;
   133 	HbWidget* mNextPaneParent;
   122 
   134 	HbWidget* mNextPaneLayoutWidget;
   123         /**
   135 	QGraphicsLinearLayout* mNextPaneLayout;
   124          * Returns ETrue if the vsd is null.
   136 	CalenPreviewPane* mCurrPreviewPane;
   125          */
   137 	CalenPreviewPane* mPrevPreviewPane;
   126         TBool IsViewSpecificDataNullL();
   138 	CalenPreviewPane* mNextPreviewPane;
   127         
   139 	CalenThickLinesDrawer *mWeekNumberWidget;
   128     private:    // From MEikMenuObserver
   140 	HbWidget *mMonthGridPlusWeekNumWidget;
   129         /**
   141 	HbExtendedLocale mLocale;
   130          * From MEikMenuObserver Changes MenuPane dynamically
   142 	int mIndexToBeScrolled;
   131          */
   143 	QDateTime mActiveMonth;
   132         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
   144 	int mNumOfRowsInPrevMonth;
   133 
   145 	int mNumOfRowsInFutureMonth;
   134     private:    // Data
   146 	HbLabel *mFirstDayLabel;
   135 
   147 	HbLabel *mSecondDayLabel;
   136         enum TPopulationStep
   148 	HbLabel *mThirdDayLabel;
   137             {
   149 	HbLabel *mFourthDayLabel;
   138             ENothingDone,
   150 	HbLabel *mFifthDayLabel;
   139             ESizeChanged,
   151 	HbLabel *mSixthDayLabel;
   140             ERequestedInstanceView,
   152 	HbLabel *mSeventhDayLabel;
   141             ESetIndicatorNext,
   153 	HbLabel *mFirstWeekLabel;
   142             ESetFocusNext,
   154 	HbLabel *mSecondWeekLabel;
   143             EPopulationDone
   155 	HbLabel *mThirdWeekLabel;
   144             };
   156 	HbLabel *mFourthWeekLabel;
   145         TPopulationStep iPopulationStep;
   157 	HbLabel *mFifthWeekLabel;
   146     // view specific data
   158 	HbLabel *mSixthWeekLabel;
   147         TTime iDate;
   159 	QList<CalenMonthData> mMonthDataArray;
   148     };
   160 	QDateTime mDate;
       
   161 	QDateTime mCurrentDay;
       
   162 	QDateTime mFirstDayOfGrid;
       
   163 	QDateTime mLastDayOfGrid;
       
   164 	int mTotalNumOfGridItems;
       
   165 	QList<int> mWeekNumbers;
       
   166 	HbLabel *mTitleLabel;
       
   167 	Qt::Orientation mOrientation;
       
   168 	XQSettingsManager *mSettingsManager;
       
   169 	XQSettingsKey *mWeekNumberCenrepKey;
       
   170 	uint mIsWeekNumbersShown;
       
   171 	AgendaUtil *mAgendaUtil;
       
   172 	bool mIsPrevPaneGesture;
       
   173 	HbAction *mGoToTodayAction;
       
   174 	CalenPluginLabel *mPrevRegionalInfo;
       
   175 	CalenPluginLabel *mCurrRegionalInfo;
       
   176 	CalenPluginLabel *mNextRegionalInfo;
       
   177 	HbMenu *mDeleteSubMenu;
       
   178 	QColor mWeekDaysColor;
       
   179 	bool   mIsAboutToQuitEventConnected; // bool to check if month view is registered to get aboutToQuit signals
       
   180 	QColor mPreviewHeadingColor;
       
   181 };
       
   182 
   149 
   183 #endif //CALENMONTHVIEW_H
   150 #endif //CALENMONTHVIEW_H
   184 
   151 
   185 // End of file  --Don't remove this.
   152 
       
   153 // End of File