1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
16 */ |
16 */ |
17 |
17 |
18 #ifndef CESMREDITORDIALOG_H |
18 #ifndef CESMREDITORDIALOG_H |
19 #define CESMREDITORDIALOG_H |
19 #define CESMREDITORDIALOG_H |
20 |
20 |
21 #include <AknDialog.h> |
21 #include <akndialog.h> |
|
22 #include <akntoolbarobserver.h> |
|
23 #include <aknserverapp.h> |
22 #include "mesmruibase.h" |
24 #include "mesmruibase.h" |
23 #include "mesmrresponseobserver.h" |
25 #include "mesmrresponseobserver.h" |
24 #include "mesmrfieldeventobserver.h" |
26 #include "mesmrfieldeventobserver.h" |
|
27 #include "cesmrfieldbuilderinterface.h" |
25 |
28 |
26 class CESMRPolicy; |
29 class CESMRPolicy; |
27 class MESMRCalEntry; |
30 class MESMRCalEntry; |
28 class CESMRView; |
31 class CESMRView; |
29 class MAgnEntryUiCallback; |
32 class MAgnEntryUiCallback; |
30 class CESMRSendUI; |
33 class CESMRSendUI; |
31 class CAiwServiceHandler; |
|
32 class CESMRField; |
34 class CESMRField; |
33 class CESMRTitlePaneHandler; |
35 class CESMRTitlePaneHandler; |
34 class CCalenInterimUtils2; |
36 class CCalenInterimUtils2; |
35 class CESMRLocationPluginHandler; |
37 class CESMRLocationPluginHandler; |
36 class CESMRAddressInfoHandler; |
38 class CESMRAddressInfoHandler; |
37 class CESMRFeatureSettings; |
39 class CESMRFeatureSettings; |
|
40 class CMRToolbar; |
|
41 class MMRInfoProvider; |
|
42 class TDataType; |
|
43 class MMRFocusStrategy; |
|
44 class MESMRMeetingRequestEntry; |
38 |
45 |
39 /** |
46 /** |
40 * CESMREditorDialog implements the editor dialog for meeting requests. |
47 * CESMREditorDialog implements the editor dialog for meeting requests. |
41 * |
48 * |
42 * @see mesmruibase.h, mesmruifactory.h |
49 * @see mesmruibase.h, mesmruifactory.h |
56 * @param aEntry ESMR calendar entry (wraps the CCalEntry object) |
64 * @param aEntry ESMR calendar entry (wraps the CCalEntry object) |
57 * @param aCallback Callback interface for AgnEntryUI |
65 * @param aCallback Callback interface for AgnEntryUI |
58 * @return Pointer to created and initialized esmr editor dialog. |
66 * @return Pointer to created and initialized esmr editor dialog. |
59 */ |
67 */ |
60 IMPORT_C static CESMREditorDialog* NewL( |
68 IMPORT_C static CESMREditorDialog* NewL( |
61 CESMRPolicy* aPolicy, |
69 MMRInfoProvider& aInfoProvider, |
62 MESMRCalEntry& aEntry, |
|
63 MAgnEntryUiCallback& aCallback ); |
70 MAgnEntryUiCallback& aCallback ); |
64 |
71 |
65 /* |
72 /* |
66 * Destructor. |
73 * Destructor. |
67 */ |
74 */ |
77 void ProcessCommandL( TInt aCommand ); |
84 void ProcessCommandL( TInt aCommand ); |
78 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
85 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
79 |
86 |
80 public: // From MESMRUIBase |
87 public: // From MESMRUIBase |
81 TInt ExecuteViewLD(); |
88 TInt ExecuteViewLD(); |
82 |
89 |
|
90 public: // From MAknToolbarObserver |
|
91 void DynInitToolbarL ( TInt aResourceId, CAknToolbar* aToolbar ); |
|
92 void OfferToolbarEventL ( TInt aCommand ); |
|
93 |
83 public: // From MESMRResponseObserver |
94 public: // From MESMRResponseObserver |
84 TBool Response( TInt aCommand ); |
95 TBool Response( TInt aCommand ); |
85 void ExitDialog(); |
96 void ExitDialog(); |
86 void ChangeReadyResponseL(); |
97 void ChangeReadyResponseL(); |
87 |
98 |
97 * |
108 * |
98 * @param aEntry ESMR calendar entry (wraps the CCalEntry object) |
109 * @param aEntry ESMR calendar entry (wraps the CCalEntry object) |
99 * @param aCallback Callback interface for AgnEntryUI |
110 * @param aCallback Callback interface for AgnEntryUI |
100 */ |
111 */ |
101 CESMREditorDialog( |
112 CESMREditorDialog( |
102 MESMRCalEntry& aEntry, |
113 MMRInfoProvider& aPolicyProvider, |
103 MAgnEntryUiCallback& aCallback ); |
114 MAgnEntryUiCallback& aCallback ); |
104 |
115 |
105 /** |
116 /** |
106 * Second phase constructor. |
117 * Second phase constructor. |
107 * |
118 * |
108 * @param aPolicy contains all the fields for list component. |
119 * @param aPolicy contains all the fields for list component. |
109 */ |
120 */ |
110 void ConstructL( CESMRPolicy* aPolicy ); |
121 void ConstructL(); |
111 |
122 |
112 /** |
123 /** |
113 * Handles dialog exit, saves entry etc. |
124 * Handles dialog exit, saves entry etc. |
114 * @return TInt |
125 * @return TInt |
115 */ |
126 */ |
133 * @param aMenuPane |
144 * @param aMenuPane |
134 */ |
145 */ |
135 void TryInsertSendMenuL(CEikMenuPane* aMenuPane); |
146 void TryInsertSendMenuL(CEikMenuPane* aMenuPane); |
136 |
147 |
137 /** |
148 /** |
138 * Handles print command. |
|
139 * @param aCommand |
|
140 */ |
|
141 void HandlePrintCommandL(TInt aCommand); |
|
142 |
|
143 /** |
|
144 * Executes user related queries whether the entry should be |
149 * Executes user related queries whether the entry should be |
145 * save or not. |
150 * save or not. |
146 * @return TBool |
151 * @return TBool |
147 */ |
152 */ |
148 TBool IsAllowedToSaveL(); |
153 TBool IsAllowedToSaveL(); |
149 |
154 |
150 /** |
155 /** |
151 * Checks if cfsmailbox actually supports attendee status |
156 * Checks if cfsmailbox supports given capability. |
|
157 * @param aCapa, the capability |
152 * @return TBool |
158 * @return TBool |
153 */ |
159 */ |
154 TBool CESMREditorDialog::SupportsAttendeeStatusL( ); |
160 TBool SupportsMailBoxCapabilityL( |
|
161 MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa ); |
155 |
162 |
156 /** |
163 /** |
157 * Handle options menu command "open" |
164 * Handle options menu command "open" |
158 */ |
165 */ |
159 void HandleOpenCmdL(); |
166 void HandleOpenCmdL(); |
164 * @param aResourceId Menu resource id |
171 * @param aResourceId Menu resource id |
165 * @param aMenuPane menu pane |
172 * @param aMenuPane menu pane |
166 */ |
173 */ |
167 void HandleLocationOptionsL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
174 void HandleLocationOptionsL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
168 |
175 |
169 /** |
176 CESMRLocationPluginHandler& LocationPluginHandlerL(); |
170 * Loads options menu text for given command. |
177 CESMRAddressInfoHandler& AddressInfoHandlerL(); |
|
178 void HandleFieldCommandEventL( const MESMRFieldEvent& aEvent ); |
|
179 void HandleFieldChangeEventL( const MESMRFieldEvent& aEvent ); |
|
180 TBool SetContextMenuL(); |
|
181 void SwitchEntryTypeL( TInt aCommand, TBool aAdjustView ); |
|
182 inline const CESMRPolicy& Policy() const; |
|
183 void SetTitleL(); |
|
184 void VerifyMeetingRequestL(); |
|
185 TBool TryOpenAttachmentL(); |
|
186 TInt TryRemoveAttachmentL(); |
|
187 TInt TryRemoveAllAttachmentsL(); |
|
188 TInt TryAddAttachmentL(); |
|
189 void ShowContextMenuL(); |
|
190 |
|
191 /** |
|
192 * Check mr is past |
171 * |
193 * |
172 * @param aCommandId option menu item command id |
194 * @param aEvent |
173 * @return text |
195 * @return TBool |
174 */ |
196 */ |
175 HBufC* LoadOptionsMenuTextLC( TInt aCommandId ); |
197 TBool OccursInPastL( const MESMRFieldEvent& aEvent ); |
176 |
198 TBool OccursInPast( const TTime& aStartUtc ); |
177 CESMRLocationPluginHandler& LocationPluginHandlerL(); |
199 void ChangeRightSoftkeyL( TBool aOccursInPast, TBool aIsOrganizer ); |
178 |
200 |
179 CESMRAddressInfoHandler& AddressInfoHandlerL(); |
201 TInt TryToSaveEntryL(); |
180 |
|
181 void HandleFieldCommandEventL( const MESMRFieldEvent& aEvent ); |
|
182 |
|
183 void HandleFieldChangeEventL( const MESMRFieldEvent& aEvent ); |
|
184 |
202 |
185 private: |
203 private: |
186 |
204 |
187 /** |
205 /** |
188 * Own: Feature manager initialization flag |
206 * Ref: Info provider for accessing entry and policy |
189 */ |
207 */ |
190 TBool iFeatureManagerInitialized; |
208 MMRInfoProvider& iInfoProvider; |
191 |
|
192 /** |
|
193 * Ref: Policy for building fields and menus |
|
194 */ |
|
195 CESMRPolicy* iPolicy; |
|
196 |
209 |
197 /** |
210 /** |
198 * Ref: The only control in this dialog. Fwk deletes. |
211 * Ref: The only control in this dialog. Fwk deletes. |
199 */ |
212 */ |
200 CESMRView* iView; |
213 CESMRView* iView; |
201 |
214 |
202 /** |
215 /** |
203 * Ref: Reference to MESRCalEntry (CCalEntry wrapper) |
|
204 */ |
|
205 MESMRCalEntry& iEntry; |
|
206 |
|
207 /** |
|
208 * Ref: Agn Entry UI callback interface |
216 * Ref: Agn Entry UI callback interface |
209 */ |
217 */ |
210 MAgnEntryUiCallback& iCallback; |
218 MAgnEntryUiCallback& iCallback; |
211 |
219 |
212 /** |
220 /** |
213 * Own: Calendar Global data |
221 * Own: Calendar Global data |
214 */ |
222 */ |
215 CESMRSendUI* iESMRSendUI; |
223 CESMRSendUI* iESMRSendUI; |
216 |
|
217 /** |
|
218 * Own: AIW Service handler |
|
219 */ |
|
220 CAiwServiceHandler* iServiceHandler; |
|
221 |
224 |
222 /** |
225 /** |
223 * Own: Boolean indicating if required attendees field contains items. |
226 * Own: Boolean indicating if required attendees field contains items. |
224 */ |
227 */ |
225 TBool iRequiredAttendeesEnabled; |
228 TBool iRequiredAttendeesEnabled; |
255 * Own. |
258 * Own. |
256 */ |
259 */ |
257 CESMRFeatureSettings* iFeatures; |
260 CESMRFeatureSettings* iFeatures; |
258 |
261 |
259 /** |
262 /** |
260 * Indicates if meeting request occurs in past. |
|
261 */ |
|
262 TBool iOccursInPast; |
|
263 |
|
264 /** |
|
265 * Indicates if location has been modified. |
263 * Indicates if location has been modified. |
266 */ |
264 */ |
267 TBool iLocationModified; |
265 TBool iLocationModified; |
|
266 // TODO: Take this into use when implementing the toolbar |
|
267 /// Own: Toolbar handler |
|
268 CMRToolbar* iToolbar; |
|
269 |
|
270 /// Own: Context menu resource id |
|
271 TInt iContextMenuResourceId; |
|
272 /// Own: Focus strategy of the editor |
|
273 MMRFocusStrategy* iFocusStrategy; |
|
274 |
|
275 // record time after time field updated |
|
276 TTime iStartTimeUtc; |
268 }; |
277 }; |
269 |
278 |
270 #endif // CESMREDITORDIALOG_H |
279 #endif // CESMREDITORDIALOG_H |