phonebookui/Phonebook2/Commands/inc/CPbk2CallCmd.h
changeset 0 e686773b3f54
child 23 5586b4d2ec3e
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 call command object.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CALLCMD_H
       
    20 #define CPBK2CALLCMD_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2Command.h>
       
    25 #include <VPbkFieldTypeSelectorFactory.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CAiwServiceHandler;
       
    29 class MPbk2ContactUiControl;
       
    30 class MVPbkStoreContactField;
       
    31 class MVPbkStoreContact;
       
    32 class CPbk2CallTypeSelector;
       
    33 class CAiwDialDataExt;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Phonebook 2 call command object.
       
    39  * Responsible for setting up dial data and launching the call by using AIW.
       
    40  */
       
    41 NONSHARABLE_CLASS(CPbk2CallCmd) : public CBase,
       
    42                                   public MPbk2Command
       
    43     {
       
    44     public: // Construction and destruction
       
    45 
       
    46         /**
       
    47          * Creates a new instance of this class.
       
    48          *
       
    49          * @param aContact          Reference to the contact.
       
    50          * @param aSelectField      Selected contact field,
       
    51          *                          ownership is taken.
       
    52          * @param aControl          Contact UI control.
       
    53          * @param aCommandId        Command id.
       
    54          * @param aServiceHandler   Reference to service handler.
       
    55          * @param aSelector         Reference to call type selector.
       
    56          * @return  A new instance of this class.
       
    57          */
       
    58         static CPbk2CallCmd* NewL(
       
    59                 MVPbkStoreContact*& aContact,
       
    60                 MVPbkStoreContactField* aSelectedField,
       
    61                 MPbk2ContactUiControl& aControl,
       
    62                 const TInt aCommandId,
       
    63                 CAiwServiceHandler& aServiceHandler,
       
    64                 CPbk2CallTypeSelector& aSelector );
       
    65         
       
    66         /**
       
    67          * Creates a new instance of this class.
       
    68          *
       
    69          * @param aContact          Reference to the contact.
       
    70          * @param aSelectField      Selected contact field,
       
    71          *                          ownership is taken.
       
    72          * @param aControl          Contact UI control.
       
    73          * @param aCommandId        Command id.
       
    74          * @param aServiceHandler   Reference to service handler.
       
    75          * @param aSelector         Reference to call type selector.
       
    76          * @param aActionSelector   Action type selector.
       
    77          * @return  A new instance of this class.
       
    78          */
       
    79         static CPbk2CallCmd* NewL(
       
    80                 MVPbkStoreContact*& aContact,
       
    81                 MVPbkStoreContactField* aSelectedField,
       
    82                 MPbk2ContactUiControl& aControl,
       
    83                 const TInt aCommandId,
       
    84                 CAiwServiceHandler& aServiceHandler,
       
    85                 CPbk2CallTypeSelector& aSelector,
       
    86                 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionSelector );
       
    87 
       
    88 
       
    89         /**
       
    90          * Destructor.
       
    91          */
       
    92         ~CPbk2CallCmd();
       
    93 
       
    94     public: // From MPbkCommand
       
    95         void ExecuteLD();
       
    96         void ResetUiControl(
       
    97                 MPbk2ContactUiControl& aUiControl );
       
    98         void AddObserver(
       
    99                 MPbk2CommandObserver& aObserver );
       
   100 
       
   101     private: // Implementation
       
   102         CPbk2CallCmd(
       
   103                 MVPbkStoreContact*& aContact,
       
   104                 MVPbkStoreContactField* aSelectedField,
       
   105                 MPbk2ContactUiControl& aControl,
       
   106                 const TInt aCommandId,
       
   107                 CAiwServiceHandler& aServiceHandler,
       
   108                 CPbk2CallTypeSelector& aSelector,
       
   109                 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionSelector );
       
   110         
       
   111         void SetCallTypeL( CAiwDialDataExt& dialData );
       
   112 
       
   113     private: // Data
       
   114         /// Ref: Contact to call to
       
   115         MVPbkStoreContact*& iContact;
       
   116         /// Own: Phone number field to call
       
   117         MVPbkStoreContactField* iSelectedField;
       
   118         /// Ref: Contact UI control
       
   119         MPbk2ContactUiControl* iControl;
       
   120         /// Own: Command id
       
   121         const TInt iCommandId;
       
   122         /// Ref: AIW service handler
       
   123         CAiwServiceHandler& iServiceHandler;
       
   124         /// Ref: Call type selector
       
   125         CPbk2CallTypeSelector& iSelector;
       
   126         /// Own: Action type selector
       
   127         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector iActionSelector;
       
   128     };
       
   129 
       
   130 #endif // CPBK2CALLCMD_H
       
   131 
       
   132 // End of File