|
1 /* |
|
2 * Copyright (c) 2007-2009 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: ESMR mr entry processor |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CESMRENTRYPROCESSOR_H |
|
19 #define CESMRENTRYPROCESSOR_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <MAgnEntryUi.h> |
|
23 //<cmail> |
|
24 #include "esmrcommands.h" |
|
25 #include "tesmrscenariodata.h" |
|
26 //</cmail> |
|
27 |
|
28 class MESMRCalDbMgr; |
|
29 class CMRMailboxUtils; |
|
30 class CCalInstance; |
|
31 class MESMRMeetingRequestEntry; |
|
32 class CESMRMeetingRequestEntry; |
|
33 class CESMRFsMailboxUtils; |
|
34 |
|
35 /** |
|
36 * CESMREntryProcessor's main responsibility is to |
|
37 * perform entry processing and evaluation in initialization phase. |
|
38 * |
|
39 * @lib esmrentry.lib |
|
40 */ |
|
41 NONSHARABLE_CLASS(CESMREntryProcessor) : |
|
42 public CBase |
|
43 { |
|
44 public: // Construction and destruction |
|
45 /** |
|
46 * Creates new CESMREntryProcessor object. Ownership |
|
47 * is transferred to caller. |
|
48 * @param aMRMailboxUtils Refernce to MR Mailbox Utilities API. |
|
49 * @param aDbMgr Reference to calendar DB manager. |
|
50 * @return Pointer to created CESMREntryProcessor object, |
|
51 */ |
|
52 IMPORT_C static CESMREntryProcessor* NewL( |
|
53 CMRMailboxUtils& aMRMailboxUtils, |
|
54 MESMRCalDbMgr& aDbMgr ); |
|
55 |
|
56 /** |
|
57 * C++ destructor |
|
58 */ |
|
59 IMPORT_C ~CESMREntryProcessor(); |
|
60 |
|
61 public: // Interface |
|
62 /** |
|
63 * Fetches scenario data. |
|
64 * |
|
65 * @return scenario data. |
|
66 */ |
|
67 inline const TESMRScenarioData& ScenarioData() const; |
|
68 |
|
69 /** |
|
70 * Tests, whether processor contains entry, which it has processed |
|
71 * or not. |
|
72 * |
|
73 * @return ETrue, if contains processed entry. |
|
74 */ |
|
75 inline TBool ContainsProcessedEntry() const; |
|
76 |
|
77 /** |
|
78 * Fetches the extension UID for ES MR entry processor. |
|
79 * |
|
80 * @return MRUI processor extension UID. |
|
81 */ |
|
82 IMPORT_C static TUid ExtensionUid(); |
|
83 |
|
84 /** |
|
85 * Process entries and constructs scenario data. |
|
86 * |
|
87 * @param aParam AGN Entry UI input parameters. |
|
88 * @param aEntries Calendar entries to be processed. |
|
89 * Ownership is not transferred. |
|
90 */ |
|
91 IMPORT_C void ProcessL( |
|
92 const MAgnEntryUi::TAgnEntryUiInParams* aParams, |
|
93 RPointerArray<CCalEntry>* aEntries ); |
|
94 |
|
95 /** |
|
96 * Process entries. Scenario data is not constructed. |
|
97 * |
|
98 * @param aEntries Calendar entries to be processed. |
|
99 * Ownership is not transferred. |
|
100 */ |
|
101 IMPORT_C void ProcessL( |
|
102 RPointerArray<CCalEntry>* aEntries ); |
|
103 |
|
104 /** |
|
105 * Processes calendar instance. All operations affects only the |
|
106 * processed instance. |
|
107 * |
|
108 * @param aInstance Reference to calendar instance. |
|
109 */ |
|
110 IMPORT_C void ProcessL( |
|
111 CCalInstance& aInstance ); |
|
112 |
|
113 /** |
|
114 * Switches processor for forwarding mode. |
|
115 * @error KErrNotReady no entries has been processed yet. |
|
116 */ |
|
117 IMPORT_C void SwitchToForwardL(); |
|
118 |
|
119 /** |
|
120 * Switches processor to edit mode. |
|
121 * @error KErrNotReady no entries has been processed yet. |
|
122 */ |
|
123 IMPORT_C void SwitchToEditL(); |
|
124 |
|
125 /** |
|
126 * Switches processor to view mode. |
|
127 * @error KErrNotReady no entries has been processed yet. |
|
128 */ |
|
129 IMPORT_C void SwitchToViewL(); |
|
130 |
|
131 /** |
|
132 * Switches processor to Tracking mode. |
|
133 * @error KErrNotReady no entries has been processed yet. |
|
134 */ |
|
135 IMPORT_C void SwitchToTrackL(); |
|
136 |
|
137 /** |
|
138 * Fetches ES MR Entry. Methods panics, if entries has not |
|
139 * been processed before calling this method. |
|
140 * |
|
141 * @return Reference to CESMRMeetingRequestEntry object. |
|
142 */ |
|
143 IMPORT_C MESMRMeetingRequestEntry& ESMREntryL(); |
|
144 |
|
145 /** |
|
146 * Resets the entry processor. After calling this method the |
|
147 * processor is in the same state than after creation. |
|
148 */ |
|
149 IMPORT_C void ResetL(); |
|
150 |
|
151 /** |
|
152 * Process output parameters. Processing is done according to command |
|
153 * passed as parameter. |
|
154 * |
|
155 * @param aOutputParams Reference to output parameters. |
|
156 * @param aCommand Command for which output parameters are processed. |
|
157 */ |
|
158 IMPORT_C void ProcessOutputParametersL( |
|
159 MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, |
|
160 TESMRCommand aCommand ); |
|
161 |
|
162 private: // Implementaton |
|
163 |
|
164 CESMREntryProcessor( |
|
165 CMRMailboxUtils& aMRMailboxUtils, |
|
166 MESMRCalDbMgr& aDbMgr ); |
|
167 void ConstructL(); |
|
168 void SetPhoneOwnerL(); |
|
169 void CheckViewModeL(); |
|
170 TBool IsDataOk() const; |
|
171 void CreateESMREntryL(); |
|
172 void CheckOrganizerL(); |
|
173 void SetPhoneOwnerToOwnEntryL(); |
|
174 |
|
175 private: // Data |
|
176 /** |
|
177 * Scenario data |
|
178 * Own. |
|
179 */ |
|
180 TESMRScenarioData iScenData; |
|
181 |
|
182 /** |
|
183 * ES MR Entry |
|
184 * Own. |
|
185 */ |
|
186 CESMRMeetingRequestEntry* iESMREntry; |
|
187 |
|
188 /** |
|
189 * Reference to MR Mailbox Utilities API |
|
190 * Not own. |
|
191 */ |
|
192 CMRMailboxUtils& iMRMailboxUtils; |
|
193 |
|
194 /** |
|
195 * Reference to calendar DB manager |
|
196 * Not own. |
|
197 */ |
|
198 MESMRCalDbMgr& iDbMgr; |
|
199 |
|
200 /** |
|
201 * Entries to be processed |
|
202 * Not own. |
|
203 */ |
|
204 RPointerArray<CCalEntry>* iMREntries; |
|
205 |
|
206 /** |
|
207 * Input parameters from calling application |
|
208 * Not own. |
|
209 */ |
|
210 const MAgnEntryUi::TAgnEntryUiInParams* iParams; |
|
211 |
|
212 /** |
|
213 * Own: Mailbox utils class. |
|
214 */ |
|
215 CESMRFsMailboxUtils* iMbUtils; |
|
216 }; |
|
217 |
|
218 #include "cesmrentryprocessor.inl" |
|
219 |
|
220 #endif // CESMRENTRYPROCESSOR_H |