calendarui/multicaluidialog/inc/caluidialogimpl.h
branchRCL_3
changeset 66 bd7edf625bdd
child 67 1539a383d7b6
child 86 ed599363c2d7
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description : implementation class for multiple calendars list dialog.
       
    15  */
       
    16 
       
    17 #ifndef CCalUiDialogImpl_H_
       
    18 #define CCalCalUiDialogImpl_H_
       
    19 
       
    20 //System include
       
    21 #include <calentry.h>
       
    22 #include <AknDialog.h>
       
    23 #include <coemain.h>
       
    24 #include <eiklbo.h>
       
    25 #include <aknlists.h>
       
    26 #include <eiklbo.h>
       
    27 
       
    28 //Forward declarations.
       
    29 class CEikColumnListBox;
       
    30 class TAknsItemID;
       
    31 class CAknIconArray;
       
    32 class CAknDoubleGraphicStyleListBox;
       
    33 class CAknsBasicBackgroundControlContext;
       
    34 class CAknNavigationControlContainer;
       
    35 class CCalenDbListbox;
       
    36 class CGulIcon;
       
    37 class CCalEntry;
       
    38 class CMultiCalUiDialogModel;
       
    39 #include "multicaluidialogimpl.h"
       
    40 #include "multicaluidialogmodel.h"
       
    41 #include "caldblistbox.h"
       
    42 #include"caldblistboxitemdrawer.h"
       
    43 
       
    44 #include <eiklbx.h>
       
    45 #include <eiklbo.h> 
       
    46 #include <eiklbx.h>
       
    47 #include <eikfrlb.h>        // for CFormattedCellListBoxItemDrawer
       
    48 #include <aknlists.h>       // for CAknDoubleLargeStyleListBox
       
    49 #include <AknForm.h>
       
    50 
       
    51 
       
    52 NONSHARABLE_CLASS(CCalUiDialogImpl) : public CAknDialog, public MEikListBoxObserver
       
    53     {
       
    54     public:
       
    55         /**
       
    56          * 1st phase constructor pushes pointer on the cleanup stack
       
    57          * @return CCalenMultiDbUtilityImpl* A pointer to CCalenMultiDbUtilityImpl
       
    58          */
       
    59         static CCalUiDialogImpl* NewL(const RPointerArray<CCalEntry>& aCalEntries);
       
    60         
       
    61         /**
       
    62          * 1st phase constructor pushes pointer on the cleanup stack
       
    63          * @return CCalenMultiDbUtilityImpl* A pointer to CCalenMultiDbUtilityImpl
       
    64          */
       
    65         static CCalUiDialogImpl* NewLC(const RPointerArray<CCalEntry>& aCalEntries);
       
    66 
       
    67          /**
       
    68          * Destructor.
       
    69          */
       
    70         ~CCalUiDialogImpl();
       
    71         
       
    72         /**
       
    73          * Launches the multiple calendars list dialog
       
    74          */
       
    75         TInt LaunchCalenDbListDialogL();
       
    76         
       
    77         /**
       
    78          * @brief From CAknDialog.
       
    79          * @param aDrawNow draw status from CAknDialog.
       
    80          */ 
       
    81         void FocusChanged( TDrawNow aDrawNow );
       
    82         
       
    83     protected:
       
    84         /**
       
    85          * From CEikDialog
       
    86          * @param aResourceId Not used.
       
    87          * @param aMenuPane Not used.
       
    88          */ 
       
    89         void DynInitMenuPaneL( TInt aResourceId,CEikMenuPane* aMenuPane ) ;
       
    90 
       
    91         /**
       
    92          * From MEikMenuObserver.
       
    93          * Hides the menu.
       
    94          * @param aCommandId Not used.
       
    95          */ 
       
    96         void ProcessCommandL( TInt aCommandId ) ;
       
    97 
       
    98         /** 
       
    99          * From CCoeControl.
       
   100          * Handles key events.
       
   101          **/
       
   102         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) ;
       
   103 
       
   104         /** 
       
   105          * From CCoeControl.
       
   106          * Handles pointer events.
       
   107          **/
       
   108         void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   109 
       
   110         /**
       
   111          * From CEikDialog.
       
   112          * Handles a dialog button press for the specified button. 
       
   113          **/
       
   114         TBool OkToExitL(TInt aButtonId) ;
       
   115         
       
   116         /** 
       
   117          * From MObjectProvider. 
       
   118          * Gets Mop supply object of the given type.  
       
   119          * @param aId Identifier for the supply object.
       
   120          * @return Pointer to the supply object type ID.
       
   121          */
       
   122         TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   123 
       
   124         /**
       
   125          * From @c CEikDialog.
       
   126          * Prepare of controls
       
   127          **/
       
   128         void PreLayoutDynInitL();
       
   129 
       
   130         /**
       
   131          * From @c CEikDialog.
       
   132          **/
       
   133         void PostLayoutDynInitL();
       
   134 
       
   135         /**
       
   136          * From @c CCoeControl.
       
   137          * Called when controls extent is set.
       
   138          **/
       
   139         void SizeChanged();
       
   140 
       
   141         /**
       
   142          * From @c CCoeControl.
       
   143          **/ 
       
   144         void HandleResourceChange(TInt aType);
       
   145 
       
   146         /**
       
   147          * From @c CCoeControl.
       
   148          * @param aIndex index of the control
       
   149          * @return Pointer to the Control.
       
   150          **/
       
   151         CCoeControl* ComponentControl( TInt aIndex) const;
       
   152 
       
   153         /**
       
   154          * From @c CCoeControl.
       
   155          * @return Pointer to the Control.
       
   156          **/
       
   157         TInt CountComponentControls() const;
       
   158 
       
   159         /**
       
   160          * From @c CCoeControl.
       
   161          * 
       
   162          * @param aRect
       
   163          **/
       
   164         void Draw(const TRect &aRect) const;
       
   165         
       
   166     private:
       
   167         /**
       
   168          * Class constructor
       
   169          */
       
   170         CCalUiDialogImpl();
       
   171 
       
   172         /**
       
   173          * Second phase constructor
       
   174          */
       
   175         void ConstructL(const RPointerArray<CCalEntry>& aCalEntries);
       
   176         
       
   177     private: //Internal
       
   178         /**
       
   179          * Construction of listbox ui
       
   180          * @return void
       
   181          */
       
   182         void ConstructListL();
       
   183 
       
   184         /** 
       
   185          * Update listbox contents 
       
   186          * @return void
       
   187          */
       
   188         void UpdateListboxL();
       
   189 
       
   190         /**
       
   191          * setup title pane for the status pane
       
   192          * @param aCurrentState 
       
   193          * @return void 
       
   194          */
       
   195         void SetTitlePaneL( TBool aCurrentState );
       
   196         
       
   197         /**
       
   198          * Marks or unmarks the calendar based on user input.
       
   199          */
       
   200         void MarkUnmarkCalendarL();
       
   201 
       
   202 
       
   203         // from MEikListBoxObserver
       
   204         /**
       
   205          * Handles list box events.
       
   206          *
       
   207          * This is invoked by CEikListBox to
       
   208          * notify the observer of list box events.
       
   209          *
       
   210          * @param aListBox   The originating list box.
       
   211          * @param aEventType A code for the event. 
       
   212          */
       
   213         void HandleListBoxEventL( CEikListBox* /*aListBox */,
       
   214             TListBoxEvent aEventType );
       
   215         
       
   216         /*
       
   217         * Async exit for the dialog
       
   218         * @param aPtr
       
   219         * @return TInt
       
   220         */
       
   221         static TInt DoAsyncExitL(TAny* aPtr);
       
   222         
       
   223         
       
   224     private: // data
       
   225         CCalenDbListbox*                    iListBox;
       
   226         CAknsBasicBackgroundControlContext* iBgContext; //Owns
       
   227         CAknNavigationControlContainer*     iNaviContainer;
       
   228         CDesCArrayFlat*                     iDesArray; //Owns
       
   229         TRect                               iRect;
       
   230         RArray<TInt32>                      iColorUidArray;
       
   231         TInt                                iResourceFileOffset;
       
   232         TFileName                           iIconFile;
       
   233         CAknIconArray*                      iIconsList;
       
   234         TBool                               iFirstTap;
       
   235         TBufC<20>                           iTitlepaneText;
       
   236         CMultiCalUiDialogModel*             iMultiCalUiDialogModel;
       
   237         CAsyncCallBack* iAsyncExit;
       
   238         TInt iAsyncExitCmd;
       
   239     };
       
   240 
       
   241 #endif  //CCalUiDialogImpl_H_