phonebookui/Phonebook2/inc/CPbk2NamesListControl.h
branchRCL_3
changeset 58 d4f567ce2e7c
parent 32 2828b4d142c0
child 64 c1e8ba0c2b16
equal deleted inserted replaced
57:2666d9724c76 58:d4f567ce2e7c
    30 #include <mpbk2commanditemupdater.h>
    30 #include <mpbk2commanditemupdater.h>
    31 #include <eiksbobs.h>
    31 #include <eiksbobs.h>
    32 #include <aknsfld.h>
    32 #include <aknsfld.h>
    33 #include <eiklbo.h>
    33 #include <eiklbo.h>
    34 #include "CPbk2ControlContainer.h"
    34 #include "CPbk2ControlContainer.h"
       
    35 #include <aknmarkingmodeobserver.h>
    35 
    36 
    36 // FORWARD DECLARATIONS
    37 // FORWARD DECLARATIONS
    37 class MPbk2NamesListState;
    38 class MPbk2NamesListState;
    38 class CPbk2ContactViewListBox;
    39 class CPbk2ContactViewListBox;
    39 class CPbk2NamesListStateFactory;
    40 class CPbk2NamesListStateFactory;
    76                               public MEikScrollBarObserver,
    77                               public MEikScrollBarObserver,
    77                               public MAdaptiveSearchTextObserver,
    78                               public MAdaptiveSearchTextObserver,
    78                               public MEikListBoxObserver,
    79                               public MEikListBoxObserver,
    79                               public MPbk2ControlContainerForegroundEventObserver,
    80                               public MPbk2ControlContainerForegroundEventObserver,
    80                               public MPbk2CommandItemUpdater,
    81                               public MPbk2CommandItemUpdater,
    81                               public MVPbkContactViewObserverExtension 
    82                               public MVPbkContactViewObserverExtension, 
       
    83                               public MAknMarkingModeObserver
    82     {
    84     {
    83     public: // Enumerations
    85     public: // Enumerations
    84 
    86 
    85         /// The names list states
    87         /// The names list states
    86         enum TPbk2NamesListState
    88         enum TPbk2NamesListState
   127                 MVPbkContactViewBase& aView,
   129                 MVPbkContactViewBase& aView,
   128                 MPbk2ContactNameFormatter& aNameFormatter,
   130                 MPbk2ContactNameFormatter& aNameFormatter,
   129                 CPbk2StorePropertyArray& aStoreProperties );
   131                 CPbk2StorePropertyArray& aStoreProperties );
   130         
   132         
   131         /**
   133         /**
   132 		* Creates a new instance of this class.
   134         * Creates a new instance of this class.
   133 		*
   135         *
   134 		* @param aResourceId       Id of the resource where the control
   136         * @param aResourceId       Id of the resource where the control
   135 		*                          is defined in.
   137         *                          is defined in.
   136 		* @param aContainer        This control's container.
   138         * @param aContainer        This control's container.
   137 		* @param aManager          Virtual Phonebook contact manager.
   139         * @param aManager          Virtual Phonebook contact manager.
   138 		* @param aView             The contact view.
   140         * @param aView             The contact view.
   139 		* @param aNameFormatter    Name formatter.
   141         * @param aNameFormatter    Name formatter.
   140 		* @param aStoreProperties  An array containg properties
   142         * @param aStoreProperties  An array containg properties
   141 		*                          for the stores that are shown.
   143         *                          for the stores that are shown.
   142 		* @param aThumbManager	   Thumbnail manager for social phonebook	//TODO
   144         * @param aThumbManager       Thumbnail manager for social phonebook    //TODO
   143 		* @return A new instance of this class.
   145         * @return A new instance of this class.
   144 		*/
   146         */
   145 	   IMPORT_C static CPbk2NamesListControl* NewL(
   147        IMPORT_C static CPbk2NamesListControl* NewL(
   146 			   TInt aResourceId,
   148                TInt aResourceId,
   147 			   const CCoeControl* aContainer,
   149                const CCoeControl* aContainer,
   148 			   CVPbkContactManager& aManager,
   150                CVPbkContactManager& aManager,
   149 			   MVPbkContactViewBase& aView,
   151                MVPbkContactViewBase& aView,
   150 			   MPbk2ContactNameFormatter& aNameFormatter,
   152                MPbk2ContactNameFormatter& aNameFormatter,
   151 			   CPbk2StorePropertyArray& aStoreProperties,
   153                CPbk2StorePropertyArray& aStoreProperties,
   152 			   CPbk2ThumbnailManager* aThumbManager );
   154                CPbk2ThumbnailManager* aThumbManager );
   153 
   155 
   154         /**
   156         /**
   155          * Constructor. Defined as public for custom control needs.
   157          * Constructor. Defined as public for custom control needs.
   156          *
   158          *
   157          * @param aContainer        This control's container.
   159          * @param aContainer        This control's container.
   243         IMPORT_C void HandleViewForegroundEventL( TBool aForeground );
   245         IMPORT_C void HandleViewForegroundEventL( TBool aForeground );
   244 
   246 
   245         /**
   247         /**
   246          * For special case: Call this function to skip showing the 
   248          * For special case: Call this function to skip showing the 
   247          * blocking progress note when mass update is going on in nameslistview.
   249          * blocking progress note when mass update is going on in nameslistview.
   248 		 * When done, MassUpdateSkipProgressNote(EFalse) must always be
   250          * When done, MassUpdateSkipProgressNote(EFalse) must always be
   249 		 * called to reset back to original state (even if a Leave would happen in between) 
   251          * called to reset back to original state (even if a Leave would happen in between) 
   250          * @param aSkip - ETrue if progress note should not be displayed. EFalse reset to normal.
   252          * @param aSkip - ETrue if progress note should not be displayed. EFalse reset to normal.
   251          */
   253          */
   252         IMPORT_C void MassUpdateSkipProgressNote( TBool aSkip );
   254         IMPORT_C void MassUpdateSkipProgressNote( TBool aSkip );
   253         
   255         
   254         /**
   256         /**
   388     public: // from MEikListBoxObserver
   390     public: // from MEikListBoxObserver
   389         void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
   391         void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
   390     public: // from MAdaptiveSearchTextObserver
   392     public: // from MAdaptiveSearchTextObserver
   391 
   393 
   392         void AdaptiveSearchTextChanged( CAknSearchField* aSearchField );
   394         void AdaptiveSearchTextChanged( CAknSearchField* aSearchField );
       
   395 
       
   396     public: // From MAknMarkingModeObserver 
       
   397             
       
   398         /**
       
   399          * This method is called when marking mode is activated or deactivated.
       
   400          * 
       
   401          * @param aActivated @c ETrue if marking mode was activate, @c EFalse
       
   402          *                   if marking mode was deactivated.
       
   403          */
       
   404         void MarkingModeStatusChanged( TBool aActivated );
       
   405 
       
   406         /**
       
   407          * This method is called just before marking mode is closed. Client can 
       
   408          * either accept or decline closing.
       
   409          * 
       
   410          * @return @c ETrue if marking mode should be closed, otherwise @c EFalse.
       
   411          */
       
   412         TBool ExitMarkingMode() const;
       
   413         
   393     private: // Implementation
   414     private: // Implementation
   394         
   415         
   395         /**
   416         /**
   396          * Constructor.
   417          * Constructor.
   397          *
   418          *
   441     public: //For Storing/Restoring/Clearing the Marked Contacts
   462     public: //For Storing/Restoring/Clearing the Marked Contacts
   442         void StoreMarkedContactsAndResetViewL();
   463         void StoreMarkedContactsAndResetViewL();
   443         void RestoreMarkedContactsL();
   464         void RestoreMarkedContactsL();
   444         void ClearMarkedContactsInfo();
   465         void ClearMarkedContactsInfo();
   445         
   466         
   446         
   467     public:
       
   468         inline void SetMarkingMode( TBool aActived )
       
   469             {
       
   470             iMarkingModeOn = aActived;
       
   471             }
       
   472         
       
   473         inline TBool GetMarkingMode() const
       
   474             {
       
   475             return iMarkingModeOn;
       
   476             }
   447         
   477         
   448     private: // Data
   478     private: // Data
   449         /// Ref: Current state
   479         /// Ref: Current state
   450         MPbk2NamesListState* iCurrentState;
   480         MPbk2NamesListState* iCurrentState;
   451         /// Own: State factory
   481         /// Own: State factory
   498         // Own/Ref (see below): Thumbnail manager
   528         // Own/Ref (see below): Thumbnail manager
   499         CPbk2ThumbnailManager* iThumbManager;
   529         CPbk2ThumbnailManager* iThumbManager;
   500         // Wheter this control owns the thumbnail manager (iThumbManager) or not 
   530         // Wheter this control owns the thumbnail manager (iThumbManager) or not 
   501         TBool iOwnThumbManager;
   531         TBool iOwnThumbManager;
   502         //OWN: double list box "handle"
   532         //OWN: double list box "handle"
   503         CPbk2ContactViewDoubleListBox* 	iDoubleListBox;
   533         CPbk2ContactViewDoubleListBox* iDoubleListBox;
   504         
   534         
   505         //Own: Selected/Marked Contacts
   535         //Own: Selected/Marked Contacts
   506         MVPbkContactLinkArray* iSelectedLinkArray;      
   536         MVPbkContactLinkArray* iSelectedLinkArray;
   507            
   537            
   508         //Own: Background Task Handler     
   538         //Own: Background Task Handler     
   509         CPbk2NamesListControlBgTask* iBgTask;
   539         CPbk2NamesListControlBgTask* iBgTask;
   510         //Own: Mass update checker/handler
   540         //Own: Mass update checker/handler
   511         CPbk2HandleMassUpdate* iCheckMassUpdate;
   541         CPbk2HandleMassUpdate* iCheckMassUpdate;
   512         //Own: Open Cca is in progress
   542         //Own: Open Cca is in progress
   513         TBool iOpeningCca;        
   543         TBool iOpeningCca;
       
   544         // Flag to indicate marking mode is active
       
   545         TBool iMarkingModeOn;
   514     };
   546     };
   515 
   547 
   516 #endif // CPBK2NAMESLISTCONTROL_H
   548 #endif // CPBK2NAMESLISTCONTROL_H
   517 
   549 
   518 // End of File
   550 // End of File