|
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 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 CPbk2SingleContactDataAssigner( |
|
105 MPbk2UiServiceObserver& aObserver ); |
|
106 void ConstructL( |
|
107 const RMessage2& aMessage ); |
|
108 void LaunchFetchPhaseL(); |
|
109 void LaunchSelectSinglePropertyPhaseL( |
|
110 MVPbkContactLinkArray* aContactLinks ); |
|
111 void LaunchSelectCreateNewPropertyPhaseL( |
|
112 TVPbkContactStoreUriPtr savingStoreUri ); |
|
113 void LaunchPrepareSingleAssignPhaseL( |
|
114 MVPbkStoreContact* aStoreContact ); |
|
115 void LaunchAssignPhaseL( |
|
116 MVPbkStoreContact* aStoreContact ); |
|
117 |
|
118 private: // Data |
|
119 /// Own: Editor help context |
|
120 TCoeHelpContext iEditorHelpContext; |
|
121 /// Own: Mime type |
|
122 TInt iMimeType; |
|
123 /// Own: Loaded contact store URIs |
|
124 CVPbkContactStoreUriArray* iStoreUris; |
|
125 /// Own: Textual data to assign |
|
126 HBufC* iDataBuffer; |
|
127 /// Own: Address select filter buffer |
|
128 HBufC8* iAddressSelectFilterBuffer; |
|
129 /// Own: Preselected contact |
|
130 MVPbkContactLinkArray* iPreselectedContact; |
|
131 /// Own: Select field property interface |
|
132 MPbk2SelectFieldProperty* iSelectFieldProperty; |
|
133 /// Own: Assign flags set by the consumer |
|
134 TUint iAssignFlags; |
|
135 /// Own: Note flags |
|
136 TUint iInformationNoteFlags; |
|
137 /// Ref: UI service observer |
|
138 MPbk2UiServiceObserver& iObserver; |
|
139 /// Own: Server app store manager |
|
140 CPbk2ServerAppStoreManager* iStoreManager; |
|
141 /// Own: Contact view filter |
|
142 CVPbkFieldTypeSelector* iContactViewFilter; |
|
143 /// Own: Fetch phase |
|
144 MPbk2ServicePhase* iFetchPhase; |
|
145 /// Own: Select property phase |
|
146 MPbk2ServicePhase* iSelectPropertyPhase; |
|
147 /// Own: Prepare assign phase |
|
148 MPbk2ServicePhase* iPrepareAssignPhase; |
|
149 /// Own: Assign data phase |
|
150 MPbk2ServicePhase* iAssignDataPhase; |
|
151 /// Own: Select field result |
|
152 TInt iSelectFieldResult; |
|
153 /// Own: Selected field index |
|
154 TInt iFieldIndex; |
|
155 /// Own: Relocation flags |
|
156 TUint iRelocationFlags; |
|
157 /// Own: ETrue if using default store configuration |
|
158 TBool iUseDeviceConfig; |
|
159 }; |
|
160 |
|
161 #endif // CPBK2SINGLECONTACTDATAASSIGNER_H |
|
162 |
|
163 // End of File |