phonebookui/Phonebook2/ServerApplication/inc/CPbk2MultiContactDataAssigner.h
changeset 0 e686773b3f54
child 18 d4f567ce2e7c
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 multiple contact data assigner.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2MULTICONTACTDATAASSIGNER_H
       
    20 #define CPBK2MULTICONTACTDATAASSIGNER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MPbk2UiService.h"
       
    25 #include "mpbk2serverappstartupobserver.h"
       
    26 #include "MPbk2ServicePhaseObserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MPbk2ContactDataAssigner;
       
    30 class CVPbkContactStoreUriArray;
       
    31 class MPbk2UiServiceObserver;
       
    32 class MPbk2SelectFieldProperty;
       
    33 class CPbk2ServerAppStoreManager;
       
    34 class CVPbkFieldTypeSelector;
       
    35 class MPbk2ServicePhase;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Phonebook 2 multiple contact data assigner.
       
    41  * Responsible for driving multiple contact assign phases.
       
    42  */
       
    43 class CPbk2MultiContactDataAssigner : public CBase,
       
    44                                       public MPbk2UiService,
       
    45                                       public MPbk2ServicePhaseObserver,
       
    46                                       private MPbk2ServerAppStartupObserver
       
    47     {
       
    48     public: // Construction
       
    49 
       
    50         /**
       
    51          * Creates a new instance of this class.
       
    52          *
       
    53          * @param aMessage      Client-Server message.
       
    54          * @param aObserver     UI service observer.
       
    55          * @return  A new instance of this class.
       
    56          */
       
    57         static CPbk2MultiContactDataAssigner* NewL(
       
    58                 const RMessage2& aMessage,
       
    59                 MPbk2UiServiceObserver& aObserver );
       
    60 
       
    61         /**
       
    62          * Destructor.
       
    63          */
       
    64         ~CPbk2MultiContactDataAssigner();
       
    65 
       
    66     public: // From MPbk2UiService
       
    67         void LaunchServiceL();
       
    68         void CancelService();
       
    69         void AcceptDelayedContactsL(
       
    70                 const TDesC8& aContactLinkBuffer );
       
    71         void ExitServiceL(
       
    72                 TInt aExitCommandId );
       
    73         void ServiceResults(TServiceResults* aResults) const;
       
    74 
       
    75     public: // From MPbk2ServicePhaseObserver
       
    76         void NextPhase(
       
    77                 MPbk2ServicePhase& aPhase );
       
    78         void PreviousPhase(
       
    79                 MPbk2ServicePhase& aPhase );
       
    80         void PhaseCanceled(
       
    81                 MPbk2ServicePhase& aPhase );
       
    82         void PhaseAborted(
       
    83                 MPbk2ServicePhase& aPhase );
       
    84         void PhaseError(
       
    85                 MPbk2ServicePhase& aPhase,
       
    86                 TInt aErrorCode );
       
    87         TBool PhaseOkToExit(
       
    88                 MPbk2ServicePhase& aPhase,
       
    89                 TInt aCommandId );
       
    90         void PhaseAccept(
       
    91                 MPbk2ServicePhase& aPhase,
       
    92                 const TDesC8& aMarkedEntries,
       
    93                 const TDesC8& aLinkData );
       
    94 
       
    95     private: // From MPbk2ServerAppStartupObserver
       
    96         void ContactUiReadyL(
       
    97                 MPbk2StartupMonitor& aStartupMonitor );
       
    98         void  StartupCanceled(
       
    99                 TInt aErrorCode );
       
   100 
       
   101     private: // Implementation
       
   102         CPbk2MultiContactDataAssigner(
       
   103                 MPbk2UiServiceObserver& aObserver );
       
   104         void ConstructL(
       
   105                 const RMessage2& aMessage );
       
   106         void LaunchFetchPhaseL();
       
   107         void LaunchSelectMultiPropertyPhaseL(
       
   108                 MVPbkContactLinkArray* aContactLinks );
       
   109         void LaunchPrepareMultiAssignPhaseL(
       
   110                 MVPbkContactLinkArray* aContactLinks );
       
   111         void LaunchAssignPhaseL(
       
   112                 MVPbkContactLinkArray* aContactLinks );
       
   113 
       
   114     private: // Data
       
   115         /// Own: Contact data assigner
       
   116         MPbk2ContactDataAssigner* iContactDataAssigner;
       
   117         /// Own: Mime type
       
   118         TInt iMimeType;
       
   119         /// Own: Loaded contact store URIs
       
   120         CVPbkContactStoreUriArray* iStoreUris;
       
   121         /// Own: Textual data to assign
       
   122         HBufC* iDataBuffer;
       
   123         /// Own: Address select filter buffer
       
   124         HBufC8* iAddressSelectFilterBuffer;
       
   125         /// Own: Preselected contacts
       
   126         MVPbkContactLinkArray* iPreselectedContacts;
       
   127         /// Own: Select field property interface
       
   128         MPbk2SelectFieldProperty* iSelectFieldProperty;
       
   129         /// Own: Note flags
       
   130         TUint iInformationNoteFlags;
       
   131         /// Ref: UI service observer
       
   132         MPbk2UiServiceObserver& iObserver;
       
   133         /// Own: Server app store manager
       
   134         CPbk2ServerAppStoreManager* iStoreManager;
       
   135         /// Own: Contact view filter
       
   136         CVPbkFieldTypeSelector* iContactViewFilter;
       
   137         /// Own: Fetch phase
       
   138         MPbk2ServicePhase* iFetchPhase;
       
   139         /// Own: Select property phase
       
   140         MPbk2ServicePhase* iSelectPropertyPhase;
       
   141         /// Own: Prepare assign phase
       
   142         MPbk2ServicePhase* iPrepareAssignPhase;
       
   143         /// Own: Assign data phase
       
   144         MPbk2ServicePhase* iAssignDataPhase;
       
   145         /// Own: ETrue if using default store configuration
       
   146         TBool iUseDeviceConfig;
       
   147     };
       
   148 
       
   149 #endif // CPBK2MULTICONTACTDATAASSIGNER_H
       
   150 
       
   151 // End of File