9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: This class is the base class of all Calendar views. |
14 * Description: This class is the base class of all Calendar views. |
15 * |
15 * |
16 */ |
16 */ |
17 |
|
18 |
17 |
19 |
18 |
20 #ifndef CALENNATIVEVIEW_H |
19 #ifndef CALENNATIVEVIEW_H |
21 #define CALENNATIVEVIEW_H |
20 #define CALENNATIVEVIEW_H |
22 |
21 |
23 // INCLUDES |
22 #ifdef CALENVIEWS_DLL |
24 |
23 #define CALENNATIVEVIEW_EXPORT Q_DECL_EXPORT |
25 #include <calentry.h> |
24 #else |
26 //#include <aknview.h> |
25 #define CALENNATIVEVIEW_EXPORT Q_DECL_IMPORT |
27 #include <calenview.h> |
|
28 #include "CalendarVariant.hrh" |
|
29 #include "calensetting.h" |
|
30 |
|
31 #ifdef RD_CALEN_EXTERNAL_CAL |
|
32 #include <aiwcommon.h> |
|
33 #endif |
26 #endif |
34 |
27 |
35 #include <calennotificationhandler.h> |
28 // System includes |
|
29 #include <hblabel.h> |
|
30 #include <hblistwidget.h> |
|
31 #include <hbabstractviewitem.h> |
36 |
32 |
37 // FORWARD DECLARATIONS |
33 // User includes |
38 class CCalenContainer; |
34 #include "calennotificationhandler.h" // MCalenNotificationHandler |
39 class CCalInstance; |
35 #include "calenview.h" |
40 class CCalEntry; |
|
41 class MCalenModelChangeHandler; |
|
42 class CAknNavigationControlContainer; |
|
43 class CAknNavigationDecorator; |
|
44 class CAknWaitDialog; |
|
45 |
36 |
46 class CAknToolbar; |
37 const int WORKAROUND_TO_LIMIT_MAX_SPEED=8000; |
47 |
38 |
48 class CCnvCharacterSetConverter; |
|
49 class MCalenServices; |
39 class MCalenServices; |
50 class CCalenStatusPaneUtils; |
40 class HbDateTimePicker; |
51 |
41 |
52 #ifdef RD_CALEN_EXTERNAL_CAL |
42 class CalenNativeView : public CalenView, |
53 class CAiwServiceHandler; |
43 public MCalenNotificationHandler |
54 #endif |
44 { |
|
45 Q_OBJECT |
|
46 |
|
47 public: // Constructors and destructor |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CalenNativeView(); |
|
52 virtual void populationComplete(); |
|
53 TBool pluginEnabled(); |
|
54 virtual void refreshViewOnGoToDate(); |
|
55 QString *pluginText(); |
|
56 /** |
|
57 * captureScreenshot captures the current screenshot |
|
58 */ |
|
59 CALENNATIVEVIEW_EXPORT void captureScreenshot(bool captureScreenShot = false); |
|
60 |
|
61 protected: // New functions |
|
62 CalenNativeView( MCalenServices& services ); |
|
63 |
|
64 void HandleNotification( const TCalenNotification notification ); |
|
65 virtual void onLocaleChanged(int reason)=0; |
|
66 virtual void onContextChanged() {}; |
55 |
67 |
56 // CLASS DEFINITIONS |
68 protected slots: |
57 |
69 |
58 /** |
70 void goToDate(); |
59 * CCalenNativeView |
71 void goToSelectedDate(); |
60 * This class is the base class of all Calendar views. |
72 void deleteBeforeDate(); |
61 */ |
73 void deleteAllEntries(); |
62 NONSHARABLE_CLASS( CCalenNativeView ) : public CCalenView, |
74 void launchSettingsView(); |
63 public MCalenNotificationHandler |
75 virtual void changeOrientation(Qt::Orientation orientation); |
64 #ifdef RD_CALEN_EXTERNAL_CAL |
76 /** |
65 ,public MAiwNotifyCallback |
77 * saveActivity saves the current view as an activity |
66 #endif //RD_CALEN_EXTERNAL_CAL |
78 * |
67 |
79 */ |
68 { |
80 void saveActivity(); |
69 public: // Constructors and destructor |
81 |
70 /** |
82 protected: |
71 * Destructor. |
|
72 */ |
|
73 virtual ~CCalenNativeView(); |
|
74 |
|
75 public: // New functions |
|
76 |
83 |
77 /** |
84 MCalenServices &mServices; // not owned. |
78 * This function is called when Locale or Today was chenged. |
85 int mActivityId; // Recent Activity ID, currently it holdes wither of ECalenMonthView or ECalenAgendaView |
79 * @param aReason Notify reason EChangesLocale | |
86 QVariantHash mScreenShotMetadata; // Screenshot |
80 * EChangesMidnightCrossover |
87 bool mEntriesInDataBase; |
81 */ |
88 private: |
82 virtual void OnLocaleChangedL(TInt aReason)=0; |
89 HbDateTimePicker *mDatePicker; |
83 |
90 bool mIsCapturedScreenShotValid; // to check if the captured screenshot is valid |
84 /** |
91 }; |
85 * This function is called when Editor/Viewer is closed |
|
86 */ |
|
87 virtual void OnEditorClosedL(); |
|
88 |
|
89 /** |
|
90 * Set date to Status pane. Default implementation does nothing. |
|
91 * @param aTime it will be refrect to StatusPane |
|
92 */ |
|
93 virtual void SetStatusPaneFromActiveContextL(); |
|
94 |
|
95 /** |
|
96 * Return container control pointer. |
|
97 * @return Container control pointer |
|
98 */ |
|
99 CCalenContainer* Container(); |
|
100 |
|
101 /** |
|
102 * Change NoteView. |
|
103 */ |
|
104 //void OnCmdChangeNoteViewL(); |
|
105 |
|
106 /** |
|
107 * Handling command "Go to day" |
|
108 */ |
|
109 void OnCmdGotoDateL(); |
|
110 /** |
|
111 * Handling command "Today". # key is pressed. |
|
112 */ |
|
113 void OnCmdGotoTodayL(); |
|
114 |
|
115 /** |
|
116 * Starts repopulation again. |
|
117 */ |
|
118 void BeginRepopulationL(); |
|
119 |
|
120 /** |
|
121 * Process "Send As" |
|
122 * @param aCommand command to be handled |
|
123 */ |
|
124 void DoSendAsL(TInt aCommand); |
|
125 |
|
126 /** |
|
127 * Redraw status pane when Form is closed |
|
128 */ |
|
129 virtual void RedrawStatusPaneL() = 0; |
|
130 |
|
131 /** |
|
132 * Notified that the focus of Container changes. |
|
133 */ |
|
134 void NotifyFocusChanged(); |
|
135 |
|
136 /** |
|
137 * Is container focused? |
|
138 * @return If value is ETrue, container has focus |
|
139 */ |
|
140 TBool IsContainerFocused(); |
|
141 |
|
142 void ShowValidScrollButtons(CAknNavigationDecorator& iNaviLabel, |
|
143 const TTime& aRangeStart, |
|
144 const TTime& aRangeEnd); |
|
145 |
|
146 |
|
147 /** |
|
148 * Set CBA from resources. |
|
149 * @param aCbaResourceId is id of CBA resource |
|
150 */ |
|
151 void SetCbaL(TInt aCbaResourceId); |
|
152 |
|
153 //void EditEntryL( CCalEntry *aEntry, const TTime& aInstanceDate ); |
|
154 |
|
155 /** |
|
156 * Returns an array of abbreviated day names (MO, TU etc.) |
|
157 */ |
|
158 const CDesCArrayFlat& AbbreviatedDayArrayL(); |
|
159 |
|
160 /** |
|
161 * Returns ETrue whenever editor is active or whenever fake exit is active |
|
162 * Used to hide the preview popup |
|
163 */ |
|
164 TBool IsEditorActiveOrFasterAppExit(); |
|
165 |
|
166 /** |
|
167 * Set fasterappflag whenever fake exit is done |
|
168 */ |
|
169 void SetFasterAppActive( TBool aFasterAppActive ); |
|
170 |
|
171 /** |
|
172 * Set editor active flag |
|
173 */ |
|
174 void SetEditorActive(TBool aEditorActive); |
|
175 |
|
176 /** |
|
177 * @brief Checks if any command is being handled |
|
178 * |
|
179 * @return ETrue if some command is being handled, EFalse otherwise |
|
180 */ |
|
181 TBool IsCommandHandlingInProgress(); |
|
182 |
|
183 /** |
|
184 * @brief Checks whether eventview is launched from alarm |
|
185 * |
|
186 * @return ETrue if launched from alarm popup, EFalse otherwise |
|
187 */ |
|
188 TBool IsEventViewLaunchedFromAlarm(); |
|
189 |
|
190 /** |
|
191 * @brief Marks that a command is being processed currently |
|
192 * |
|
193 * @param aInProgress ETrue if the command is being handled, EFalse otherwise |
|
194 */ |
|
195 void SetCommandHandlingInProgress( TBool aInProgress ); |
|
196 |
|
197 /** |
|
198 * @brief Checks if any command is being handled |
|
199 * |
|
200 * @param aServices Reference to the calendar services. |
|
201 * @param aCollectionIds Out parameter. |
|
202 */ |
|
203 static void GetActiveCollectionidsL( |
|
204 MCalenServices& aServices, |
|
205 RArray< TInt >& aCollectionIds ); |
|
206 /** |
|
207 * @brief Sets flag to ignore tap on any of the views |
|
208 * |
|
209 * @param bool value to ignore the tap |
|
210 */ |
|
211 void SetTapIgnore(TBool); |
|
212 #ifdef RD_CALEN_EXTERNAL_CAL |
|
213 |
|
214 /** |
|
215 * Returns Service Handler if available |
|
216 */ |
|
217 CAiwServiceHandler* ServiceHandler(); |
|
218 |
|
219 /** |
|
220 * Releases service handler and unloads loaded plugins |
|
221 */ |
|
222 void ReleaseServiceHandler(); |
|
223 |
|
224 /** |
|
225 * Create service handler if needed. |
|
226 * it will also attach to menu services if needed |
|
227 */ |
|
228 void CreateServiceHandlerL(TBool aAttachMenu); |
|
229 |
|
230 /* |
|
231 * Handles notifications caused by an asynchronous Execute*CmdL call |
|
232 * or an event. |
|
233 * |
|
234 * @param aCmdId The service command associated to the event. |
|
235 * @param aEventId Occured event, see AiwCommon.hrh. |
|
236 * @param aEventParamList Event parameters, if any, as defined per |
|
237 * each event. |
|
238 * @param aInParamList Input parameters, if any, given in the |
|
239 * related HandleCommmandL. |
|
240 * @return Error code for the callback. |
|
241 */ |
|
242 TInt HandleNotifyL(TInt aCmdId,TInt aEventId,CAiwGenericParamList& aEventParamList,const CAiwGenericParamList& aInParamList); |
|
243 |
|
244 |
|
245 /** |
|
246 * Returns ETrue if wait note for multiple entry delete is currently shown. |
|
247 */ |
|
248 TBool ExtCalendarAvailableL(); |
|
249 |
|
250 #endif //RD_CALEN_EXTERNAL_CAL |
|
251 |
|
252 |
|
253 public: // From CCalenView |
|
254 void RemoveViewsFromCycle( RArray<TInt>& aViews ); |
|
255 void GetHelpContext( TCoeHelpContext& aHelpContext ); |
|
256 TAny* CalenViewExtensionL( TUid aExtensionUid ); |
|
257 |
|
258 public: // From MCalenDBChangeObserver |
|
259 void HandleDBChangeL(); |
|
260 |
|
261 public: // From MCalenNotificationHandler |
|
262 void HandleNotification( const TCalenNotification aNotification ); |
|
263 |
|
264 public: // from MEikMenuObserver |
|
265 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
266 /** |
|
267 * From CAknView. Command handling for each view |
|
268 * @param aCommand command id |
|
269 */ |
|
270 void HandleCommandL(TInt aCommand); |
|
271 |
|
272 /** |
|
273 * @brief From MEikMenuObserver. Dynamically initializes the menubar. |
|
274 * @see MEikMenuObserver. |
|
275 */ |
|
276 void DynInitMenuBarL( TInt aResourceId, CEikMenuBar* aMenuBar ); |
|
277 |
|
278 /** |
|
279 * @brief copies the calendar entry to respective calendar. |
|
280 */ |
|
281 void CopyToCalendarsL(); |
|
282 |
|
283 |
|
284 protected: // New functions |
|
285 /** |
|
286 * C++ constructor. |
|
287 */ |
|
288 CCalenNativeView( MCalenServices& aServices ); |
|
289 |
|
290 /** |
|
291 * 2nd phase construction common to all Calendar views. |
|
292 */ |
|
293 void CommonConstructL( TInt aViewResource ); |
|
294 |
|
295 /** |
|
296 * Second phase DoActivateL |
|
297 */ |
|
298 virtual void DoActivateImplL( const TVwsViewId& aPrevViewId, |
|
299 TUid aCustomMessageId, |
|
300 const TDesC8& aCustomMessage) = 0; |
|
301 /** |
|
302 * Second phase DoDeactivate |
|
303 */ |
|
304 virtual void DoDeactivateImpl() = 0; |
|
305 |
|
306 /** |
|
307 * Creates container control for each views |
|
308 */ |
|
309 virtual CCalenContainer* CreateContainerImplL() = 0; |
|
310 |
|
311 /** |
|
312 * Notify marked entryy deleted. |
|
313 * Used to notify the todo view |
|
314 */ |
|
315 virtual void NotifyMarkedEntryDeletedL(){ }; |
|
316 |
|
317 /** |
|
318 * Notify marked entryy deleted. |
|
319 * Used to notify the todo view |
|
320 */ |
|
321 virtual void NotifyMarkedEntryCompletedL(){ }; |
|
322 |
|
323 /* |
|
324 * Clears view specific data |
|
325 */ |
|
326 virtual void ClearViewSpecificDataL()=0; |
|
327 |
|
328 /** |
|
329 * Update date form context when entry is saved |
|
330 */ |
|
331 virtual void UpdateDateFromContextL(){ }; |
|
332 |
|
333 /** |
|
334 * Updates preview pane whenever application comes to foreground |
|
335 */ |
|
336 virtual void UpdatePreviewPaneL(){ }; |
|
337 |
|
338 /** |
|
339 * Hides the preview pane whenever application goes to background |
|
340 * or whenever fake exit is done |
|
341 */ |
|
342 virtual void HidePreviewPane(){ }; |
|
343 |
|
344 private: // New Functions |
|
345 |
|
346 /** |
|
347 * A container control is created. |
|
348 */ |
|
349 void CreateContainerL(); |
|
350 |
|
351 /** |
|
352 * Prcess "Send As" |
|
353 * @param aCommand command to be handled |
|
354 */ |
|
355 void DoSendAsImplL(TInt aCommand); |
|
356 |
|
357 private: // From CAknView |
|
358 /** |
|
359 * From CAknView View activation handler |
|
360 */ |
|
361 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
362 TUid aCustomMessageId, |
|
363 const TDesC8& aCustomMessage); |
|
364 /** |
|
365 * From CAknView View deactivation handler |
|
366 */ |
|
367 void DoDeactivate(); |
|
368 |
|
369 /** |
|
370 * @brief asynchronous call back for copy to calendar functionality. |
|
371 * added because of err VGGG-82X8TV . |
|
372 * |
|
373 */ |
|
374 static TInt AsyncCopyToCalendarsL(TAny* aThisPtr); |
|
375 |
|
376 /** |
|
377 * @brief called from AsyncCopyToCalendarsL |
|
378 */ |
|
379 void CopyEntryToCalendarsL(); |
|
380 |
|
381 protected: // Data |
|
382 CCalenContainer* iContainer; |
|
383 MCalenModelChangeHandler* iHandler; |
|
384 CAknNavigationControlContainer* iNaviContainer; // cache |
|
385 TInt iLocChangeReason; |
|
386 MCalenServices& iServices; // not owned. |
|
387 TBool iNeedsRefresh; |
|
388 |
|
389 CAknToolbar *iToolbar; // not owned |
|
390 |
|
391 HBufC* iMenuName; // localised name of view for change view menu. Owned. |
|
392 HBufC* iSettingsName; // localised name of view for default view setting. Owned. |
|
393 |
|
394 CCalenStatusPaneUtils* iSPUtils; // owned, status pane utils |
|
395 |
|
396 #ifdef RD_CALEN_EXTERNAL_CAL |
|
397 |
|
398 private: |
|
399 CAiwServiceHandler* iServiceHandler; // own |
|
400 #endif //RD_CALEN_EXTERNAL_CAL |
|
401 |
|
402 private: // Data |
|
403 CDesCArrayFlat* iAbbreviatedDayArray; |
|
404 TBool iFasterAppActive; |
|
405 TBool iIsEditorActive; |
|
406 TBool iIsBackgrounded; |
|
407 |
|
408 /** |
|
409 * @var iCommandProcessing |
|
410 * @brief ETrue if some command handling is under progress, EFalse otherwise |
|
411 */ |
|
412 TBool iCommandProcessing; |
|
413 TBool iIgnoreTap; |
|
414 CAsyncCallBack* iAsyncCallback; |
|
415 }; |
|
416 |
92 |
417 #endif // CALENNATIVEVIEW_H |
93 #endif // CALENNATIVEVIEW_H |
418 |
94 |
419 |
95 // End of file |
420 // End of File |
|