phonebookui/Phonebook2/inc/CPbk2ContactUiControlSubstitute.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 UI control substitute.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTUICONTROLSUBSTITUTE_H
       
    20 #define CPBK2CONTACTUICONTROLSUBSTITUTE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <coecntrl.h>
       
    25 #include <MPbk2ContactUiControl.h>
       
    26 #include <MPbk2ContactUiControl2.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MVPbkContactStore;
       
    30 class MPbk2ContactUiControl;
       
    31 class MVPbkBaseContactField;
       
    32 class MVPbkStoreContact;
       
    33 class CAknsBasicBackgroundControlContext;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Phonebook 2 UI control substitute.
       
    39  * This is not a real UI control.
       
    40  */
       
    41 class CPbk2ContactUiControlSubstitute :
       
    42         public CCoeControl,
       
    43         public MPbk2ContactUiControl,
       
    44         public MPbk2ContactUiControl2
       
    45     {
       
    46     public: // Constructors and destructor
       
    47         /**
       
    48          * Constructor.
       
    49          *
       
    50          * @return New instance of this class
       
    51          */
       
    52         IMPORT_C static CPbk2ContactUiControlSubstitute* NewL();
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          */
       
    57         IMPORT_C ~CPbk2ContactUiControlSubstitute();
       
    58 
       
    59     public: // Interface
       
    60 
       
    61         /**
       
    62          * Sets the parent UI control returned by the ParentControl()
       
    63          * of the UI control interface.
       
    64          *
       
    65          * @param aParentUiControl  Parent UI control.
       
    66          */
       
    67         IMPORT_C void SetParentUiControl(
       
    68                 MPbk2ContactUiControl& aParentUiControl );
       
    69 
       
    70         /**
       
    71          * Sets the selected store. The store is returned
       
    72          * from SelectedContactStoresL() of the UI control interface.
       
    73          *
       
    74          * @param aContactStore     Selected store.
       
    75          */
       
    76         IMPORT_C void SetSelectedStore(
       
    77                 MVPbkContactStore& aContactStore );
       
    78 
       
    79         /**
       
    80          * Sets the focused store contact. Returned by
       
    81          * FocusedStoreContact() of the UI control interface.
       
    82          *
       
    83          * @param aContact      Focused store contact.
       
    84          */
       
    85         IMPORT_C void SetFocusedStoreContact(
       
    86                 const MVPbkStoreContact& aContact );
       
    87 
       
    88         /**
       
    89          * Sets the focused contact field. Returned by
       
    90          * FocusedField() of the UI control interface.
       
    91          *
       
    92          * @param aContactField     Focused contact field.
       
    93          */
       
    94         IMPORT_C void SetFocusedField(
       
    95                 const MVPbkBaseContactField& aContactField );
       
    96 
       
    97         /**
       
    98          * Sets the focused contact field index. Returned by
       
    99          * FocusedFieldIndex() of the UI control interface.
       
   100          *
       
   101          * @param aFieldIndex   Focused field index.
       
   102          */
       
   103         IMPORT_C void SetFocusedFieldIndex(
       
   104                 TInt aFieldIndex );
       
   105 
       
   106     public: // From MPbk2ContactUiControl
       
   107         MPbk2ContactUiControl* ParentControl() const;
       
   108         TInt NumberOfContacts() const;
       
   109         const MVPbkBaseContact* FocusedContactL() const;
       
   110         const MVPbkViewContact* FocusedViewContactL() const;
       
   111         const MVPbkStoreContact* FocusedStoreContact() const;
       
   112         void SetFocusedContactL(
       
   113                 const MVPbkBaseContact& aContact );
       
   114         void SetFocusedContactL(
       
   115                 const MVPbkContactBookmark& aContactBookmark );
       
   116         void SetFocusedContactL(
       
   117                 const MVPbkContactLink& aContactLink );
       
   118         TInt FocusedContactIndex() const;
       
   119         void SetFocusedContactIndexL(
       
   120                 TInt aIndex );
       
   121         TInt NumberOfContactFields() const;
       
   122         const MVPbkBaseContactField* FocusedField() const;
       
   123         TInt FocusedFieldIndex() const;
       
   124         TBool ContactsMarked() const;
       
   125         MVPbkContactLinkArray* SelectedContactsL() const;
       
   126         MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const;
       
   127         MPbk2ContactLinkIterator* SelectedContactsIteratorL() const;
       
   128         CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const;
       
   129         void ClearMarks();
       
   130         void SetSelectedContactL(
       
   131                 TInt aIndex,
       
   132                 TBool aSelected );
       
   133         void SetSelectedContactL(
       
   134                 const MVPbkContactBookmark& aContactBookmark,
       
   135                 TBool aSelected );
       
   136         void SetSelectedContactL(
       
   137                 const MVPbkContactLink& aContactLink,
       
   138                 TBool aSelected );
       
   139 
       
   140         void DynInitMenuPaneL(
       
   141                 TInt aResourceId,
       
   142                 CEikMenuPane* aMenuPane ) const;
       
   143         void ProcessCommandL(
       
   144                 TInt aCommandId ) const;
       
   145         void UpdateAfterCommandExecution();
       
   146         TInt GetMenuFilteringFlagsL() const;
       
   147         CPbk2ViewState* ControlStateL() const;
       
   148         void RestoreControlStateL(
       
   149                 CPbk2ViewState* aState );
       
   150         const TDesC& FindTextL();
       
   151         void ResetFindL();
       
   152         void ShowThumbnail();
       
   153         void HideThumbnail();
       
   154         void SetBlank(
       
   155                 TBool aBlank );
       
   156         void RegisterCommand(
       
   157                 MPbk2Command* aCommand );
       
   158         void SetTextL(
       
   159                 const TDesC& aText );
       
   160         TAny* ContactUiControlExtension(TUid aExtensionUid );
       
   161                 
       
   162        public: // From MPbk2ContactUiControl2         
       
   163         TInt CommandItemCount() const;
       
   164         const MPbk2UiControlCmdItem& CommandItemAt( TInt aIndex ) const;
       
   165         const MPbk2UiControlCmdItem* FocusedCommandItem() const;
       
   166         void DeleteCommandItemL( TInt aIndex );
       
   167         void AddCommandItemL(MPbk2UiControlCmdItem* aCommand, TInt aIndex);
       
   168 
       
   169     private: // Implementation
       
   170         CPbk2ContactUiControlSubstitute();
       
   171         void ConstructL();
       
   172         void Draw(
       
   173                 const TRect& aRect ) const;
       
   174 
       
   175     private: // Data
       
   176         /// Ref: The selected contact store
       
   177         MVPbkContactStore* iContactStore;
       
   178         /// Ref: The parent control
       
   179         MPbk2ContactUiControl* iParentUiControl;
       
   180         /// Ref: The store contact
       
   181         const MVPbkStoreContact* iStoreContact;
       
   182         /// Own: The focused field index
       
   183         TInt iFocusedFieldIndex;
       
   184         /// Ref: The focused field
       
   185         const MVPbkBaseContactField* iContactField;
       
   186         /// Own: Background skin context
       
   187         CAknsBasicBackgroundControlContext* iBgSkinContext;
       
   188     };
       
   189 
       
   190 #endif // CPBK2CONTACTUICONTROLSUBSTITUTE_H
       
   191 
       
   192 // End of File