|
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 DenyDelayedContactsL( |
|
71 const TDesC8& aContactLinkBuffer ); |
|
72 void ExitServiceL( |
|
73 TInt aExitCommandId ); |
|
74 void ServiceResults(TServiceResults* aResults) const; |
|
75 |
|
76 public: // From MPbk2ServicePhaseObserver |
|
77 void NextPhase( |
|
78 MPbk2ServicePhase& aPhase ); |
|
79 void PreviousPhase( |
|
80 MPbk2ServicePhase& aPhase ); |
|
81 void PhaseCanceled( |
|
82 MPbk2ServicePhase& aPhase ); |
|
83 void PhaseAborted( |
|
84 MPbk2ServicePhase& aPhase ); |
|
85 void PhaseError( |
|
86 MPbk2ServicePhase& aPhase, |
|
87 TInt aErrorCode ); |
|
88 TBool PhaseOkToExit( |
|
89 MPbk2ServicePhase& aPhase, |
|
90 TInt aCommandId ); |
|
91 void PhaseAccept( |
|
92 MPbk2ServicePhase& aPhase, |
|
93 const TDesC8& aMarkedEntries, |
|
94 const TDesC8& aLinkData ); |
|
95 |
|
96 private: // From MPbk2ServerAppStartupObserver |
|
97 void ContactUiReadyL( |
|
98 MPbk2StartupMonitor& aStartupMonitor ); |
|
99 void StartupCanceled( |
|
100 TInt aErrorCode ); |
|
101 |
|
102 private: // Implementation |
|
103 CPbk2ContactAttributeAssigner( |
|
104 MPbk2UiServiceObserver& aObserver ); |
|
105 void ConstructL( |
|
106 const RMessage2& aMessage ); |
|
107 void BuildViewL(); |
|
108 void LaunchFetchPhaseL(); |
|
109 void LaunchPrepareAttributeAssignPhaseL( |
|
110 MVPbkContactLinkArray* aContactLinks ); |
|
111 void LaunchAddressSelectPhaseL( |
|
112 MVPbkContactLinkArray* aContactLinks ); |
|
113 void LaunchAssignPhaseL( |
|
114 MVPbkContactLinkArray* aContactLinks ); |
|
115 |
|
116 private: // Data |
|
117 /// Own: Server app store manager |
|
118 CPbk2ServerAppStoreManager* iStoreManager; |
|
119 /// Own: Loaded contact store URIs |
|
120 CVPbkContactStoreUriArray* iStoreUris; |
|
121 /// Own: Attribute data to assign |
|
122 TPbk2AttributeAssignData iAttributeData; |
|
123 /// Own: Preselected contacts |
|
124 MVPbkContactLinkArray* iPreselectedContacts; |
|
125 /// Ref: UI service observer |
|
126 MPbk2UiServiceObserver& iObserver; |
|
127 /// Own: Remove attribute indicator |
|
128 TBool iRemoveAttribute; |
|
129 /// Own: Contact view filter |
|
130 CVPbkFieldTypeSelector* iContactViewFilter; |
|
131 /// Own: Fetch phase |
|
132 MPbk2ServicePhase* iFetchPhase; |
|
133 /// Own: Prepare phase |
|
134 MPbk2ServicePhase* iPrepareAssignPhase; |
|
135 /// Own: Address select phase |
|
136 MPbk2ServicePhase* iAddressSelectPhase; |
|
137 /// Own: Assign attribute phase |
|
138 MPbk2ServicePhase* iAssignAttributePhase; |
|
139 /// Own: Flag for using current config in fetch |
|
140 TBool iUseDeviceConfig; |
|
141 /// Ref: Eikon enviroment |
|
142 CEikonEnv* iEikEnv; |
|
143 }; |
|
144 |
|
145 #endif // CPBK2CONTACTATTRIBUTEASSIGNER_H |
|
146 |
|
147 // End of File |