phonebookui/Phonebook2/Commands/inc/CPbk2PrependCmd.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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:  Prepend command object.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2PREPENDCMD_H
       
    20 #define CPBK2PREPENDCMD_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2Command.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MPbk2ContactUiControl;
       
    28 class MVPbkContactOperationBase;
       
    29 class MVPbkStoreContact;
       
    30 class CAiwServiceHandler;
       
    31 class CPbk2PresentationContact;
       
    32 class CPbk2ContactUiControlSubstitute;
       
    33 class CPbk2CallTypeSelector;
       
    34 class CPbk2FieldPropertyArray;
       
    35 
       
    36 // CLASS DECLARATIONS
       
    37 
       
    38 /**
       
    39  * Phonebook 2 prepend command implementation.
       
    40  * Responsible for:
       
    41  *  - User can edit phone number before make call.
       
    42  *  - Prepending do not edit contact information.
       
    43  */
       
    44 NONSHARABLE_CLASS(CPbk2PrependCmd) : public CBase,
       
    45                                      public MPbk2Command
       
    46     {
       
    47     public: // Constructor and destructor
       
    48 
       
    49         /**
       
    50          * Creates a new instance of this class.
       
    51          *
       
    52          * @param aMenuCommandId    Menu command id.
       
    53          * @param aUiControl        UI control.
       
    54          * @param aServiceHandler   Aiw service handler.
       
    55          * @param aSelector         Call type selector.
       
    56          * @param aStoreContact     Store contact.
       
    57          * @return  A new instance of this class.
       
    58          */
       
    59         static CPbk2PrependCmd* NewL(
       
    60                 TInt aMenuCommandId,
       
    61                 MPbk2ContactUiControl& aUiControl,
       
    62                 CAiwServiceHandler& aServiceHandler,
       
    63                 CPbk2CallTypeSelector& aSelector,
       
    64                 MVPbkStoreContact*& aStoreContact,
       
    65                 CPbk2FieldPropertyArray& aFieldProperties);
       
    66 
       
    67         /**
       
    68          * Destructor.
       
    69          */
       
    70         ~CPbk2PrependCmd();
       
    71 
       
    72     public: // From MPbk2Command
       
    73         void ExecuteLD();
       
    74         void ResetUiControl(
       
    75                 MPbk2ContactUiControl& aUiControl );
       
    76         void AddObserver(
       
    77                 MPbk2CommandObserver& aObserver );
       
    78 
       
    79     private: // Implementation
       
    80         CPbk2PrependCmd( 
       
    81                 TInt aMenuCommandId,
       
    82                 MPbk2ContactUiControl& aUiControl,
       
    83                 CAiwServiceHandler& aServiceHandler,
       
    84                 CPbk2CallTypeSelector& aSelector,
       
    85                 MVPbkStoreContact*& aStoreContact,
       
    86                 CPbk2FieldPropertyArray& aFieldProperties);
       
    87         void ConstructL();
       
    88         void ExecuteDlgL();
       
    89         CPbk2PresentationContact* CreatePresentationContactLC();
       
    90         TInt ToStoreFieldIndexL( TInt aPresIndex );
       
    91         TInt MaxLengthOfEditorL( TInt aFieldStoreIndex );
       
    92                         
       
    93     private: // Data
       
    94         /// Ref: UI control
       
    95         MPbk2ContactUiControl* iUiControl;                
       
    96         /// Ref: AIW service handler
       
    97         CAiwServiceHandler& iServiceHandler;
       
    98         /// Ref: Call type selector
       
    99         CPbk2CallTypeSelector& iSelector;
       
   100         /// Own: UI control substitute
       
   101         CPbk2ContactUiControlSubstitute* iUiControlSubstitute;
       
   102         /// Own: Temporary contact
       
   103         MVPbkStoreContact* iTempContact;
       
   104         /// Own: Menu command id
       
   105         TInt iMenuCommandId;
       
   106         /// Ref: Store contact
       
   107         MVPbkStoreContact* iStoreContact;
       
   108         /// Ref:
       
   109         CPbk2FieldPropertyArray& iFieldProperties;
       
   110     };
       
   111 
       
   112 #endif // CPBK2PREPENDCMD_H
       
   113 
       
   114 // End of File