phonebookui/Phonebook2/ServerApplication/inc/CPbk2MultiContactDataAssigner.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
child 85 38bb213f60ba
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:  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 DenyDelayedContactsL(
       
    72                 const TDesC8& aContactLinkBuffer );
       
    73         void ExitServiceL(
       
    74                 TInt aExitCommandId );
       
    75         void ServiceResults(TServiceResults* aResults) const;
       
    76 
       
    77     public: // From MPbk2ServicePhaseObserver
       
    78         void NextPhase(
       
    79                 MPbk2ServicePhase& aPhase );
       
    80         void PreviousPhase(
       
    81                 MPbk2ServicePhase& aPhase );
       
    82         void PhaseCanceled(
       
    83                 MPbk2ServicePhase& aPhase );
       
    84         void PhaseAborted(
       
    85                 MPbk2ServicePhase& aPhase );
       
    86         void PhaseError(
       
    87                 MPbk2ServicePhase& aPhase,
       
    88                 TInt aErrorCode );
       
    89         TBool PhaseOkToExit(
       
    90                 MPbk2ServicePhase& aPhase,
       
    91                 TInt aCommandId );
       
    92         void PhaseAccept(
       
    93                 MPbk2ServicePhase& aPhase,
       
    94                 const TDesC8& aMarkedEntries,
       
    95                 const TDesC8& aLinkData );
       
    96 
       
    97     private: // From MPbk2ServerAppStartupObserver
       
    98         void ContactUiReadyL(
       
    99                 MPbk2StartupMonitor& aStartupMonitor );
       
   100         void  StartupCanceled(
       
   101                 TInt aErrorCode );
       
   102 
       
   103     private: // Implementation
       
   104         CPbk2MultiContactDataAssigner(
       
   105                 MPbk2UiServiceObserver& aObserver );
       
   106         void ConstructL(
       
   107                 const RMessage2& aMessage );
       
   108         void LaunchFetchPhaseL();
       
   109         void LaunchSelectMultiPropertyPhaseL(
       
   110                 MVPbkContactLinkArray* aContactLinks );
       
   111         void LaunchPrepareMultiAssignPhaseL(
       
   112                 MVPbkContactLinkArray* aContactLinks );
       
   113         void LaunchAssignPhaseL(
       
   114                 MVPbkContactLinkArray* aContactLinks );
       
   115 
       
   116     private: // Data
       
   117         /// Own: Contact data assigner
       
   118         MPbk2ContactDataAssigner* iContactDataAssigner;
       
   119         /// Own: Mime type
       
   120         TInt iMimeType;
       
   121         /// Own: Loaded contact store URIs
       
   122         CVPbkContactStoreUriArray* iStoreUris;
       
   123         /// Own: Textual data to assign
       
   124         HBufC* iDataBuffer;
       
   125         /// Own: Address select filter buffer
       
   126         HBufC8* iAddressSelectFilterBuffer;
       
   127         /// Own: Preselected contacts
       
   128         MVPbkContactLinkArray* iPreselectedContacts;
       
   129         /// Own: Select field property interface
       
   130         MPbk2SelectFieldProperty* iSelectFieldProperty;
       
   131         /// Own: Note flags
       
   132         TUint iInformationNoteFlags;
       
   133         /// Ref: UI service observer
       
   134         MPbk2UiServiceObserver& iObserver;
       
   135         /// Own: Server app store manager
       
   136         CPbk2ServerAppStoreManager* iStoreManager;
       
   137         /// Own: Contact view filter
       
   138         CVPbkFieldTypeSelector* iContactViewFilter;
       
   139         /// Own: Fetch phase
       
   140         MPbk2ServicePhase* iFetchPhase;
       
   141         /// Own: Select property phase
       
   142         MPbk2ServicePhase* iSelectPropertyPhase;
       
   143         /// Own: Prepare assign phase
       
   144         MPbk2ServicePhase* iPrepareAssignPhase;
       
   145         /// Own: Assign data phase
       
   146         MPbk2ServicePhase* iAssignDataPhase;
       
   147         /// Own: ETrue if using default store configuration
       
   148         TBool iUseDeviceConfig;
       
   149     };
       
   150 
       
   151 #endif // CPBK2MULTICONTACTDATAASSIGNER_H
       
   152 
       
   153 // End of File