calendarui/views/inc/calentodoview.h
changeset 0 f979ecb2b13e
child 5 42814f902fe6
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2002 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:   To-Do view derived from CCalenView.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef     TODOVIEW_H
       
    21 #define     TODOVIEW_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <eiklbv.h>
       
    25 #include <calentoolbar.h>
       
    26 #include "calennativeview.h"
       
    27 
       
    28 //  CONSTANTS
       
    29 const TInt KCountOfControls(1); // Number of controls
       
    30 
       
    31 enum TViewError
       
    32     {
       
    33     EFormErrSave = 1
       
    34     };
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CCalenTodoNoteForm;
       
    38 class CCalenTodoContainer;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 * CCalenTodoView view class.
       
    44 * Derived from CCalenView.
       
    45 */
       
    46 NONSHARABLE_CLASS( CCalenTodoView ) : public CCalenNativeView
       
    47     {
       
    48     public:  // Constructors and destructor
       
    49         /**
       
    50          * Two-phased constructor.
       
    51          **/
       
    52         IMPORT_C static CCalenTodoView* NewL( MCalenServices& aServices );
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          **/
       
    57         virtual ~CCalenTodoView();
       
    58 
       
    59     private:
       
    60         /**
       
    61          * Symbian OS default constructor.
       
    62          **/
       
    63         void ConstructL();
       
    64 
       
    65         /**
       
    66          * C++ constructor.
       
    67          */
       
    68         CCalenTodoView( MCalenServices& aServices );
       
    69 
       
    70     public: // New functions
       
    71         /**
       
    72          * Handling command "Delete"
       
    73          * @param aCloseForm Close flag of note form
       
    74          * @param aNoteForm Note form pointer
       
    75          * @return ETrue  : Delete note
       
    76          *         EFalse : Not delete note
       
    77          **/
       
    78         void OnCmdDeleteEntryL();
       
    79 
       
    80         /**
       
    81         * This function is called when Locale or Today was changed.
       
    82         * @param aReason Notify reson (EChangesLocale,
       
    83         *                                EChangesMidnightCrossover
       
    84         */
       
    85         void OnLocaleChangedL( TInt aReason );
       
    86 
       
    87         /**
       
    88          * Return number of items.
       
    89          * @return A number of items
       
    90          **/
       
    91         TInt ItemCount();
       
    92 
       
    93         /**
       
    94          * Check cross out of current item.
       
    95          * @return ETrue  : cross out
       
    96          *         EFalse : not cross out
       
    97          **/
       
    98         TBool CurrentItemIsCrossOutL();
       
    99 
       
   100         /**
       
   101          * Save the index of current item.
       
   102          **/
       
   103         void SaveCurrentItemIndexL();
       
   104 
       
   105         /**
       
   106          * Return pointer of the container object.
       
   107          * @return Container pointer
       
   108          **/
       
   109         CCalenTodoContainer* Container();
       
   110 
       
   111         /**
       
   112          * Update CBA buttons depending if view is empty or not.
       
   113          **/
       
   114         void UpdateCBAButtonsL();
       
   115 
       
   116     public:
       
   117         /**
       
   118          * From CAknView, command handling for each view
       
   119          * @param aCommand Command id
       
   120          **/
       
   121         void HandleCommandL(TInt aCommand);
       
   122 
       
   123     public:  // From CCalenView
       
   124         virtual TNextPopulationStep ActiveStepL();
       
   125         virtual void CancelPopulation();
       
   126         virtual TCyclePosition CyclePosition() const;
       
   127         virtual const TDesC& LocalisedViewNameL( CCalenView::TViewName aViewName );
       
   128         virtual CGulIcon* CCalenTodoView::ViewIconL() const;
       
   129         
       
   130         void CleanupInstancesL();
       
   131 
       
   132     protected:   // From CCalenNativeView      
       
   133         /**
       
   134          * Clears view specific data
       
   135          */
       
   136         virtual void ClearViewSpecificDataL();
       
   137         
       
   138         /**
       
   139          * Notify marked entry deleted
       
   140          */
       
   141         void NotifyMarkedEntryDeletedL();     
       
   142         
       
   143         void NotifyMarkedEntryCompletedL();
       
   144         
       
   145 
       
   146     protected:  // New functions
       
   147         /**
       
   148          * Second phase DoActivateL.
       
   149          * Called when List View becomes active.
       
   150          **/
       
   151         void DoActivateImplL(	const TVwsViewId& aPrevViewId,
       
   152                                 TUid aCustomMessageId,
       
   153                                 const TDesC8& aCustomMessage );
       
   154         /**
       
   155          * Second phase DoDeactivate.
       
   156          * Called when List View becomes inactive.
       
   157          **/
       
   158         void DoDeactivateImpl();
       
   159 
       
   160         /**
       
   161          * Delete marked notes.
       
   162          * @param aSelectionIndex Items which are currently selected.
       
   163          **/
       
   164         void DeleteMarkedNotesL();
       
   165         
       
   166         void CreateMultiplecontextForMarkedItemsL(TInt aCommand);
       
   167 
       
   168         /**
       
   169          * Deletes the marked notes.
       
   170          * @return TRUE if not yet finished.
       
   171          **/
       
   172         TInt DeleteMarkedNotesCallBackL();
       
   173 
       
   174         /**
       
   175          * This function is callback function to delete one marked item.
       
   176          * @return TRUE if not yet finished.
       
   177          **/
       
   178         TInt DoDeleteMarkedNotesCallBackL();
       
   179 
       
   180         /**
       
   181          * Save new current postion of item after deleting marked items.
       
   182          **/
       
   183         void FindFocusAfterDeletionL(const CListBoxView::CSelectionIndexArray& aSelectedItems);
       
   184 
       
   185     public: // From CCalenView
       
   186         /**
       
   187          * Redraw status pane when Form is closed
       
   188          **/
       
   189         void RedrawStatusPaneL();
       
   190 
       
   191         /**
       
   192          * From CCalenView Creates CCalenContainer
       
   193          **/
       
   194         CCalenContainer* CreateContainerImplL();
       
   195 
       
   196     private:
       
   197         /**
       
   198          * From MEikMenuObserver, This function called to initialize manu pane.
       
   199          * @param aResourceId resource id
       
   200          * @param aMenuPane CEikMenuPane pointer
       
   201          **/
       
   202         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
   203         
       
   204     private:
       
   205         // From CAknView
       
   206         TUid Id() const;   
       
   207 
       
   208         /**
       
   209          * Returns ETrue if the vsd is null.
       
   210          */
       
   211         TBool IsViewSpecificDataNullL();
       
   212         
       
   213         /**
       
   214          * CCalenTodoView::ShowMarkedTodosDeleteConfirmationQueryL( TInt aCount )
       
   215          * Special delete query case for todos: Query for marked todos deletion
       
   216          **/
       
   217         TInt ShowMarkedTodosDeleteConfirmationQueryL( TInt aCount );
       
   218 		
       
   219 		/**
       
   220          * Enable the functionlity of copying entries to one or more calendars.         
       
   221          **/
       
   222         
       
   223         void CopyToCalendarsL();
       
   224 
       
   225     private:
       
   226         /**
       
   227          * Static callback function
       
   228          */
       
   229          static TInt NotificationCallback( TAny* aCommandStruct );
       
   230          
       
   231         /**
       
   232          * Leaving implementation of the callback function
       
   233          */
       
   234          void DoNotificationCallbackL();
       
   235 	
       
   236 		/**
       
   237 		 * Set Multiple contexts
       
   238 		 */
       
   239 		void SetMultipleContexts();
       
   240 		
       
   241 		
       
   242 		TBool CheckMarkedItemCompletedL();
       
   243 	public: 
       
   244 	    /**
       
   245 	     * Set marked todo items
       
   246 	     */
       
   247 	    void SetMarkedToDoItems(CListBoxView::CSelectionIndexArray* aMarkedTodoItems);
       
   248 	    
       
   249 	    /**
       
   250 	     * Get marked todo itemss
       
   251 	     */
       
   252 	    CListBoxView::CSelectionIndexArray* GetMarkedToDoItems();
       
   253 	    
       
   254 	    /**
       
   255 	     * Clear marked todo items
       
   256 	     */
       
   257 	    void ClearMarkedToDoItems();
       
   258 	    
       
   259     private:
       
   260         RPointerArray<CCalInstance> iMarkedInstances;
       
   261 
       
   262         TInt            iCountOfSelectedItems;
       
   263         //TInt            iDeletedCount;
       
   264         TInt            iItemIndexAfterDeletion;
       
   265         CIdle*          iIdle;
       
   266         CAknWaitDialog* iWaitDialog;
       
   267         CAsyncCallBack* iCmdCallback;
       
   268         
       
   269         enum TPopulationStep
       
   270             {
       
   271             ENothingDone,
       
   272             ERequestedInstanceView,
       
   273             EAddToStackNext,
       
   274             EPopulationDone
       
   275             };
       
   276 
       
   277         TPopulationStep iPopulationStep;
       
   278 
       
   279         // view specific data
       
   280         TInt iHighlightedRowNumber;     // The row number highlighted.
       
   281         TInt iFirstEntryOnScreenIndex;  // The offset of the topmost item on screen to the first entry.
       
   282         CListBoxView::CSelectionIndexArray* iMarkedTodoItems;
       
   283     };
       
   284 
       
   285 #endif //  TODOVIEW_H
       
   286 
       
   287 
       
   288 // End of File