phonebookui/Phonebook2/ServerApplication/inc/CPbk2ContactEditorOperator.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 server app contact editor operator.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTEDITOROPERATOR_H
       
    20 #define CPBK2CONTACTEDITOROPERATOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2ExitCallback.h>
       
    25 #include <MPbk2DialogEliminator.h>
       
    26 #include <coehelp.h> // TCoeHelpContext
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MVPbkStoreContact;
       
    30 class MPbk2EditedContactObserver;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * Phonebook 2 server app contact editor operator.
       
    36  * Responsible for implementing all server app contact editor operations.
       
    37  */
       
    38 class CPbk2ContactEditorOperator :  public CBase,
       
    39                                     public MPbk2ExitCallback,
       
    40                                     public MPbk2DialogEliminator
       
    41     {
       
    42     public: // Construction and destruction
       
    43 
       
    44         /**
       
    45          * Creates a new instance of this class.
       
    46          *
       
    47          * @param aExitCallback     Exit callback.
       
    48          * @param aContactObserver  Observer for the edited contact.
       
    49          * @return  A new instance of this class.
       
    50          */
       
    51         static CPbk2ContactEditorOperator* NewLC(
       
    52                 MPbk2ExitCallback& aExitCallback,
       
    53                 MPbk2EditedContactObserver& aContactObserver );
       
    54 
       
    55         /**
       
    56          * Destructor.
       
    57          */
       
    58         ~CPbk2ContactEditorOperator();
       
    59 
       
    60     public: // Interface
       
    61 
       
    62         /**
       
    63          * Opens given contact in editor.
       
    64          *
       
    65          * @param aStoreContact The store contact to edit.
       
    66          * @param aIndex        Index of the newly added field,
       
    67          *                      pass KErrNotFound if nothing was added.
       
    68          *                      This must be store index.
       
    69          * @param aFlags        Assign flags.
       
    70          * @param aHelpContext  Editor help context.
       
    71          */
       
    72         void OpenEditorL(
       
    73                 MVPbkStoreContact*& aStoreContact,
       
    74                 TInt& aIndex,
       
    75                 TUint& aFlags,
       
    76                 TCoeHelpContext& aHelpContext );
       
    77 
       
    78     public: // From MPbk2DialogEliminator
       
    79         void RequestExitL(
       
    80                  TInt aCommandId );
       
    81         void ForceExit();
       
    82         void ResetWhenDestroyed(
       
    83                 MPbk2DialogEliminator** aSelfPtr );
       
    84 
       
    85     private: // From MPbk2ExitCallback
       
    86         TBool OkToExitL(
       
    87                 TInt aCommandId );
       
    88 
       
    89     private: // Implementation
       
    90         CPbk2ContactEditorOperator(
       
    91                 MPbk2ExitCallback& aExitCallback,
       
    92                 MPbk2EditedContactObserver& aContactObserver );
       
    93 
       
    94     private: // Data
       
    95         /// Ref: Contact editor eliminator
       
    96         MPbk2DialogEliminator* iContactEditorEliminator;
       
    97         /// Ref: Exit callback
       
    98         MPbk2ExitCallback& iExitCallback;
       
    99         /// Ref: Observer for the edited contact.
       
   100         MPbk2EditedContactObserver& iContactObserver;
       
   101         /// Ref: Set to NULL when the execution enters to destructor
       
   102         MPbk2DialogEliminator** iSelfPtr;
       
   103     };
       
   104 
       
   105 #endif // CPBK2CONTACTEDITOROPERATOR_H
       
   106 
       
   107 // End of File