phonebookui/Phonebook2/Commands/inc/CPbk2AiwInterestItemPoc.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 PoC AIW interest item.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2AIWINTERESTITEMPOC_H
       
    20 #define CPBK2AIWINTERESTITEMPOC_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "CPbk2AiwInterestItemBase.h"
       
    25 #include <MVPbkSingleContactOperationObserver.h>
       
    26 #include "MPbk2StoreStateCheckerObserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CAiwServiceHandler;
       
    30 class MPbk2Command;
       
    31 class MVPbkContactLink;
       
    32 class CPbk2CallTypeSelector;
       
    33 class CPbk2FieldPropertyArray;
       
    34 class MPbk2ContactUiControl;
       
    35 class CPbk2StoreStateChecker;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Phonebook 2 PoC AIW interest item.
       
    41  */
       
    42 NONSHARABLE_CLASS(CPbk2AiwInterestItemPoc) :
       
    43         public CPbk2AiwInterestItemBase,
       
    44         public MVPbkSingleContactOperationObserver,
       
    45         private MPbk2StoreStateCheckerObserver
       
    46     {
       
    47     public: // Constructors and destructor
       
    48 
       
    49         /**
       
    50          * Creates a new instance of this class.
       
    51          *
       
    52          * @param aInterestId       Interest id.
       
    53          * @params aServiceHandler  AIW service handler.
       
    54          * @return  A new instance of this class.
       
    55          */
       
    56         static CPbk2AiwInterestItemPoc* NewL(
       
    57                 TInt aInterestId,
       
    58                 CAiwServiceHandler& aServiceHandler );
       
    59 
       
    60         /**
       
    61          * Destructor.
       
    62          */
       
    63         ~CPbk2AiwInterestItemPoc();
       
    64 
       
    65     public: // From MPbk2AiwInterestItem
       
    66         TBool DynInitMenuPaneL(
       
    67                 const TInt aResourceId,
       
    68                 CEikMenuPane& aMenuPane,
       
    69                 const MPbk2ContactUiControl& aControl );
       
    70         TBool HandleCommandL(
       
    71                 const TInt aMenuCommandId,
       
    72                 MPbk2ContactUiControl& aControl,
       
    73                 TInt aServiceCommandId );
       
    74 
       
    75     private: // From MVPbkSingleContactOperationObserver
       
    76         void VPbkSingleContactOperationComplete(
       
    77                 MVPbkContactOperationBase& aOperation,
       
    78                 MVPbkStoreContact* aContact );
       
    79         void VPbkSingleContactOperationFailed(
       
    80                 MVPbkContactOperationBase& aOperation,
       
    81                 TInt aError );
       
    82 
       
    83     private: // MPbk2StoreStateCheckerObserver
       
    84         void StoreState(
       
    85                 MPbk2StoreStateCheckerObserver::TState aState );
       
    86 
       
    87     private: // From CActive
       
    88         void DoCancel();
       
    89         void RunL();
       
    90 
       
    91     private: // Data structures
       
    92         enum TNextAction
       
    93             {
       
    94             ERetrieveContact,
       
    95             EExecutePoc,
       
    96             EShowUnavailableNote,
       
    97             };
       
    98 
       
    99     private:  // Implementation
       
   100         CPbk2AiwInterestItemPoc(
       
   101                 TInt aInterestId,
       
   102                 CAiwServiceHandler& aServiceHandler );
       
   103         void ConstructL();
       
   104         void ExecuteCommandL(
       
   105                 MVPbkStoreContact& aStoreContact );
       
   106         void RetrieveContactL();
       
   107         void IssueNextAction(
       
   108                 TNextAction aState );
       
   109         void DoInitMenuPaneL(
       
   110                 const TInt aResourceId,
       
   111                 CEikMenuPane& aMenuPane,
       
   112                 const MPbk2ContactUiControl& aControl,
       
   113                 TUint aPreferredMenu = 0 ) const;
       
   114         MPbk2Command* CreatePocCmdObjectL(
       
   115                 const TInt aMenuCommandId,
       
   116                 MPbk2ContactUiControl& aControl,
       
   117                 MVPbkStoreContact& aStoreContact );
       
   118 
       
   119     private: // Data
       
   120         /// Own: Contact link
       
   121         MVPbkContactLink* iContactLink;
       
   122         /// Own: Retrieve contact operation
       
   123         MVPbkContactOperationBase* iRetriever;
       
   124         /// Own: Retrieved store contact
       
   125         MVPbkStoreContact* iStoreContact;
       
   126         /// Own: Call type selector
       
   127         CPbk2CallTypeSelector* iSelector;
       
   128         /// Ref: Field property array
       
   129         CPbk2FieldPropertyArray* iFieldPropertyArray;
       
   130         /// Own: Index of the focused field
       
   131         TInt iFocusedFieldIndex;
       
   132         /// Own: Menu command id
       
   133         TInt iMenuCommandId;
       
   134         /// Ref: Contact UI control
       
   135         MPbk2ContactUiControl* iControl;
       
   136         /// Own: Menu filtering flags
       
   137         TUint iFlags;
       
   138         /// Own: Check store state
       
   139         CPbk2StoreStateChecker* iStoreStateChecker;
       
   140         /// Own: Next action
       
   141         TNextAction iState;
       
   142     };
       
   143 
       
   144 #endif // CPBK2AIWINTERESTITEMPOC_H
       
   145 
       
   146 // End of File