phonebookui/Phonebook2/UIControls/inc/cpbk2filteredviewstack.h
branchRCL_3
changeset 6 e8e3147d53eb
parent 0 e686773b3f54
equal deleted inserted replaced
5:81f8547efd4f 6:e8e3147d53eb
    30 class MVPbkContactBookmarkCollection;
    30 class MVPbkContactBookmarkCollection;
    31 class MPbk2FilteredViewStackElement;
    31 class MPbk2FilteredViewStackElement;
    32 class CElementStack;
    32 class CElementStack;
    33 
    33 
    34 // CLASS DECLARATION
    34 // CLASS DECLARATION
    35  
    35 
    36 /**
    36 /**
    37  * A stack for the base view and filtered views that can be used
    37  * A stack for the base view and filtered views that can be used
    38  * as a contact view. MVPbkContactViewBase reuqests are forwarded
    38  * as a contact view. MVPbkContactViewBase reuqests are forwarded
    39  * to the top view.
    39  * to the top view.
    40  *
    40  *
    42  * -creating filtered views based on given find string.
    42  * -creating filtered views based on given find string.
    43  * -managing the created views, keeping them on stacks
    43  * -managing the created views, keeping them on stacks
    44  */
    44  */
    45 NONSHARABLE_CLASS(CPbk2FilteredViewStack) : public CBase,
    45 NONSHARABLE_CLASS(CPbk2FilteredViewStack) : public CBase,
    46                                             public MPbk2FilteredViewStack,
    46                                             public MPbk2FilteredViewStack,
       
    47                                             public MVPbkContactViewObserverExtension,
    47                                             private MVPbkContactViewObserver
    48                                             private MVPbkContactViewObserver
    48     {
    49     {
    49     public: // Constructors and destructor
    50     public: // Constructors and destructor
    50             
    51 
    51         /**
    52         /**
    52          * Creates a new instance of this class.
    53          * Creates a new instance of this class.
    53          *
    54          *
    54          * @param aBaseView The non-filtered base view.
    55          * @param aBaseView The non-filtered base view.
    55          * @param aConfigurationFlags a set of TConfigurationFlags
    56          * @param aConfigurationFlags a set of TConfigurationFlags
    65 
    66 
    66     public: // Interface
    67     public: // Interface
    67 
    68 
    68 
    69 
    69         void UpdateFilterL(
    70         void UpdateFilterL(
    70                 const MDesCArray& aFindStrings, 
    71                 const MDesCArray& aFindStrings,
    71                 const MVPbkContactBookmarkCollection* aAlwaysincluded,
    72                 const MVPbkContactBookmarkCollection* aAlwaysincluded,
    72                 TBool aAlwaysIncludedChanged );
    73                 TBool aAlwaysIncludedChanged );
    73         
    74 
    74         void Reset();
    75         void Reset();
    75      
    76 
    76         MVPbkContactViewBase& BaseView() const;
    77         MVPbkContactViewBase& BaseView() const;
    77         
    78 
    78   
    79 
    79         void SetNewBaseViewL(
    80         void SetNewBaseViewL(
    80                 MVPbkContactViewBase& aBaseView );
    81                 MVPbkContactViewBase& aBaseView );
    81         
    82 
    82         
    83 
    83         TInt Level() const;
    84         TInt Level() const;
    84 
    85 
    85         void AddStackObserverL( 
    86         void AddStackObserverL(
    86                 MPbk2FilteredViewStackObserver& aStackObserver );
    87                 MPbk2FilteredViewStackObserver& aStackObserver );
    87         
    88 
    88  
    89 
    89         void RemoveStackObserver( 
    90         void RemoveStackObserver(
    90                 MPbk2FilteredViewStackObserver& aStackObserver );
    91                 MPbk2FilteredViewStackObserver& aStackObserver );
    91         
    92 
    92     
    93 
    93     public:  // From MVPbkContactViewBase
    94     public:  // From MVPbkContactViewBase
    94         TVPbkContactViewType Type() const;
    95         TVPbkContactViewType Type() const;
    95         void ChangeSortOrderL(
    96         void ChangeSortOrderL(
    96                 const MVPbkFieldTypeList& aSortOrder );
    97                 const MVPbkFieldTypeList& aSortOrder );
    97         const MVPbkFieldTypeList& SortOrder() const;
    98         const MVPbkFieldTypeList& SortOrder() const;
   107                 MVPbkContactViewObserver& aObserver );
   108                 MVPbkContactViewObserver& aObserver );
   108         void RemoveObserver(
   109         void RemoveObserver(
   109                 MVPbkContactViewObserver& aObserver );
   110                 MVPbkContactViewObserver& aObserver );
   110         TBool MatchContactStore(
   111         TBool MatchContactStore(
   111                 const TDesC& aContactStoreUri ) const;
   112                 const TDesC& aContactStoreUri ) const;
   112         TBool MatchContactStoreDomain( 
   113         TBool MatchContactStoreDomain(
   113                 const TDesC& aContactStoreDomain ) const;
   114                 const TDesC& aContactStoreDomain ) const;
   114         MVPbkContactBookmark* CreateBookmarkLC(
   115         MVPbkContactBookmark* CreateBookmarkLC(
   115                 TInt aIndex ) const;
   116                 TInt aIndex ) const;
   116         TInt IndexOfBookmarkL(
   117         TInt IndexOfBookmarkL(
   117                 const MVPbkContactBookmark& aContactBookmark ) const;
   118                 const MVPbkContactBookmark& aContactBookmark ) const;
   132                 const MVPbkContactLink& aContactLink );
   133                 const MVPbkContactLink& aContactLink );
   133         void ContactViewError(
   134         void ContactViewError(
   134                 MVPbkContactViewBase& aView,
   135                 MVPbkContactViewBase& aView,
   135                 TInt aError,
   136                 TInt aError,
   136                 TBool aErrorNotified );
   137                 TBool aErrorNotified );
       
   138         TAny* ContactViewObserverExtension(TUid aExtensionUid );
       
   139 
       
   140     private: // From MVPbkContactViewObserverExtension
       
   141         void FilteredContactRemovedFromView(
       
   142 			 MVPbkContactViewBase& aView );
   137 
   143 
   138     private: // Implementation
   144     private: // Implementation
   139         CPbk2FilteredViewStack();
   145         CPbk2FilteredViewStack();
   140         void ConstructL(
   146         void ConstructL(
   141                 MVPbkContactViewBase& aBaseView );
   147                 MVPbkContactViewBase& aBaseView );
   144         void DoHandleContactViewReadyL(
   150         void DoHandleContactViewReadyL(
   145                 MVPbkContactViewBase& aView );
   151                 MVPbkContactViewBase& aView );
   146         void UpdateStackL();
   152         void UpdateStackL();
   147         class CCallback;
   153         class CCallback;
   148         void DoAddObserverL(
   154         void DoAddObserverL(
   149                 MVPbkContactViewObserver& aObserver, 
   155                 MVPbkContactViewObserver& aObserver,
   150                 CCallback& aCallback );
   156                 CCallback& aCallback );
   151         void DoAddObserverError(
   157         void DoAddObserverError(
   152                 TInt aError,
   158                 TInt aError,
   153                 CCallback& aCallback );
   159                 CCallback& aCallback );
   154         void SendTopViewChangedEvent(
   160         void SendTopViewChangedEvent(
   161                 const MDesCArray& aStringArray ) const;
   167                 const MDesCArray& aStringArray ) const;
   162         MDesCArray* CopySearchWordsByLevelL(
   168         MDesCArray* CopySearchWordsByLevelL(
   163                 const MDesCArray& aStringArray,
   169                 const MDesCArray& aStringArray,
   164                 TInt aLevel );
   170                 TInt aLevel );
   165         TBool IsElementsUnderDestruction();
   171         TBool IsElementsUnderDestruction();
   166                 
   172 
   167     private: // Data
   173     private: // Data
   168         /// Own: the stacked views that are currently used
   174         /// Own: the stacked views that are currently used
   169         CElementStack* iViewStack;
   175         CElementStack* iViewStack;
   170         /// Own: Array construction views
   176         /// Own: Array construction views
   171         CElementStack* iConstructionStack;
   177         CElementStack* iConstructionStack;
   177         RPointerArray<MPbk2FilteredViewStackObserver> iStackObservers;
   183         RPointerArray<MPbk2FilteredViewStackObserver> iStackObservers;
   178         /// Own: View observer callbacks
   184         /// Own: View observer callbacks
   179         RPointerArray<CCallback> iCallbacks;
   185         RPointerArray<CCallback> iCallbacks;
   180         /// Own: Contact find policy
   186         /// Own: Contact find policy
   181         CVPbkContactFindPolicy* iFindPolicy;
   187         CVPbkContactFindPolicy* iFindPolicy;
   182  
   188 
   183  #ifdef _DEBUG
   189  #ifdef _DEBUG
   184         void __DbgTestInvariant() const;
   190         void __DbgTestInvariant() const;
   185  #endif // _DEBUG
   191  #endif // _DEBUG
   186     };
   192     };
   187 
   193