phonebookui/Phonebook2/UIControls/inc/CPbk2NamesListStartupState.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 names list startup state.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2NAMESLISTSTARTUPSTATE_H
       
    20 #define CPBK2NAMESLISTSTARTUPSTATE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include "MPbk2NamesListState.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPbk2ContactViewListBox;
       
    28 class CAknSearchField;
       
    29 
       
    30 // CLASS DECLARATIONß
       
    31 
       
    32 /**
       
    33  * Phonebook 2 names list not ready state.
       
    34  */
       
    35 NONSHARABLE_CLASS(CPbk2NamesListStartupState) : public CBase,
       
    36                                                 public MPbk2NamesListState
       
    37     {
       
    38     public:  // Constructors and destructor
       
    39 
       
    40         /**
       
    41          * Creates a new instance of this class.
       
    42          *
       
    43          * @param aParent   Parent control.
       
    44          * @param aListBox  List box.
       
    45          * @param aFindBox  Find box.
       
    46          * @return  A new instance of this class.
       
    47          */
       
    48         static CPbk2NamesListStartupState* NewLC(
       
    49                 const CCoeControl* aParent,
       
    50                 CPbk2ContactViewListBox& aListBox,
       
    51                 CAknSearchField* aFindBox );
       
    52 
       
    53         /**
       
    54          * Destructor.
       
    55          */
       
    56         ~CPbk2NamesListStartupState();
       
    57 
       
    58     public: // From MPbk2NamesListState
       
    59         void ActivateStateL();
       
    60         void DeactivateState();
       
    61         TInt CountComponentControls() const;
       
    62         CCoeControl* ComponentControl(
       
    63                 TInt aIndex ) const;
       
    64         void SizeChanged();
       
    65         void MakeComponentsVisible(
       
    66                 TBool aVisible );
       
    67         void ActivateL();
       
    68         void Draw(
       
    69                 const TRect& aRect,
       
    70                 CWindowGc& aGc ) const;
       
    71         TKeyResponse OfferKeyEventL(
       
    72                 const TKeyEvent& aKeyEvent,
       
    73                 TEventCode aType );
       
    74         void HandlePointerEventL(
       
    75                 const TPointerEvent& aPointerEvent );
       
    76         TInt NamesListState() const;
       
    77         void HandleContactViewEventL(
       
    78                 TInt aEvent,
       
    79                 TInt aIndex );
       
    80         void HandleCommandEventL(TInt aEvent, TInt aListboxIndex);
       
    81         CCoeControl& CoeControl();
       
    82         void HandleControlEventL(
       
    83                 CCoeControl* aControl,
       
    84                 MCoeControlObserver::TCoeEvent aEventType, 
       
    85                 TInt aParam );
       
    86         const MVPbkViewContact* TopContactL();
       
    87 
       
    88     public: // From MPbk2ContactUiControl
       
    89         MPbk2ContactUiControl* ParentControl() const;
       
    90         TInt NumberOfContacts() const;
       
    91         const MVPbkBaseContact* FocusedContactL() const;
       
    92         const MVPbkViewContact* FocusedViewContactL() const;
       
    93         const MVPbkStoreContact* FocusedStoreContact() const;
       
    94         void SetFocusedContactL(
       
    95                 const MVPbkBaseContact& aContact );
       
    96         void SetFocusedContactL(
       
    97                 const MVPbkContactBookmark& aContactBookmark );
       
    98         void SetFocusedContactL(
       
    99                 const MVPbkContactLink& aContactLink );
       
   100         TInt FocusedContactIndex() const;
       
   101         void SetFocusedContactIndexL(
       
   102                 TInt aIndex );
       
   103         TInt NumberOfContactFields() const;
       
   104         const MVPbkBaseContactField* FocusedField() const;
       
   105         TInt FocusedFieldIndex() const;
       
   106         void SetFocusedFieldIndex( TInt aIndex );
       
   107         TBool ContactsMarked() const;
       
   108         MVPbkContactLinkArray* SelectedContactsL() const;
       
   109         MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const;
       
   110         MPbk2ContactLinkIterator* SelectedContactsIteratorL() const;
       
   111         CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const;
       
   112         void ClearMarks();
       
   113         void SetSelectedContactL(
       
   114                 TInt aIndex,
       
   115                 TBool aSelected );
       
   116         void SetSelectedContactL(
       
   117                 const MVPbkContactBookmark& aContactBookmark,
       
   118                 TBool aSelected );
       
   119         void SetSelectedContactL(
       
   120                 const MVPbkContactLink& aContactLink,
       
   121                 TBool aSelected );
       
   122         
       
   123         void DynInitMenuPaneL(
       
   124                 TInt aResourceId,
       
   125                 CEikMenuPane* aMenuPane ) const;
       
   126         void ProcessCommandL( TInt aCommandId ) const;
       
   127         void UpdateAfterCommandExecution();
       
   128         TInt GetMenuFilteringFlagsL() const;
       
   129         CPbk2ViewState* ControlStateL() const;
       
   130         void RestoreControlStateL(
       
   131                 CPbk2ViewState* aState );
       
   132         const TDesC& FindTextL();
       
   133         void ResetFindL();
       
   134         void HideThumbnail();
       
   135         void ShowThumbnail();
       
   136         void SetBlank(
       
   137                 TBool aBlank );
       
   138         void RegisterCommand(
       
   139                 MPbk2Command* aCommand );
       
   140         void SetTextL(
       
   141                 const TDesC& aText );
       
   142         TAny* ContactUiControlExtension(TUid aExtensionUid );
       
   143     
       
   144     public: // From MPbk2ContactUiControl2        
       
   145         TInt CommandItemCount() const;
       
   146         const MPbk2UiControlCmdItem& CommandItemAt( TInt aIndex ) const;
       
   147         const MPbk2UiControlCmdItem* FocusedCommandItem() const;
       
   148         void DeleteCommandItemL( TInt aIndex );
       
   149         void AddCommandItemL(MPbk2UiControlCmdItem* aCommand, TInt aIndex);        
       
   150         
       
   151     public: // From MPbk2PointerEventInspector
       
   152         TBool FocusedItemPointed();
       
   153         TBool FocusableItemPointed();
       
   154         TBool SearchFieldPointed();
       
   155         
       
   156     public: // From MPbk2FilteredViewStackObserver
       
   157         void TopViewChangedL( MVPbkContactViewBase& aOldView );
       
   158         void TopViewUpdatedL();
       
   159         void BaseViewChangedL();
       
   160         void ViewStackError( TInt aError );
       
   161         void ContactAddedToBaseView(
       
   162                 MVPbkContactViewBase& aBaseView, TInt aIndex,
       
   163                 const MVPbkContactLink& aContactLink );        
       
   164 
       
   165     private: // Implementation
       
   166         CPbk2NamesListStartupState(
       
   167                 const CCoeControl& aParent,
       
   168                 CPbk2ContactViewListBox& aListBox,
       
   169                 CAknSearchField* aFindBox );
       
   170 
       
   171     private: // Data
       
   172         /// Ref: Parent coecontrol
       
   173         const CCoeControl& iParent;
       
   174         /// Ref: The list box
       
   175         CPbk2ContactViewListBox& iListBox;
       
   176         /// Ref: The find box
       
   177         CAknSearchField* iFindBox;
       
   178     };
       
   179 
       
   180 #endif // CPBK2NAMESLISTSTARTUPSTATE_H
       
   181 
       
   182 // End of File