|
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 contact attribute assigner. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2CONTACTATTRIBUTEASSIGNER_H |
|
20 #define CPBK2CONTACTATTRIBUTEASSIGNER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "MPbk2UiService.h" |
|
24 #include "mpbk2serverappstartupobserver.h" |
|
25 #include "MPbk2ServicePhaseObserver.h" |
|
26 #include <Pbk2ServerAppIPC.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MPbk2UiServiceObserver; |
|
30 class CVPbkContactStoreUriArray; |
|
31 class CPbk2ServerAppStoreManager; |
|
32 class CVPbkFieldTypeSelector; |
|
33 class MPbk2ServicePhase; |
|
34 class CEikonEnv; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Phonebook 2 contact attribute assigner. |
|
40 * Responsible for driving contact attribute assign phases. |
|
41 */ |
|
42 class CPbk2ContactAttributeAssigner : public CBase, |
|
43 public MPbk2UiService, |
|
44 public MPbk2ServicePhaseObserver, |
|
45 private MPbk2ServerAppStartupObserver |
|
46 { |
|
47 public: // Construction and destruction |
|
48 |
|
49 /** |
|
50 * Creates a new instance of this class. |
|
51 * |
|
52 * @param aMessage Client server message. |
|
53 * @param aObserver UI service observer. |
|
54 * @return A new instance of this class. |
|
55 */ |
|
56 static CPbk2ContactAttributeAssigner* NewL( |
|
57 const RMessage2& aMessage, |
|
58 MPbk2UiServiceObserver& aObserver ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 ~CPbk2ContactAttributeAssigner(); |
|
64 |
|
65 public: // From MPbk2UiService |
|
66 void LaunchServiceL(); |
|
67 void CancelService(); |
|
68 void AcceptDelayedContactsL( |
|
69 const TDesC8& aContactLinkBuffer ); |
|
70 void ExitServiceL( |
|
71 TInt aExitCommandId ); |
|
72 void ServiceResults(TServiceResults* aResults) const; |
|
73 |
|
74 public: // From MPbk2ServicePhaseObserver |
|
75 void NextPhase( |
|
76 MPbk2ServicePhase& aPhase ); |
|
77 void PreviousPhase( |
|
78 MPbk2ServicePhase& aPhase ); |
|
79 void PhaseCanceled( |
|
80 MPbk2ServicePhase& aPhase ); |
|
81 void PhaseAborted( |
|
82 MPbk2ServicePhase& aPhase ); |
|
83 void PhaseError( |
|
84 MPbk2ServicePhase& aPhase, |
|
85 TInt aErrorCode ); |
|
86 TBool PhaseOkToExit( |
|
87 MPbk2ServicePhase& aPhase, |
|
88 TInt aCommandId ); |
|
89 void PhaseAccept( |
|
90 MPbk2ServicePhase& aPhase, |
|
91 const TDesC8& aMarkedEntries, |
|
92 const TDesC8& aLinkData ); |
|
93 |
|
94 private: // From MPbk2ServerAppStartupObserver |
|
95 void ContactUiReadyL( |
|
96 MPbk2StartupMonitor& aStartupMonitor ); |
|
97 void StartupCanceled( |
|
98 TInt aErrorCode ); |
|
99 |
|
100 private: // Implementation |
|
101 CPbk2ContactAttributeAssigner( |
|
102 MPbk2UiServiceObserver& aObserver ); |
|
103 void ConstructL( |
|
104 const RMessage2& aMessage ); |
|
105 void BuildViewL(); |
|
106 void LaunchFetchPhaseL(); |
|
107 void LaunchPrepareAttributeAssignPhaseL( |
|
108 MVPbkContactLinkArray* aContactLinks ); |
|
109 void LaunchAddressSelectPhaseL( |
|
110 MVPbkContactLinkArray* aContactLinks ); |
|
111 void LaunchAssignPhaseL( |
|
112 MVPbkContactLinkArray* aContactLinks ); |
|
113 |
|
114 private: // Data |
|
115 /// Own: Server app store manager |
|
116 CPbk2ServerAppStoreManager* iStoreManager; |
|
117 /// Own: Loaded contact store URIs |
|
118 CVPbkContactStoreUriArray* iStoreUris; |
|
119 /// Own: Attribute data to assign |
|
120 TPbk2AttributeAssignData iAttributeData; |
|
121 /// Own: Preselected contacts |
|
122 MVPbkContactLinkArray* iPreselectedContacts; |
|
123 /// Ref: UI service observer |
|
124 MPbk2UiServiceObserver& iObserver; |
|
125 /// Own: Remove attribute indicator |
|
126 TBool iRemoveAttribute; |
|
127 /// Own: Contact view filter |
|
128 CVPbkFieldTypeSelector* iContactViewFilter; |
|
129 /// Own: Fetch phase |
|
130 MPbk2ServicePhase* iFetchPhase; |
|
131 /// Own: Prepare phase |
|
132 MPbk2ServicePhase* iPrepareAssignPhase; |
|
133 /// Own: Address select phase |
|
134 MPbk2ServicePhase* iAddressSelectPhase; |
|
135 /// Own: Assign attribute phase |
|
136 MPbk2ServicePhase* iAssignAttributePhase; |
|
137 /// Own: Flag for using current config in fetch |
|
138 TBool iUseDeviceConfig; |
|
139 /// Ref: Eikon enviroment |
|
140 CEikonEnv* iEikEnv; |
|
141 }; |
|
142 |
|
143 #endif // CPBK2CONTACTATTRIBUTEASSIGNER_H |
|
144 |
|
145 // End of File |