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