14 * Description: Calendar controller |
14 * Description: Calendar controller |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <aknnotewrappers.h> // CAknInformationNote |
19 #include <e32std.h> |
20 #include <aknViewAppUi.h> // CAknViewAppUi |
20 #include <hbmainwindow.h> |
21 #include <StringLoader.h> // Loads strings from resource |
21 #include <hbwidget.h> |
22 #include <aknappui.h> |
22 #include <hbinstance.h> |
23 #include <bautils.h> |
23 #include <hbapplication.h> //Activity Manager |
24 #include <data_caging_path_literals.hrh> |
24 #include <xqserviceutil.h> // service utils |
25 #include <pathinfo.h> |
25 |
26 #include <avkon.hrh> |
26 // User includes |
27 #include "calenviewinfo.h" // View information |
27 #include "calencontroller.h" // CCalenController |
28 #include <Calendar.rsg> // Calendar resourcess |
28 #include "calenviewmanager.h" // Responsible for all view activations |
29 #include <missedalarmstore.h> // missed alarm store |
29 #include "calenservicesimpl.h" // MCalenServices implementation |
30 #include <calsession.h> |
30 #include "calenactionui.h" // Default command handling |
31 #include <calencommandhandler.h> |
31 #include "calencustomisationmanager.h" // Customisation Manager |
32 #include <calencontext.h> |
32 #include "calennotificationhandler.h" |
33 #include <calenconstants.h> // KCalenLostAlarms etc |
33 #include "calennotifier.h" |
34 #include <calcalendarinfo.h> |
34 #include "hb_calencommands.hrh" |
35 |
|
36 #include "calendarui_debug.h" // Debug macros |
35 #include "calendarui_debug.h" // Debug macros |
37 #include "calencontroller.h" // CCalenController |
|
38 #include "calenactionui.h" // Default command handling |
|
39 #include "calennotifier.h" // Broadcasts system events |
|
40 #include "calenviewmanager.h" // Responsible for all view activations |
|
41 #include "calenalarmmanager.h" // Alarm Manager |
|
42 #include "calenservicesimpl.h" // MCalenServices implementation |
|
43 #include "calensetting.h" |
|
44 #include "calencmdlinelauncher.h" // Command line launcher |
|
45 #include "calencustomisationmanager.h" // Customisation Manager |
|
46 #include "calenstatemachine.h" |
36 #include "calenstatemachine.h" |
47 #include "calenicons.h" |
37 #include "calenservicesimpl.h" // Calendar service implementation |
48 #include "calentoolbarimpl.h" |
38 #include "CalenUid.h" |
49 #include "calenmultipledbmanager.h" |
39 #include "calencontextimpl.h" |
50 #include "calenattachmentmodel.h" |
40 #include "OstTraceDefinitions.h" |
51 |
41 #ifdef OST_TRACE_COMPILER_IN_USE |
|
42 #include "calencontrollerTraces.h" |
|
43 #endif |
|
44 |
|
45 |
|
46 // Constants |
52 const TInt KCustomCommandRangeStart = ECalenLastCommand; |
47 const TInt KCustomCommandRangeStart = ECalenLastCommand; |
53 const TInt KNumberOfCommandsPerServices = 100; |
48 const TInt KNumberOfCommandsPerServices = 100; |
54 _LIT( KResourceFile, "calencommonui.rsc" ); |
49 |
55 |
50 // ---------------------------------------------------------------------------- |
56 // ---------------------------------------------------------------------------- |
51 // CCalenController::CCalenController |
57 // CCalenController::NewL |
52 // Constructor |
58 // First stage construction. This will leave if an instance of the controller |
53 // (other items were commented in a header). |
59 // already exists. All access to an instance of the controller should be |
54 // ---------------------------------------------------------------------------- |
60 // through the InstanceL function, except for the initial construction |
55 // |
61 // which should be handled by the appui. |
56 CCalenController::CCalenController() |
62 // This is to prevent usage of this API through the services dll when Calendar |
57 { |
63 // application is not running. |
58 OstTraceFunctionEntry0( CCALENCONTROLLER_CCALENCONTROLLER_ENTRY ); |
64 // (other items were commented in a header). |
59 |
65 // ---------------------------------------------------------------------------- |
60 // Check the Application Startup reason, set iIsFromServiceFrmWrk if application |
66 // |
61 // is started by service framework, false otherwise |
67 EXPORT_C CCalenController* CCalenController::NewL( CAknViewAppUi& aAppUi ) |
62 /*Hb::ActivationReasonService == qobject_cast<HbApplication*>(qApp)->activateReason() ? |
68 { |
63 iIsFromServiceFrmWrk = true: |
69 TRACE_ENTRY_POINT; |
64 iIsFromServiceFrmWrk = false; */ |
70 |
65 |
71 CCalenController* self = NULL; |
66 // Check if calendar is launched thru XQService framework |
72 TAny* tlsPtr = Dll::Tls(); |
67 iIsFromServiceFrmWrk = XQServiceUtil::isService(); // Since activateReason |
73 |
68 //of hbapplication is not returning right value if the activity is started |
74 // Check Thread local storage |
69 //as services so using the above line temporarily untill a fix is available in |
75 if( !tlsPtr ) |
70 // hbappliacation. Need to remove this line after the fix is available for hbapplcation |
76 { |
71 |
77 // TLS is NULL, so no CCalenController has been created yet. |
72 iNextServicesCommandBase = KCustomCommandRangeStart; |
78 self = new( ELeave ) CCalenController( aAppUi ); |
73 iRefCount = 0; |
79 CleanupStack::PushL( self ); |
74 mAgendaUtil = 0; |
80 // Store a self pointer in TLS |
75 |
81 User::LeaveIfError( Dll::SetTls( static_cast<TAny*>( self ) ) ); |
76 OstTraceFunctionExit0( CCALENCONTROLLER_CCALENCONTROLLER_EXIT ); |
82 // Increment ref count right away. If we don't do it here, and someone |
77 } |
83 // calls Controller::InstanceL in ConstructL and then ConstructL |
78 |
84 // leaves, we will double delete the controller. |
79 // ---------------------------------------------------------------------------- |
85 ++self->iRefCount; |
80 // CCalenController::constuctController |
86 self->ConstructL(); |
81 // Construct the controller completely |
87 CleanupStack::Pop( self ); |
82 // (other items were commented in a header). |
88 } |
83 // ---------------------------------------------------------------------------- |
89 else |
84 // |
90 { |
85 void CCalenController::constructController() |
91 // An instance of the controller exists already. |
86 { |
92 // This function should only have been called once, by CCalenAppUi |
87 OstTraceFunctionEntry0( CCALENCONTROLLER_CONSTRUCTCONTROLLER_ENTRY ); |
93 User::Leave( KErrAlreadyExists ); |
88 // Store the pointer in tls, also avoid multiple creations |
94 } |
89 checkMultipleCreation(); |
95 |
90 |
96 TRACE_EXIT_POINT; |
91 // Get an instance of AgendaUtil interface class |
97 return self; |
92 // This will take care of |
98 } |
93 mAgendaUtil = new AgendaUtil(); |
|
94 |
|
95 iStateMachine = CCalenStateMachine::NewL( *this ); |
|
96 |
|
97 // Create the notifier. |
|
98 iNotifier = new( ELeave )CalenNotifier( *iStateMachine ); |
|
99 |
|
100 // Construct the context |
|
101 mContext = new CalenContextImpl(iNotifier); |
|
102 |
|
103 // Set the default context.Once will start use of calencmdlinelauncher, |
|
104 // Then need to remove this function |
|
105 SetDefaultContext(); |
|
106 |
|
107 RArray<TCalenNotification> notificationArray; |
|
108 // Complete construction of the notifier and register the |
|
109 // global data for notifications |
|
110 iNotifier->ConstructL(); |
|
111 |
|
112 // Create the services |
|
113 iServices = CalenServicesImpl::NewL(); |
|
114 // Create the customisation manager, and register for |
|
115 // notifications |
|
116 iCustomisationManager = CCalenCustomisationManager::NewL( *this, |
|
117 *iServices ); |
|
118 // Create the view manager, and register for notifications |
|
119 iViewManager = new CalenViewManager(*this); |
|
120 |
|
121 iViewManager->SecondPhaseConstruction(); |
|
122 |
|
123 hbInstance->allMainWindows().first()->show(); |
|
124 |
|
125 // Create the action uis. |
|
126 iActionUi = CCalenActionUi::NewL( *this ); |
|
127 |
|
128 notificationArray.Append(ECalenNotifySettingsChanged); |
|
129 notificationArray.Append(ECalenNotifyCheckPluginUnloading); |
|
130 notificationArray.Append(ECalenNotifyEComRegistryChanged); |
|
131 notificationArray.Append(ECalenNotifySystemLanguageChanged); |
|
132 |
|
133 RegisterForNotificationsL( iCustomisationManager,notificationArray); |
|
134 notificationArray.Reset(); |
|
135 |
|
136 notificationArray.Append(ECalenNotifyViewPopulationComplete); |
|
137 notificationArray.Append(ECalenNotifyExternalDatabaseChanged); |
|
138 notificationArray.Append(ECalenNotifyMultipleEntriesDeleted); |
|
139 notificationArray.Append(ECalenNotifyDialogClosed); |
|
140 notificationArray.Append(ECalenNotifyEntrySaved); |
|
141 notificationArray.Append(ECalenNotifyEntryDeleted); |
|
142 notificationArray.Append(ECalenNotifyInstanceDeleted); |
|
143 notificationArray.Append(ECalenNotifySystemLocaleChanged); |
|
144 notificationArray.Append(ECalenNotifySystemLanguageChanged); |
|
145 notificationArray.Append(ECalenNotifySystemTimeChanged); |
|
146 notificationArray.Append(ECalenNotifyEntryClosed); |
|
147 notificationArray.Append(ECalenNotifySettingsClosed); |
|
148 |
|
149 RegisterForNotificationsL( iViewManager, notificationArray ); |
|
150 notificationArray.Reset(); |
|
151 notificationArray.Close(); |
|
152 |
|
153 OstTraceFunctionExit0( CCALENCONTROLLER_CONSTRUCTCONTROLLER_EXIT ); |
|
154 } |
|
155 |
|
156 void CCalenController::checkMultipleCreation() |
|
157 { |
|
158 OstTraceFunctionEntry0( CCALENCONTROLLER_CHECKMULTIPLECREATION_ENTRY ); |
|
159 TAny* tlsPtr = Dll::Tls(); |
|
160 |
|
161 // Check Thread local storage |
|
162 if( !tlsPtr ) |
|
163 { |
|
164 // Store a self pointer in TLS |
|
165 User::LeaveIfError( Dll::SetTls( static_cast<TAny*>( this ) ) ); |
|
166 // Increment ref count right away. If we don't do it here, and someone |
|
167 // calls Controller::InstanceL in ConstructL and then ConstructL |
|
168 // leaves, we will double delete the controller. |
|
169 ++this->iRefCount; |
|
170 } |
|
171 else |
|
172 { |
|
173 // An instance of the controller exists already. |
|
174 // This function should only have been called once, by CCalenAppUi |
|
175 User::Leave( KErrAlreadyExists ); |
|
176 } |
|
177 OstTraceFunctionExit0( CCALENCONTROLLER_CHECKMULTIPLECREATION_EXIT ); |
|
178 } |
99 |
179 |
100 // ---------------------------------------------------------------------------- |
180 // ---------------------------------------------------------------------------- |
101 // CCalenController::InstanceL |
181 // CCalenController::InstanceL |
102 // Returns a pointer to the single instance of the Calendar Controller. |
182 // Returns a pointer to the single instance of the Calendar Controller. |
103 // Leaves with KErrNotReady if the controller has not already been created |
183 // Leaves with KErrNotReady if the controller has not already been created |
104 // using NewL. A leave here means that the Calendar application is not running |
184 // using NewL. A leave here means that the Calendar application is not running |
105 // but someone is trying to use the services API. |
185 // but someone is trying to use the services API. |
106 // (other items were commented in a header). |
186 // (other items were commented in a header). |
107 // ---------------------------------------------------------------------------- |
187 // ---------------------------------------------------------------------------- |
108 // |
188 // |
109 EXPORT_C CCalenController* CCalenController::InstanceL() |
189 CCalenController* CCalenController::InstanceL() |
110 { |
190 { |
111 TRACE_ENTRY_POINT; |
191 OstTraceFunctionEntry0( CCALENCONTROLLER_INSTANCEL_ENTRY ); |
112 |
192 |
113 CCalenController* self = NULL; |
193 CCalenController* self = NULL; |
114 TAny* tlsPtr = Dll::Tls(); |
194 TAny* tlsPtr = Dll::Tls(); |
115 |
195 |
116 // Check Thread local storage |
196 // Check Thread local storage |
117 if( !tlsPtr ) |
197 if( !tlsPtr ) |
126 self = static_cast<CCalenController*>( tlsPtr ); |
206 self = static_cast<CCalenController*>( tlsPtr ); |
127 } |
207 } |
128 |
208 |
129 ++self->iRefCount; |
209 ++self->iRefCount; |
130 |
210 |
131 TRACE_EXIT_POINT; |
211 |
132 return self; |
212 OstTraceFunctionExit0( CCALENCONTROLLER_INSTANCEL_EXIT ); |
133 } |
213 return self; |
134 |
214 } |
135 // ---------------------------------------------------------------------------- |
215 |
136 // CCalenController::ConstructL |
216 // ---------------------------------------------------------------------------- |
137 // 2nd phase of construction |
217 // CCalenController::ReleaseCustomisations |
138 // (other items were commented in a header). |
218 // Releases any plugins by deleting the customisation manager |
139 // ---------------------------------------------------------------------------- |
219 // should only be called on exiting by the application. |
140 // |
220 // (other items were commented in a header). |
141 void CCalenController::ConstructL() |
221 // ---------------------------------------------------------------------------- |
142 { |
222 // |
143 TRACE_ENTRY_POINT; |
223 void CCalenController::ReleaseCustomisations() |
144 |
224 { |
145 TFileName fileName; |
225 OstTraceFunctionEntry0( CCALENCONTROLLER_RELEASECUSTOMISATIONS_ENTRY ); |
146 // Get the complate path of the DLL from where it is currently loaded |
226 |
147 Dll::FileName( fileName ); |
227 delete iCustomisationManager; |
148 |
228 iCustomisationManager = NULL; |
149 TFileName resFile; |
229 |
150 |
230 OstTraceFunctionExit0( CCALENCONTROLLER_RELEASECUSTOMISATIONS_EXIT ); |
151 // Append the Drive letters ex., Z: or C: |
|
152 resFile.Append(fileName.Mid(0,2)); |
|
153 resFile.Append(KDC_RESOURCE_FILES_DIR); |
|
154 resFile.Append(KResourceFile); |
|
155 |
|
156 BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile ); |
|
157 |
|
158 iResourceFileOffset = CEikonEnv::Static()->AddResourceFileL( resFile ); |
|
159 |
|
160 |
|
161 iStateMachine = CCalenStateMachine::NewL( *this ); |
|
162 // Create the notifier. |
|
163 iNotifier = new( ELeave )CCalenNotifier( *this ); |
|
164 |
|
165 // Get an instance of the global data |
|
166 iGlobalData = CCalenGlobalData::NewL( *iNotifier, iNotifier, iNotifier ); |
|
167 iGlobalData->InitializeGlobalDataL(); |
|
168 |
|
169 RArray<TCalenNotification> notificationArray; |
|
170 // Complete construction of the notifier and register the |
|
171 // global data for notifications |
|
172 iNotifier->ConstructL(); |
|
173 |
|
174 notificationArray.Append(ECalenNotifyEntryInstanceViewCreated); |
|
175 notificationArray.Append(ECalenNotifyEntryInstanceViewCreationFailed); |
|
176 notificationArray.Append(ECalenNotifyDeleteInstanceView); |
|
177 notificationArray.Append(ECalenNotifyRealExit); |
|
178 notificationArray.Append(ECalenNotifyCalendarInfoCreated); |
|
179 notificationArray.Append(ECalenNotifyCalendarInfoUpdated); |
|
180 |
|
181 |
|
182 RegisterForNotificationsL( iGlobalData,notificationArray); |
|
183 notificationArray.Reset(); |
|
184 |
|
185 // Create the cmd line handler |
|
186 iCmdLineLauncher = CCalenCmdLineLauncher::NewL( *this, iAppUi ); |
|
187 |
|
188 // Create the services |
|
189 iServices = CCalenServicesImpl::NewL(); |
|
190 |
|
191 // Create the action uis. |
|
192 iActionUi = CCalenActionUi::NewL( *this ); |
|
193 |
|
194 // Create the settings |
|
195 iSetting = CCalenSetting::InstanceL(); |
|
196 |
|
197 // Create the view manager, and register for notifications |
|
198 iViewManager = CCalenViewManager::NewL( iAppUi, *this ); |
|
199 |
|
200 notificationArray.Append(ECalenNotifySettingsChanged); |
|
201 notificationArray.Append(ECalenNotifySettingsClosed); |
|
202 notificationArray.Append(ECalenNotifySystemLocaleChanged); |
|
203 notificationArray.Append(ECalenNotifyPluginEnabledDisabled); |
|
204 notificationArray.Append(ECalenNotifyEntrySaved); |
|
205 notificationArray.Append(ECalenNotifyEntryDeleted); |
|
206 notificationArray.Append(ECalenNotifyInstanceDeleted); |
|
207 notificationArray.Append(ECalenNotifyMultipleEntriesDeleted); |
|
208 notificationArray.Append(ECalenNotifyExternalDatabaseChanged); |
|
209 notificationArray.Append(ECalenNotifyDeleteFailed); |
|
210 notificationArray.Append(ECalenNotifyEntryClosed); |
|
211 notificationArray.Append(ECalenNotifyCancelDelete); |
|
212 notificationArray.Append(ECalenNotifySystemTimeChanged); |
|
213 notificationArray.Append(ECalenNotifyAppForegrounded); |
|
214 notificationArray.Append(ECalenNotifyDayViewClosed); |
|
215 notificationArray.Append(ECalenNotifyWeekViewClosed); |
|
216 notificationArray.Append(ECalenNotifyAppBackgrounded); |
|
217 notificationArray.Append(ECalenNotifyViewPopulationComplete); |
|
218 notificationArray.Append(ECalenNotifyCalendarFieldChanged); |
|
219 notificationArray.Append(ECalenNotifyCancelStatusUpdation); |
|
220 notificationArray.Append(ECalenNotifyMarkedEntryCompleted); |
|
221 notificationArray.Append(ECalenNotifyAttachmentAdded); |
|
222 notificationArray.Append(ECalenNotifyAttachmentViewerClosed); |
|
223 notificationArray.Append(ECalenNotifyAttachmentRemoved); |
|
224 notificationArray.Append(ECalenNotifyCalendarInfoCreated); |
|
225 notificationArray.Append(ECalenNotifyCalendarInfoUpdated); |
|
226 notificationArray.Append(ECalenNotifyCalendarFileDeleted); |
|
227 |
|
228 RegisterForNotificationsL( iViewManager, notificationArray ); |
|
229 notificationArray.Reset(); |
|
230 |
|
231 // Create the customisation manager, and register for |
|
232 // notifications |
|
233 iCustomisationManager = CCalenCustomisationManager::NewL( *this, |
|
234 iSetting->PluginAvailability(), |
|
235 *iServices, |
|
236 iViewManager->ViewInfoArray() ); |
|
237 |
|
238 notificationArray.Append(ECalenNotifySettingsChanged); |
|
239 notificationArray.Append(ECalenNotifyCheckPluginUnloading); |
|
240 notificationArray.Append(ECalenNotifyEComRegistryChanged); |
|
241 |
|
242 RegisterForNotificationsL( iCustomisationManager,notificationArray); |
|
243 notificationArray.Reset(); |
|
244 |
|
245 // Some plugins may have been added or removed - update the settings. |
|
246 iSetting->UpdatePluginListL( *iCustomisationManager ); |
|
247 |
|
248 // View manager constructs the custom views using the |
|
249 // customisation manager |
|
250 iViewManager->ConstructCustomViewsL( *iCustomisationManager ); |
|
251 |
|
252 // for handling missed alarms/msk improvements for alarm |
|
253 iAlarmManager = CCalenAlarmManager::NewL(*this); |
|
254 |
|
255 notificationArray.Append(ECalenNotifyLostAlarms); |
|
256 notificationArray.Append(ECalenNotifyMissedAlarmViewClosed); |
|
257 notificationArray.Append(ECalenNotifyClearMissedAlarms); |
|
258 notificationArray.Append(ECalenNotifyMissedEventViewClosed); |
|
259 notificationArray.Append(ECalenNotifyEntryDeleted); |
|
260 notificationArray.Append(ECalenNotifyInstanceDeleted); |
|
261 notificationArray.Append(ECalenNotifyEntrySaved); |
|
262 notificationArray.Append(ECalenNotifyMultipleEntriesDeleted); |
|
263 notificationArray.Append(ECalenNotifySystemTimeChanged); |
|
264 notificationArray.Append(ECalenNotifyAlarmStopped); |
|
265 notificationArray.Append(ECalenNotifyAlarmSnoozed); |
|
266 notificationArray.Append(ECalenNotifyEntryClosed); |
|
267 notificationArray.Append(ECalenNotifyAppForegrounded); |
|
268 |
|
269 RegisterForNotificationsL( iAlarmManager, notificationArray ); |
|
270 notificationArray.Reset(); |
|
271 |
|
272 //iMultipleDbmanager = CCalenMultipleDbManager::NewL(); |
|
273 |
|
274 iAttachmentData = CCalenAttachmentModel::NewL(); |
|
275 |
|
276 notificationArray.Close(); |
|
277 |
|
278 TRACE_EXIT_POINT; |
|
279 } |
|
280 |
|
281 // ---------------------------------------------------------------------------- |
|
282 // CCalenController::CCalenController |
|
283 // C++ default constructor. |
|
284 // (other items were commented in a header). |
|
285 // ---------------------------------------------------------------------------- |
|
286 // |
|
287 CCalenController::CCalenController( CAknViewAppUi& aAppUi ) |
|
288 : iAppUi( aAppUi ), |
|
289 iNextServicesCommandBase( KCustomCommandRangeStart ), |
|
290 iFasterApp( EFalse ) |
|
291 { |
|
292 TRACE_ENTRY_POINT; |
|
293 TRACE_EXIT_POINT; |
|
294 } |
|
295 |
|
296 // ---------------------------------------------------------------------------- |
|
297 // CCalenController::~CCalenController |
|
298 // Private destructor, called from Release() when reference count is 0. |
|
299 // Frees all resources. |
|
300 // (other items were commented in a header). |
|
301 // ---------------------------------------------------------------------------- |
|
302 // |
|
303 CCalenController::~CCalenController() |
|
304 { |
|
305 TRACE_ENTRY_POINT; |
|
306 |
|
307 if(iSystemTimeChangedMsgDelayer) |
|
308 { |
|
309 iSystemTimeChangedMsgDelayer->Cancel(); |
|
310 delete iSystemTimeChangedMsgDelayer; |
|
311 iSystemTimeChangedMsgDelayer = NULL; |
|
312 } |
|
313 |
|
314 if(iAttachmentData) |
|
315 { |
|
316 delete iAttachmentData; |
|
317 iAttachmentData = NULL; |
|
318 } |
|
319 |
|
320 if( iAlarmManager ) |
|
321 { |
|
322 delete iAlarmManager; |
|
323 } |
|
324 |
|
325 if( iCustomisationManager ) |
|
326 { |
|
327 delete iCustomisationManager; |
|
328 } |
|
329 |
|
330 if( iViewManager ) |
|
331 { |
|
332 delete iViewManager; |
|
333 } |
|
334 |
|
335 if ( iSetting ) |
|
336 { |
|
337 iSetting->Release(); |
|
338 } |
|
339 |
|
340 if( iActionUi ) |
|
341 { |
|
342 delete iActionUi; |
|
343 } |
|
344 |
|
345 if ( iServices ) |
|
346 { |
|
347 iServices->Release(); |
|
348 } |
|
349 |
|
350 if( iCmdLineLauncher ) |
|
351 { |
|
352 delete iCmdLineLauncher; |
|
353 } |
|
354 |
|
355 if( iGlobalData ) |
|
356 { |
|
357 iGlobalData->Release(); |
|
358 } |
|
359 |
|
360 if( iNotifier ) |
|
361 { |
|
362 delete iNotifier; |
|
363 } |
|
364 |
|
365 if( iStateMachine ) |
|
366 { |
|
367 delete iStateMachine; |
|
368 } |
|
369 |
|
370 if( iResourceFileOffset ) |
|
371 { |
|
372 CCoeEnv::Static()->DeleteResourceFile( iResourceFileOffset ); |
|
373 } |
|
374 Dll::SetTls( NULL ); |
|
375 |
|
376 TRACE_EXIT_POINT; |
|
377 } |
231 } |
378 |
232 |
379 // ---------------------------------------------------------------------------- |
233 // ---------------------------------------------------------------------------- |
380 // CCalenController::Release |
234 // CCalenController::Release |
381 // Decrement the reference count of this singleton. |
235 // Decrement the reference count of this singleton. |
382 // When the reference count is 0, the controller will self delete and free |
236 // When the reference count is 0, the controller will self delete and free |
383 // all resources |
237 // all resources |
384 // (other items were commented in a header). |
238 // (other items were commented in a header). |
385 // ---------------------------------------------------------------------------- |
239 // ---------------------------------------------------------------------------- |
386 // |
240 // |
387 EXPORT_C void CCalenController::Release() |
241 void CCalenController::Release() |
388 { |
242 { |
389 TRACE_ENTRY_POINT; |
243 OstTraceFunctionEntry0( CCALENCONTROLLER_RELEASE_ENTRY ); |
390 |
244 |
391 --iRefCount; |
245 --iRefCount; |
392 |
246 |
393 // The controller owns its own instance of the services, therefore the |
247 // The controller owns its own instance of the services, therefore the |
394 // reference count will be one, immediatley before deletion. |
248 // reference count will be one, immediatley before deletion. |
395 if (iRefCount == 1) |
249 if (iRefCount == 1) |
396 { |
250 { |
397 delete this; |
251 delete this; |
398 } |
252 } |
399 |
253 |
400 TRACE_EXIT_POINT; |
254 OstTraceFunctionExit0( CCALENCONTROLLER_RELEASE_EXIT ); |
401 } |
255 } |
402 |
256 |
403 // ---------------------------------------------------------------------------- |
257 // ---------------------------------------------------------------------------- |
404 // CCalenController::ReleaseCustomisations |
258 // CCalenController::~CCalenController |
405 // Releases any plugins by deleting the customisation manager |
259 // Private destructor, called from Release() when reference count is 0. |
406 // should only be called on exiting by the document. |
260 // Frees all resources. |
407 // (other items were commented in a header). |
261 // (other items were commented in a header). |
408 // ---------------------------------------------------------------------------- |
262 // ---------------------------------------------------------------------------- |
409 // |
263 // |
410 EXPORT_C void CCalenController::ReleaseCustomisations() |
264 CCalenController::~CCalenController() |
411 { |
265 { |
412 TRACE_ENTRY_POINT; |
266 OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_CCALENCONTROLLER_ENTRY ); |
413 |
267 |
414 delete iCustomisationManager; |
268 if(iStateMachine) { |
415 iCustomisationManager = NULL; |
269 delete iStateMachine; |
416 |
270 iStateMachine = NULL; |
417 TRACE_EXIT_POINT; |
271 } |
418 } |
272 |
|
273 if ( iServices ) |
|
274 { |
|
275 iServices->Release(); |
|
276 } |
|
277 |
|
278 if( mContext ) |
|
279 { |
|
280 delete mContext; |
|
281 mContext = NULL; |
|
282 } |
|
283 // iActionUi has to be deleted before iNotifier |
|
284 // as the unregistering of the notifications has to be done |
|
285 if( iActionUi ) |
|
286 { |
|
287 delete iActionUi; |
|
288 iActionUi = NULL; |
|
289 } |
|
290 |
|
291 if( iNotifier ) |
|
292 { |
|
293 delete iNotifier; |
|
294 iNotifier = NULL; |
|
295 } |
|
296 |
|
297 if( iViewManager ) |
|
298 { |
|
299 delete iViewManager; |
|
300 iViewManager = NULL; |
|
301 } |
|
302 |
|
303 if( iCustomisationManager ) |
|
304 { |
|
305 delete iCustomisationManager; |
|
306 iCustomisationManager = NULL; |
|
307 } |
|
308 |
|
309 if (mAgendaUtil) { |
|
310 delete mAgendaUtil; |
|
311 mAgendaUtil = 0; |
|
312 } |
|
313 |
|
314 Dll::SetTls( NULL ); |
|
315 |
|
316 OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_CCALENCONTROLLER_EXIT ); |
|
317 } |
|
318 |
419 |
319 |
420 // ---------------------------------------------------------------------------- |
320 // ---------------------------------------------------------------------------- |
421 // CCalenController::IssueCommmandL |
321 // CCalenController::IssueCommmandL |
422 // Adds the passed command to the comand queue. Commands are handled |
322 // Adds the passed command to the comand queue. Commands are handled |
423 // asynchronously in HandleCommandL |
323 // asynchronously in HandleCommandL |
424 // Returns EFalse if the passed command is not in the issuers command range |
324 // Returns EFalse if the passed command is not in the issuers command range |
425 // (other items were commented in a header). |
325 // (other items were commented in a header). |
426 // ---------------------------------------------------------------------------- |
326 // ---------------------------------------------------------------------------- |
427 // |
327 // |
428 EXPORT_C TBool CCalenController::IssueCommandL( TInt aCommand ) |
328 TBool CCalenController::IssueCommandL( TInt aCommand ) |
429 { |
329 { |
430 TRACE_ENTRY_POINT; |
330 OstTraceFunctionEntry0( CCALENCONTROLLER_ISSUECOMMANDL_ENTRY ); |
|
331 |
431 TCalenCommand cmd; |
332 TCalenCommand cmd; |
432 |
333 cmd.SetCommandAndContextL( aCommand ,context()); |
433 if( aCommand == EAknCmdHideInBackground || |
|
434 ( aCommand == EAknSoftkeyExit && iAppUi.ExitHidesInBackground() ) ) |
|
435 { |
|
436 SetFasterAppFlag( ETrue ); |
|
437 aCommand = ECalenFasterAppExit; |
|
438 } |
|
439 else if( aCommand == EAknCmdExit || aCommand == EEikCmdExit |
|
440 || aCommand == EAknSoftkeyExit ) |
|
441 { |
|
442 if( iViewManager->CalenToolbar() ) |
|
443 { |
|
444 iViewManager->CalenToolbar()->ResetCalendarToolbar(); |
|
445 } |
|
446 } |
|
447 else |
|
448 { |
|
449 if((aCommand < ECalenViewCommandBase ) || (aCommand > iNextServicesCommandBase)) |
|
450 { |
|
451 return EFalse; |
|
452 } |
|
453 } |
|
454 |
|
455 cmd.SetCommandAndContextL( aCommand, iGlobalData->Context() ); |
|
456 |
334 |
457 TBool ret = iStateMachine->HandleCommandL( cmd ); |
335 TBool ret = iStateMachine->HandleCommandL( cmd ); |
458 |
336 |
459 TRACE_EXIT_POINT; |
337 OstTraceFunctionExit0( CCALENCONTROLLER_ISSUECOMMANDL_EXIT ); |
460 return ret; |
338 return ret; |
461 } |
339 } |
462 |
340 |
463 |
341 // ---------------------------------------------------------------------------- |
464 // ---------------------------------------------------------------------------- |
342 // CCalenController::Services |
465 // CCalenController::RequestActivationL |
343 // Returns the services |
466 // Request activation of a specific view |
344 // (other items were commented in a header). |
467 // (other items were commented in a header). |
345 // ---------------------------------------------------------------------------- |
468 // ---------------------------------------------------------------------------- |
346 // |
469 // |
347 MCalenServices& CCalenController::Services() |
470 void CCalenController::RequestActivationL( const TVwsViewId& aViewId ) |
348 { |
471 { |
349 OstTraceFunctionEntry0( CCALENCONTROLLER_SERVICES_ENTRY ); |
472 TRACE_ENTRY_POINT; |
350 |
473 |
351 OstTraceFunctionExit0( CCALENCONTROLLER_SERVICES_EXIT ); |
474 iViewManager->RequestActivationL( aViewId ); |
352 return *iServices; |
475 |
353 } |
476 TRACE_EXIT_POINT; |
354 |
477 } |
355 // ---------------------------------------------------------------------------- |
478 |
356 // CCalenController::ViewManager |
479 // ---------------------------------------------------------------------------- |
357 // Returns a reference to the view manager |
480 // CCalenController::BroadcastNotification |
358 // (other items were commented in a header). |
|
359 // ---------------------------------------------------------------------------- |
|
360 CalenViewManager& CCalenController::ViewManager() |
|
361 { |
|
362 OstTraceFunctionEntry0( CCALENCONTROLLER_VIEWMANAGER_ENTRY ); |
|
363 |
|
364 OstTraceFunctionExit0( CCALENCONTROLLER_VIEWMANAGER_EXIT ); |
|
365 return *iViewManager; |
|
366 } |
|
367 |
|
368 // ---------------------------------------------------------------------------- |
|
369 // CCalenController::MainWindow |
|
370 // Returns a reference to the MainWindow |
|
371 // (other items were commented in a header). |
|
372 // ---------------------------------------------------------------------------- |
|
373 HbMainWindow& CCalenController::MainWindow() |
|
374 { |
|
375 |
|
376 OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_MAINWINDOW_ENTRY ); |
|
377 |
|
378 OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_MAINWINDOW_EXIT ); |
|
379 |
|
380 return *(hbInstance->allMainWindows().first()); |
|
381 |
|
382 |
|
383 } |
|
384 |
|
385 // ---------------------------------------------------------------------------- |
|
386 // CCCalenController::BroadcastNotification |
481 // Passes the notification to the Calendar Notifier. The notification will |
387 // Passes the notification to the Calendar Notifier. The notification will |
482 // then be broadcast to all observers |
388 // then be broadcast to all observers |
483 // (other items were commented in a header). |
389 // (other items were commented in a header). |
484 // ---------------------------------------------------------------------------- |
390 // ---------------------------------------------------------------------------- |
485 // |
391 // |
486 EXPORT_C void CCalenController::BroadcastNotification( TCalenNotification aNotification ) |
392 void CCalenController::BroadcastNotification( TCalenNotification aNotification ) |
487 { |
393 { |
488 TRACE_ENTRY_POINT; |
394 OstTraceFunctionEntry0( CCALENCONTROLLER_BROADCASTNOTIFICATION_ENTRY ); |
489 |
395 |
490 iNotifier->BroadcastNotification( aNotification ); |
396 iNotifier->BroadcastNotification( aNotification ); |
491 |
397 |
492 TRACE_EXIT_POINT; |
398 OstTraceFunctionExit0( CCALENCONTROLLER_BROADCASTNOTIFICATION_EXIT ); |
493 } |
399 } |
494 |
400 |
495 // ---------------------------------------------------------------------------- |
401 // ---------------------------------------------------------------------------- |
496 // CCalenController::RegisterForNotificationsL |
402 // CCCalenController::RegisterForNotificationsL |
497 // Registers the passed notification handler with the Calendar Notifier |
403 // Registers the passed notification handler with the Calendar Notifier |
498 // (other items were commented in a header). |
404 // (other items were commented in a header). |
499 // ---------------------------------------------------------------------------- |
405 // ---------------------------------------------------------------------------- |
500 // |
406 // |
501 EXPORT_C void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
407 void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
502 TCalenNotification aNotification ) |
408 TCalenNotification aNotification ) |
503 { |
409 { |
504 TRACE_ENTRY_POINT; |
410 OstTraceFunctionEntry0( CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_ENTRY ); |
505 |
411 |
506 iNotifier->RegisterForNotificationsL( aHandler, aNotification ); |
412 iNotifier->RegisterForNotificationsL( aHandler, aNotification ); |
507 |
413 |
508 TRACE_EXIT_POINT; |
414 OstTraceFunctionExit0( CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_EXIT ); |
509 } |
415 } |
510 |
416 |
511 // ---------------------------------------------------------------------------- |
417 // ---------------------------------------------------------------------------- |
512 // CCalenController::RegisterForNotificationsL |
418 // CCCalenController::RegisterForNotificationsL |
513 // Registers the passed notification handler with the Calendar Notifier |
419 // Registers the passed notification handler with the Calendar Notifier |
514 // (other items were commented in a header). |
420 // (other items were commented in a header). |
515 // ---------------------------------------------------------------------------- |
421 // ---------------------------------------------------------------------------- |
516 // |
422 // |
517 EXPORT_C void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
423 void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
518 RArray<TCalenNotification>& aNotifications ) |
424 RArray<TCalenNotification>& aNotifications ) |
519 { |
425 { |
520 TRACE_ENTRY_POINT; |
426 OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_ENTRY ); |
521 |
427 |
522 iNotifier->RegisterForNotificationsL( aHandler, aNotifications ); |
428 iNotifier->RegisterForNotificationsL( aHandler, aNotifications ); |
523 |
429 |
524 TRACE_EXIT_POINT; |
430 OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_EXIT ); |
525 } |
431 } |
526 |
432 |
527 // ---------------------------------------------------------------------------- |
433 // ---------------------------------------------------------------------------- |
528 // CCalenController::CancelNotifications |
434 // CCCalenController::CancelNotifications |
529 // Removes the passed handler from the notifier. |
435 // Removes the passed handler from the notifier. |
530 // (other items were commented in a header). |
436 // (other items were commented in a header). |
531 // ---------------------------------------------------------------------------- |
437 // ---------------------------------------------------------------------------- |
532 // |
438 // |
533 EXPORT_C void CCalenController::CancelNotifications( MCalenNotificationHandler* aHandler ) |
439 void CCalenController::CancelNotifications( MCalenNotificationHandler* aHandler ) |
534 { |
440 { |
535 TRACE_ENTRY_POINT; |
441 OstTraceFunctionEntry0( CCALENCONTROLLER_CANCELNOTIFICATIONS_ENTRY ); |
536 |
442 |
537 iNotifier->CancelNotifications( aHandler ); |
443 iNotifier->CancelNotifications( aHandler ); |
538 |
444 |
539 TRACE_EXIT_POINT; |
445 OstTraceFunctionExit0( CCALENCONTROLLER_CANCELNOTIFICATIONS_EXIT ); |
540 } |
446 } |
541 |
447 |
542 // ---------------------------------------------------------------------------- |
448 // ---------------------------------------------------------------------------- |
543 // CCalenController::GetCommandHandlerL |
449 // CCCalenController::GetCommandHandlerL |
544 // Searches for a command handler for a particular command. Customisations |
450 // Searches for a command handler for a particular command. Customisations |
545 // are searched first. If no customisation wants to handle the command it is |
451 // are searched first. If no customisation wants to handle the command it is |
546 // handled by the view manager or the action uis |
452 // handled by the view manager or the action uis |
547 // ---------------------------------------------------------------------------- |
453 // ---------------------------------------------------------------------------- |
548 MCalenCommandHandler* CCalenController::GetCommandHandlerL( TInt aCommand ) |
454 MCalenCommandHandler* CCalenController::GetCommandHandlerL( TInt aCommand ) |
549 { |
455 { |
550 TRACE_ENTRY_POINT; |
456 OstTraceFunctionEntry0( CCALENCONTROLLER_GETCOMMANDHANDLERL_ENTRY ); |
551 |
457 |
552 MCalenCommandHandler* handler( NULL ); |
458 MCalenCommandHandler* handler( NULL ); |
553 |
459 |
554 // Stop non-published commands from being customised |
460 // Stop non-published commands from being customised |
555 if ( aCommand != ECalenShowSettings |
461 if ( aCommand != ECalenShowSettings |
558 // See if a plugin wants the command |
464 // See if a plugin wants the command |
559 handler = iCustomisationManager->GetCommandHandlerL( aCommand ); |
465 handler = iCustomisationManager->GetCommandHandlerL( aCommand ); |
560 } |
466 } |
561 |
467 |
562 // See if the view manager wants the command |
468 // See if the view manager wants the command |
563 if(!handler) |
469 if ( !handler ) |
564 { |
470 { |
565 if( aCommand >= ECalenViewCommandBase |
471 if ( aCommand >= ECalenViewCommandBase |
566 && aCommand < ECalenEditCommandBase ) |
472 && aCommand < ECalenEditCommandBase ) |
567 { |
473 { |
568 handler = iViewManager; |
474 handler = iViewManager; |
569 } |
475 } |
570 else if(aCommand >= ECalenMissedAlarmCommandBase |
476 else if( aCommand >= ECalenMissedAlarmCommandBase |
571 && aCommand < ECalenAttachmentCommandBase ) |
477 && aCommand < ECalenLastCommand ) |
572 { |
478 { |
573 handler = iAlarmManager; |
479 //handler = iAlarmManager; |
574 } |
480 } |
575 else |
481 else |
576 { |
482 { |
577 handler = iActionUi->GetCommandHandlerL(aCommand); |
483 handler = iActionUi->GetCommandHandlerL( aCommand ); |
578 } |
484 } |
579 } |
485 } |
580 |
486 |
581 // No command handler is an error |
487 // No command handler is an error |
582 |
488 |
|
489 OstTraceFunctionExit0( CCALENCONTROLLER_GETCOMMANDHANDLERL_EXIT ); |
|
490 |
583 // return the handler |
491 // return the handler |
584 TRACE_EXIT_POINT; |
|
585 return handler; |
492 return handler; |
586 } |
493 } |
587 |
494 |
588 // ---------------------------------------------------- |
495 // ---------------------------------------------------------------------------- |
589 // CCalenController::CheckSystemTimeAtStartUpL |
496 // CCCalenController::NewServicesL |
590 // Check the system time change at the startup |
497 // Factory function for creating new MCalenServices objects |
591 // ---------------------------------------------------- |
498 // (other items were commented in a header). |
592 // |
499 // ---------------------------------------------------------------------------- |
593 void CCalenController::CheckSystemTimeAtStartUpL() |
500 // |
594 { |
501 MCalenServices* CCalenController::NewServicesL() |
595 TRACE_ENTRY_POINT; |
502 { |
596 |
503 OstTraceFunctionEntry0( CCALENCONTROLLER_NEWSERVICESL_ENTRY ); |
597 if(iSystemTimeChangedMsgDelayer) |
504 |
|
505 TInt commandRangeStart = iNextServicesCommandBase; |
|
506 TInt commandRangeEnd = commandRangeStart + KNumberOfCommandsPerServices; |
|
507 iNextServicesCommandBase = commandRangeEnd + 1; |
|
508 |
|
509 CalenServicesImpl* svc = CalenServicesImpl::NewL( commandRangeStart,commandRangeEnd ); |
|
510 |
|
511 OstTraceFunctionExit0( CCALENCONTROLLER_NEWSERVICESL_EXIT ); |
|
512 return svc; |
|
513 } |
|
514 |
|
515 // ---------------------------------------------------------------------------- |
|
516 // CCalenController::Notifier |
|
517 // Returns the notifier. |
|
518 // (other items were commented in a header). |
|
519 // ---------------------------------------------------------------------------- |
|
520 // |
|
521 CalenNotifier& CCalenController::Notifier() |
|
522 { |
|
523 OstTraceFunctionEntry0( CCALENCONTROLLER_NOTIFIER_ENTRY ); |
|
524 |
|
525 OstTraceFunctionExit0( CCALENCONTROLLER_NOTIFIER_EXIT ); |
|
526 return *iNotifier; |
|
527 } |
|
528 |
|
529 // ---------------------------------------------------------------------------- |
|
530 // CCalenController::Infobar |
|
531 // Descriptor passed to plugins to get customised info bar text. |
|
532 // Acts as a conduit between the services and the customisation manager. |
|
533 // (other items were commented in a header). |
|
534 // ---------------------------------------------------------------------------- |
|
535 // |
|
536 HbWidget* CCalenController::Infobar() |
|
537 { |
|
538 OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_INFOBAR_ENTRY ); |
|
539 |
|
540 OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_INFOBAR_EXIT ); |
|
541 return iCustomisationManager->Infobar(); |
|
542 } |
|
543 // ---------------------------------------------------------------------------- |
|
544 // CCalenController::InfobarTextL |
|
545 // @returns info bar text |
|
546 // (other items were commented in a header). |
|
547 // ---------------------------------------------------------------------------- |
|
548 // |
|
549 QString* CCalenController::InfobarTextL() |
|
550 { |
|
551 OstTraceFunctionEntry0( CCALENCONTROLLER_INFOBARTEXTL_ENTRY ); |
|
552 |
|
553 OstTraceFunctionExit0( CCALENCONTROLLER_INFOBARTEXTL_EXIT ); |
|
554 return iCustomisationManager->InfobarTextL(); |
|
555 } |
|
556 // ---------------------------------------------------------------------------- |
|
557 // CCalenController::CustomisationManager |
|
558 // Returns a reference to the customisation manager |
|
559 // (other items were commented in a header). |
|
560 // ---------------------------------------------------------------------------- |
|
561 // |
|
562 CCalenCustomisationManager& CCalenController::CustomisationManager() |
|
563 { |
|
564 OstTraceFunctionEntry0( CCALENCONTROLLER_CUSTOMISATIONMANAGER_ENTRY ); |
|
565 |
|
566 OstTraceFunctionExit0( CCALENCONTROLLER_CUSTOMISATIONMANAGER_EXIT ); |
|
567 return *iCustomisationManager; |
|
568 } |
|
569 |
|
570 // ---------------------------------------------------------------------------- |
|
571 // CCalenController::SetDefaultContext |
|
572 // Sets the default context for today |
|
573 // (other items were commented in a header). |
|
574 // ---------------------------------------------------------------------------- |
|
575 // |
|
576 void CCalenController::SetDefaultContext() |
|
577 { |
|
578 OstTraceFunctionEntry0( CCALENCONTROLLER_SETDEFAULTCONTEXT_ENTRY ); |
|
579 |
|
580 QDateTime focusTime = mContext->defaultCalTimeForViewsL(); |
|
581 mContext->setFocusDateAndTime(focusTime); |
|
582 |
|
583 OstTraceFunctionExit0( CCALENCONTROLLER_SETDEFAULTCONTEXT_EXIT ); |
|
584 } |
|
585 |
|
586 // ---------------------------------------------------------------------------- |
|
587 // CCalenController::OfferMenu |
|
588 // Offers the menu to plugins for customisation. |
|
589 // Acts as a conduit between the services and the customisation manager. |
|
590 // (other items were commented in a header). |
|
591 // ---------------------------------------------------------------------------- |
|
592 |
|
593 void CCalenController::OfferMenu(HbMenu* aHbMenu) |
|
594 { |
|
595 OstTraceFunctionEntry0( CCALENCONTROLLER_OFFERMENU_ENTRY ); |
|
596 |
|
597 iCustomisationManager->OfferMenu(aHbMenu); |
|
598 |
|
599 OstTraceFunctionExit0( CCALENCONTROLLER_OFFERMENU_EXIT ); |
|
600 } |
|
601 |
|
602 // ---------------------------------------------------------------------------- |
|
603 // CCalenController::agendaInterface |
|
604 // returns the interface to the agenda database |
|
605 // (other items were commented in a header). |
|
606 // --------------------------------------------------------------------------- |
|
607 // |
|
608 AgendaUtil* CCalenController::agendaInterface() |
|
609 { |
|
610 OstTraceFunctionEntry0( CCALENCONTROLLER_AGENDAINTERFACE_ENTRY ); |
|
611 |
|
612 |
|
613 OstTraceFunctionExit0( CCALENCONTROLLER_AGENDAINTERFACE_EXIT ); |
|
614 return mAgendaUtil; |
|
615 } |
|
616 |
|
617 // ---------------------------------------------------------------------------- |
|
618 // CCalenController::context |
|
619 // returns the calendar context |
|
620 // (other items were commented in a header). |
|
621 // --------------------------------------------------------------------------- |
|
622 // |
|
623 MCalenContext& CCalenController::context() |
|
624 { |
|
625 OstTraceFunctionEntry0( CCALENCONTROLLER_CONTEXT_ENTRY ); |
|
626 |
|
627 OstTraceFunctionExit0( CCALENCONTROLLER_CONTEXT_EXIT ); |
|
628 return *mContext; |
|
629 } |
|
630 |
|
631 // ---------------------------------------------------------------------------- |
|
632 // CCalenController::handleServiceManagerSlot |
|
633 // Launches the requested view |
|
634 // (other items were commented in a header). |
|
635 // --------------------------------------------------------------------------- |
|
636 // |
|
637 void CCalenController::handleServiceManagerSlot(int view, const QDateTime& dateTime) |
|
638 { |
|
639 OstTraceFunctionEntry0( CCALENCONTROLLER_HANDLESERVICEMANAGERSLOT_ENTRY ); |
|
640 |
|
641 if (iIsFromServiceFrmWrk) { |
|
642 // Set the context properly |
|
643 mContext->setFocusDateAndTime(dateTime); |
|
644 // launch the appropriate view |
|
645 iViewManager->constructAndActivateView(view); |
|
646 |
|
647 iIsFromServiceFrmWrk = false; |
|
648 |
|
649 } else { // Calendar was in backgroung but now its being brought to foreground |
|
650 // If current state is editing state or printing state |
|
651 // or deleting state or sending state, then dont do anything as |
|
652 // user might loose the data |
|
653 CCalenStateMachine::TCalenStateIndex currentState = iStateMachine->CurrentState(); |
|
654 if ((currentState == CCalenStateMachine::ECalenDeletingState) || |
|
655 (currentState == CCalenStateMachine::ECalenPrintingState) || |
|
656 (currentState == CCalenStateMachine::ECalenSendingState)) { |
|
657 // simply return - we dont have anything to do |
|
658 } |
|
659 |
|
660 else if (currentState == CCalenStateMachine::ECalenViewingState) { |
|
661 if(iViewManager->isEventViewerActive()){ |
|
662 iViewManager->closeAgendaEventView(); |
|
663 } |
|
664 } |
|
665 else if (currentState == CCalenStateMachine::ECalenEditingState) { |
|
666 // close the editor and save the entry if application is in background |
|
667 //and launch the desired view |
|
668 if(iViewManager->isEventViewerActive()){ |
|
669 iViewManager->saveAndCloseEditor(); |
|
670 iViewManager->closeAgendaEventView(); |
|
671 } |
|
672 else{ |
|
673 iActionUi->saveAndCloseEditor(); |
|
674 } |
|
675 } |
|
676 |
|
677 else if (currentState == CCalenStateMachine::ECalenSettingsState){ |
|
678 iViewManager->removeSettingsView(); |
|
679 } |
|
680 |
|
681 // Set the context properly |
|
682 mContext->setFocusDateAndTime(dateTime); |
|
683 IssueCommandL(view); |
|
684 |
|
685 // connect to raise the window to foreground once the view is ready |
|
686 connect(&MainWindow(), SIGNAL(viewReady()), |
|
687 this, SLOT(raiseWindow())); |
|
688 } |
|
689 |
|
690 } |
|
691 void CCalenController::raiseWindow() |
|
692 { |
|
693 MainWindow().raise(); |
|
694 disconnect(&MainWindow(), SIGNAL(viewReady()), |
|
695 this, SLOT(raiseWindow())); |
|
696 } |
|
697 // ---------------------------------------------------------------------------- |
|
698 // CCalenController::getFirstView |
|
699 // returns the first view with which calendar has been launched |
|
700 // (other items were commented in a header). |
|
701 // --------------------------------------------------------------------------- |
|
702 // |
|
703 int CCalenController::getFirstView() |
|
704 { |
|
705 OstTraceFunctionEntry0( CCALENCONTROLLER_GETFIRSTVIEW_ENTRY ); |
|
706 |
|
707 OstTraceFunctionExit0( CCALENCONTROLLER_GETFIRSTVIEW_EXIT ); |
|
708 |
|
709 return iViewManager->getFirstView(); |
|
710 |
|
711 } |
|
712 |
|
713 // ---------------------------------------------------------------------------- |
|
714 // CCalenController::eventFilter |
|
715 // Filters and handles the changes in events |
|
716 // (other items were commented in a header). |
|
717 // --------------------------------------------------------------------------- |
|
718 // |
|
719 bool CCalenController::eventFilter(QObject *object, QEvent *event) |
|
720 { |
|
721 OstTraceFunctionEntry0( CCALENCONTROLLER_EVENTFILTER_ENTRY ); |
|
722 |
|
723 switch (event->type()) |
598 { |
724 { |
599 iSystemTimeChangedMsgDelayer->Cancel(); |
725 case QEvent::LanguageChange: |
600 delete iSystemTimeChangedMsgDelayer; |
726 //TODO: Unload the translator and install the locale specific translator |
601 iSystemTimeChangedMsgDelayer = NULL; |
727 iNotifier->BroadcastNotification( ECalenNotifySystemLanguageChanged ); |
602 } |
|
603 |
|
604 // Introduce delay (CPeriodic) before showing the note |
|
605 // to allow time for the active view to display before |
|
606 // note. |
|
607 |
|
608 TCallBack callback; |
|
609 callback = TCallBack( SystemTimeChangeCallback, this ); |
|
610 |
|
611 iSystemTimeChangedMsgDelayer = new (ELeave) CAsyncCallBack( |
|
612 callback, CActive::EPriorityStandard); |
|
613 iSystemTimeChangedMsgDelayer->CallBack(); |
|
614 |
|
615 TRACE_EXIT_POINT; |
|
616 } |
|
617 |
|
618 // ---------------------------------------------------- |
|
619 // CCalenController::SystemTimeChangeCallback |
|
620 // This function is called when the System time is changed. |
|
621 // ---------------------------------------------------- |
|
622 // |
|
623 TInt CCalenController::SystemTimeChangeCallback(TAny* aThisPtr) |
|
624 { |
|
625 TRACE_ENTRY_POINT; |
|
626 |
|
627 PIM_TRAPD_HANDLE( |
|
628 static_cast<CCalenController*>(aThisPtr)->HandleSystemTimeChangeL()); |
|
629 |
|
630 TRACE_EXIT_POINT; |
|
631 return 0; |
|
632 } |
|
633 |
|
634 // ---------------------------------------------------------------------------- |
|
635 // CCalenController::HandleSystemTimeChangeL |
|
636 // Checks to see if the system time was changed while Calendar was |
|
637 // not running or in the background, potentially causing alarms to be missed |
|
638 // (other items were commented in a header). |
|
639 // ---------------------------------------------------------------------------- |
|
640 // |
|
641 void CCalenController::HandleSystemTimeChangeL() |
|
642 { |
|
643 TRACE_ENTRY_POINT; |
|
644 |
|
645 // get the system time change info |
|
646 TInt timeChanged = iNotifier->SystemTimeChangedL(); |
|
647 |
|
648 switch( timeChanged ) |
|
649 { |
|
650 case KCalenTimeZoneChanged: |
|
651 { |
|
652 ShowSystemChangeInfoNoteL( R_QTN_CALE_NOTE_SYSTEM_TIME_CHANGED ); |
|
653 } |
|
654 break; |
728 break; |
655 case KCalenLostAlarms: |
729 case QEvent::LocaleChange: |
656 { |
730 // TODO: handle the locale changes |
657 // Not displayed since missed alarms are handled in missed alarms view. |
|
658 // No need to show the info note the user. |
|
659 // Part of alarm improvement REQ for calendar. |
|
660 //ShowSystemChangeInfoNoteL( R_QTN_CALE_NOTE_MISSED_ALARMS ); |
|
661 } |
|
662 break; |
731 break; |
663 case KNoUserInfoNoteDisplay: |
|
664 default: |
732 default: |
665 break; |
733 break; |
666 } |
734 } |
667 |
735 OstTraceFunctionExit0( CCALENCONTROLLER_EVENTFILTER_EXIT ); |
668 // update system time change info to the cenrep |
736 |
669 iNotifier->UpdateSytemTimeChangeInfoL(); |
737 return QObject::eventFilter(object, event); |
670 |
738 } |
671 TRACE_EXIT_POINT; |
739 |
672 } |
740 /* |
673 |
741 * Emits the appReady signal. |
674 // ---------------------------------------------------------------------------- |
742 */ |
675 // CCalenController::ShowSystemChangeInfoNoteL |
743 void CCalenController::emitAppReady() |
676 // Displays an information note if the system time changed while Calendar |
744 { |
677 // was inactive |
745 emit appReady(); |
678 // (other items were commented in a header). |
746 } |
679 // ---------------------------------------------------------------------------- |
747 |
680 // |
748 // End of file --Don't remove this. |
681 void CCalenController::ShowSystemChangeInfoNoteL( TInt aResourceId ) |
|
682 { |
|
683 TRACE_ENTRY_POINT; |
|
684 |
|
685 HBufC* buf = StringLoader::LoadLC( aResourceId, CEikonEnv::Static() ); |
|
686 CAknInformationNote* dialog = new( ELeave ) CAknInformationNote(); |
|
687 |
|
688 dialog->ExecuteLD( *buf ); |
|
689 |
|
690 CleanupStack::PopAndDestroy( buf ); |
|
691 |
|
692 TRACE_EXIT_POINT; |
|
693 } |
|
694 |
|
695 // ---------------------------------------------------------------------------- |
|
696 // CCalenController::NewServicesL |
|
697 // Factory function for creating new MCalenServices objects |
|
698 // (other items were commented in a header). |
|
699 // ---------------------------------------------------------------------------- |
|
700 // |
|
701 EXPORT_C MCalenServices* CCalenController::NewServicesL() |
|
702 { |
|
703 TRACE_ENTRY_POINT; |
|
704 |
|
705 TInt commandRangeStart = iNextServicesCommandBase; |
|
706 TInt commandRangeEnd = commandRangeStart + KNumberOfCommandsPerServices; |
|
707 iNextServicesCommandBase = commandRangeEnd + 1; |
|
708 |
|
709 CCalenServicesImpl* svc = CCalenServicesImpl::NewL( commandRangeStart, |
|
710 commandRangeEnd ); |
|
711 TRACE_EXIT_POINT; |
|
712 return svc; |
|
713 } |
|
714 |
|
715 // ---------------------------------------------------------------------------- |
|
716 // CCalenController::ProcessCommandParametersL |
|
717 // Takes care of commandline parameters. |
|
718 // (other items were commented in a header). |
|
719 // ---------------------------------------------------------------------------- |
|
720 // |
|
721 EXPORT_C void CCalenController::ProcessCommandParametersL( TApaCommand aCommand, |
|
722 TFileName& aDocumentName, |
|
723 const TDesC8& aTail ) |
|
724 { |
|
725 TRACE_ENTRY_POINT; |
|
726 |
|
727 iCmdLineLauncher->ProcessCommandParametersL( aCommand, aDocumentName, aTail ); |
|
728 |
|
729 TRACE_EXIT_POINT; |
|
730 } |
|
731 |
|
732 // ---------------------------------------------------------------------------- |
|
733 // CCalenController::Notifier |
|
734 // Returns the notifier. |
|
735 // (other items were commented in a header). |
|
736 // ---------------------------------------------------------------------------- |
|
737 // |
|
738 CCalenNotifier& CCalenController::Notifier() |
|
739 { |
|
740 TRACE_ENTRY_POINT; |
|
741 TRACE_EXIT_POINT; |
|
742 return *iNotifier; |
|
743 } |
|
744 |
|
745 // ---------------------------------------------------------------------------- |
|
746 // CCalenController::SetExitOnDialogFlag |
|
747 // (other items were commented in a header). |
|
748 // ---------------------------------------------------------------------------- |
|
749 // |
|
750 void CCalenController::SetExitOnDialogFlag( TBool aFlag ) |
|
751 { |
|
752 TRACE_ENTRY_POINT; |
|
753 |
|
754 iCmdLineLauncher->SetExitOnDialogclose( aFlag ); |
|
755 |
|
756 TRACE_EXIT_POINT; |
|
757 } |
|
758 |
|
759 // ---------------------------------------------------------------------------- |
|
760 // CCalenController::GetExitOnDialogFlag |
|
761 // (other items were commented in a header). |
|
762 // ---------------------------------------------------------------------------- |
|
763 // |
|
764 TBool CCalenController::GetExitOnDialogFlag() |
|
765 { |
|
766 TRACE_ENTRY_POINT; |
|
767 |
|
768 TBool tempVal; |
|
769 tempVal = iCmdLineLauncher->GetExitOnDialogStatus(); |
|
770 return tempVal; |
|
771 |
|
772 TRACE_EXIT_POINT; |
|
773 } |
|
774 |
|
775 // ---------------------------------------------------------------------------- |
|
776 // CCalenController::Services |
|
777 // Returns the services |
|
778 // (other items were commented in a header). |
|
779 // ---------------------------------------------------------------------------- |
|
780 // |
|
781 MCalenServices& CCalenController::Services() |
|
782 { |
|
783 TRACE_ENTRY_POINT; |
|
784 TRACE_EXIT_POINT; |
|
785 return *iServices; |
|
786 } |
|
787 |
|
788 // ---------------------------------------------------------------------------- |
|
789 // CCalenController::OfferMenuPaneL |
|
790 // Offers the menu pane to plugins for customisation. |
|
791 // Acts as a conduit between the services and the customisation manager. |
|
792 // (other items were commented in a header). |
|
793 // ---------------------------------------------------------------------------- |
|
794 // |
|
795 EXPORT_C void CCalenController::OfferMenuPaneL( TInt aResourceId, |
|
796 CEikMenuPane* aMenuPane ) |
|
797 { |
|
798 TRACE_ENTRY_POINT; |
|
799 |
|
800 iCustomisationManager->OfferMenuPaneL( aResourceId, aMenuPane ); |
|
801 |
|
802 if( aResourceId == R_CALENDAR_CHANGE_VIEW_MENUPANE ) |
|
803 { |
|
804 // The cascading view switch menu is being displayed |
|
805 // therefore the view manager needs to be asked to remove |
|
806 // the current view |
|
807 iViewManager->RemoveCurrentViewFromMenu( aMenuPane ); |
|
808 } |
|
809 |
|
810 TUint32 missedAlarmsCount(0); |
|
811 // get the count from missed alarm store |
|
812 iAlarmManager->MissedAlarmStore()->CountL(missedAlarmsCount); |
|
813 |
|
814 //For adding "Missed Alarms" menu item for native views menu pane |
|
815 if(!missedAlarmsCount) |
|
816 { |
|
817 if( aResourceId == R_CALENDAR_MONTH_MENUPANE |
|
818 || aResourceId == R_CALENDAR_DAY_MENUPANE |
|
819 || aResourceId == R_CALENDAR_WEEK_MENUPANE |
|
820 || aResourceId == R_TODO_LIST_MENUPANE ) |
|
821 { |
|
822 aMenuPane->DeleteMenuItem(ECalenMissedAlarmsView); |
|
823 } |
|
824 } |
|
825 |
|
826 TRACE_EXIT_POINT; |
|
827 } |
|
828 |
|
829 // ---------------------------------------------------------------------------- |
|
830 // CCalenController::Infobar |
|
831 // Descriptor passed to plugins to get customised info bar text. |
|
832 // Acts as a conduit between the services and the customisation manager. |
|
833 // (other items were commented in a header). |
|
834 // ---------------------------------------------------------------------------- |
|
835 // |
|
836 EXPORT_C CCoeControl* CCalenController::Infobar( const TRect& aRect ) |
|
837 { |
|
838 TRACE_ENTRY_POINT; |
|
839 TRACE_EXIT_POINT; |
|
840 return iCustomisationManager->Infobar( aRect ); |
|
841 } |
|
842 |
|
843 // ---------------------------------------------------------------------------- |
|
844 // CCalenController::Infobar |
|
845 // Descriptor passed to plugins to get customised info bar text. |
|
846 // Acts as a conduit between the services and the customisation manager. |
|
847 // (other items were commented in a header). |
|
848 // ---------------------------------------------------------------------------- |
|
849 // |
|
850 EXPORT_C const TDesC& CCalenController::Infobar() |
|
851 { |
|
852 TRACE_ENTRY_POINT; |
|
853 TRACE_EXIT_POINT; |
|
854 return iCustomisationManager->Infobar(); |
|
855 } |
|
856 |
|
857 // ---------------------------------------------------------------------------- |
|
858 // CCalenController::PreviewPane |
|
859 // Descriptor passed to plugins to get customised preview pane text. |
|
860 // Acts as a conduit between the services and the customisation manager. |
|
861 // (other items were commented in a header). |
|
862 // ---------------------------------------------------------------------------- |
|
863 // |
|
864 EXPORT_C CCoeControl* CCalenController::PreviewPane( TRect& aRect ) |
|
865 { |
|
866 TRACE_ENTRY_POINT; |
|
867 TRACE_EXIT_POINT; |
|
868 return iCustomisationManager->PreviewPane( aRect ); |
|
869 } |
|
870 |
|
871 // ---------------------------------------------------------------------------- |
|
872 // CCalenController::CustomPreviewPaneL |
|
873 // Return custom preview pane |
|
874 // (other items were commented in a header). |
|
875 // ---------------------------------------------------------------------------- |
|
876 // |
|
877 EXPORT_C MCalenPreview* CCalenController::CustomPreviewPaneL( TRect& aRect ) |
|
878 { |
|
879 TRACE_ENTRY_POINT; |
|
880 TRACE_EXIT_POINT; |
|
881 return iCustomisationManager->CustomPreviewPaneL(aRect); |
|
882 } |
|
883 |
|
884 // ---------------------------------------------------------------------------- |
|
885 // CCalenController::CustomisationManager |
|
886 // Returns a reference to the customisation manager |
|
887 // (other items were commented in a header). |
|
888 // ---------------------------------------------------------------------------- |
|
889 // |
|
890 CCalenCustomisationManager& CCalenController::CustomisationManager() |
|
891 { |
|
892 TRACE_ENTRY_POINT; |
|
893 TRACE_EXIT_POINT; |
|
894 return *iCustomisationManager; |
|
895 } |
|
896 |
|
897 // ---------------------------------------------------------------------------- |
|
898 // CCalenController::ViewManager |
|
899 // Returns a reference to the view manager |
|
900 // (other items were commented in a header). |
|
901 // ---------------------------------------------------------------------------- |
|
902 CCalenViewManager& CCalenController::ViewManager() |
|
903 { |
|
904 TRACE_ENTRY_POINT; |
|
905 TRACE_EXIT_POINT; |
|
906 return *iViewManager; |
|
907 } |
|
908 |
|
909 // ---------------------------------------------------------------------------- |
|
910 // CCalenController::MissedAlarmStore |
|
911 // Returns a reference to the Missed Alarm Store |
|
912 // ---------------------------------------------------------------------------- |
|
913 CMissedAlarmStore* CCalenController::MissedAlarmStore() |
|
914 { |
|
915 TRACE_ENTRY_POINT; |
|
916 TRACE_EXIT_POINT; |
|
917 |
|
918 return iAlarmManager->MissedAlarmStore(); |
|
919 } |
|
920 |
|
921 // ---------------------------------------------------------------------------- |
|
922 // CCalenController::IsFasterAppFlagEnabled |
|
923 // Returns ETrue if the application is fake exited |
|
924 // else return EFalse. |
|
925 // (other items were commented in a header). |
|
926 // ---------------------------------------------------------------------------- |
|
927 TBool CCalenController::IsFasterAppFlagEnabled() |
|
928 { |
|
929 TRACE_ENTRY_POINT; |
|
930 TRACE_EXIT_POINT; |
|
931 return iFasterApp; |
|
932 } |
|
933 |
|
934 // ---------------------------------------------------------------------------- |
|
935 // CCalenController::SetFasterAppFlag |
|
936 // Set the flag 'iFasterApp' to ETrue if application is fake exited |
|
937 // and to EFalse once the application comes to foreground. |
|
938 // (other items were commented in a header). |
|
939 // ---------------------------------------------------------------------------- |
|
940 void CCalenController::SetFasterAppFlag( TBool aFlag ) |
|
941 { |
|
942 TRACE_ENTRY_POINT; |
|
943 TRACE_EXIT_POINT; |
|
944 iFasterApp = aFlag; |
|
945 } |
|
946 |
|
947 // ---------------------------------------------------------------------------- |
|
948 // CCalenController::AppUi |
|
949 // Returns a reference to the appui |
|
950 // (other items were commented in a header). |
|
951 // ---------------------------------------------------------------------------- |
|
952 // |
|
953 CAknViewAppUi& CCalenController::AppUi() |
|
954 { |
|
955 TRACE_ENTRY_POINT; |
|
956 TRACE_EXIT_POINT; |
|
957 return iAppUi; |
|
958 } |
|
959 |
|
960 // ---------------------------------------------------------------------------- |
|
961 // CCalenController::GetMissedAlarmsList |
|
962 // Returns the missed alarms list |
|
963 // ---------------------------------------------------------------------------- |
|
964 void CCalenController::GetMissedAlarmsList(RArray<TCalenInstanceId>& aMissedAlarmsList) |
|
965 { |
|
966 TRACE_ENTRY_POINT; |
|
967 iAlarmManager->GetMissedAlarmsList(aMissedAlarmsList); |
|
968 TRACE_EXIT_POINT; |
|
969 } |
|
970 |
|
971 // ---------------------------------------------------------------------------- |
|
972 // CCalenController::Settings |
|
973 // Returns a reference to the calendar settings |
|
974 // ---------------------------------------------------------------------------- |
|
975 CCalenSetting& CCalenController::Settings() |
|
976 { |
|
977 TRACE_ENTRY_POINT; |
|
978 TRACE_EXIT_POINT; |
|
979 return *iSetting; |
|
980 } |
|
981 |
|
982 // ---------------------------------------------------------------------------- |
|
983 // CCalenController::GetIconL |
|
984 // Get icon of specific type |
|
985 // ---------------------------------------------------------------------------- |
|
986 // |
|
987 CGulIcon* CCalenController::GetIconL( MCalenServices::TCalenIcons aIndex, const TInt aViewId ) |
|
988 { |
|
989 TRACE_ENTRY_POINT; |
|
990 |
|
991 // if view requests next view icon |
|
992 if(aIndex == MCalenServices::ECalenNextViewIcon) |
|
993 { |
|
994 return (iViewManager->GetNextViewIconL()); |
|
995 } |
|
996 |
|
997 TRACE_EXIT_POINT; |
|
998 return iViewManager->IconsL().GetIconL(aIndex,aViewId); |
|
999 } |
|
1000 |
|
1001 // ---------------------------------------------------------------------------- |
|
1002 // CCalenController::MultipleDbManager |
|
1003 // Returns a reference to the CCalenMultipleDbManager |
|
1004 // (other items were commented in a header). |
|
1005 // ---------------------------------------------------------------------------- |
|
1006 // |
|
1007 CCalenMultipleDbManager& CCalenController::MultipleDbManager() |
|
1008 { |
|
1009 TRACE_ENTRY_POINT |
|
1010 CCalenMultipleDbManager* tmp = NULL; |
|
1011 TRACE_EXIT_POINT |
|
1012 return *tmp; |
|
1013 } |
|
1014 |
|
1015 // ---------------------------------------------------------------------------- |
|
1016 // CCalenController::StateMachine |
|
1017 // Returns a reference to the CCalenStateMachine |
|
1018 // (other items were commented in a header). |
|
1019 // ---------------------------------------------------------------------------- |
|
1020 // |
|
1021 CCalenStateMachine& CCalenController::StateMachine() |
|
1022 { |
|
1023 TRACE_ENTRY_POINT |
|
1024 TRACE_EXIT_POINT |
|
1025 return *iStateMachine; |
|
1026 } |
|
1027 |
|
1028 |
|
1029 // ----------------------------------------------------------------------------- |
|
1030 // CCalenController::GetActiveCollectionidsL |
|
1031 // ----------------------------------------------------------------------------- |
|
1032 // |
|
1033 void CCalenController::GetActiveCollectionidsL( |
|
1034 RArray<TInt>& aCollectionIds) |
|
1035 { |
|
1036 TRACE_ENTRY_POINT |
|
1037 RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
1038 CleanupClosePushL(calendarInfoList); |
|
1039 iGlobalData->GetAllCalendarInfoL(calendarInfoList); |
|
1040 |
|
1041 for(TInt index=0;index<calendarInfoList.Count();index++) |
|
1042 { |
|
1043 if(calendarInfoList[index]->Enabled()) |
|
1044 { |
|
1045 HBufC* calendarFileName = |
|
1046 calendarInfoList[index]->FileNameL().AllocLC(); |
|
1047 aCollectionIds.Append( |
|
1048 iGlobalData->CalSessionL(*calendarFileName).CollectionIdL()); |
|
1049 CleanupStack::PopAndDestroy(calendarFileName); |
|
1050 } |
|
1051 } |
|
1052 |
|
1053 CleanupStack::PopAndDestroy(&calendarInfoList); |
|
1054 TRACE_EXIT_POINT |
|
1055 } |
|
1056 |
|
1057 // ----------------------------------------------------------------------------- |
|
1058 // CCalenController::AttachmentData |
|
1059 // Returns a reference to the CCalenAttachmentModel |
|
1060 // ---------------------------------------------------------------------------- |
|
1061 // |
|
1062 CCalenAttachmentModel& CCalenController::AttachmentData() |
|
1063 { |
|
1064 TRACE_ENTRY_POINT; |
|
1065 TRACE_EXIT_POINT; |
|
1066 return *iAttachmentData; |
|
1067 } |
|
1068 |
|
1069 // ----------------------------------------------------------------------------- |
|
1070 // CCalenController::IsEditorActive |
|
1071 // Tells framework whether editor is active or not |
|
1072 // ----------------------------------------------------------------------------- |
|
1073 // |
|
1074 TBool CCalenController::IsEditorActive() |
|
1075 { |
|
1076 return (iActionUi->IsEditorActive()); |
|
1077 } |
|
1078 |
|
1079 // ----------------------------------------------------------------------------- |
|
1080 // CCalenController::AddCalendarL |
|
1081 // Adds a new calendar file with metadata set |
|
1082 // ----------------------------------------------------------------------------- |
|
1083 // |
|
1084 void CCalenController::AddCalendarL(CCalCalendarInfo* aCalendarInfo) |
|
1085 { |
|
1086 TRACE_ENTRY_POINT; |
|
1087 iGlobalData->AddCalendarL(aCalendarInfo); |
|
1088 TRACE_EXIT_POINT; |
|
1089 } |
|
1090 |
|
1091 // ----------------------------------------------------------------------------- |
|
1092 // CCalenController::UpdateCalendarL |
|
1093 // Updates calendar file with new calendar info |
|
1094 // ----------------------------------------------------------------------------- |
|
1095 // |
|
1096 void CCalenController::UpdateCalendarL(CCalCalendarInfo* aCalendarInfo) |
|
1097 { |
|
1098 TRACE_ENTRY_POINT; |
|
1099 iGlobalData->UpdateCalendarL(aCalendarInfo); |
|
1100 TRACE_EXIT_POINT; |
|
1101 } |
|
1102 |
|
1103 // ----------------------------------------------------------------------------- |
|
1104 // CCalenController::RemoveCalendarL |
|
1105 // Removes calendar file based on calendar file name |
|
1106 // ----------------------------------------------------------------------------- |
|
1107 // |
|
1108 void CCalenController::RemoveCalendarL(const TDesC& aCalendarFileName) |
|
1109 { |
|
1110 TRACE_ENTRY_POINT; |
|
1111 iGlobalData->RemoveCalendarL(aCalendarFileName); |
|
1112 TRACE_EXIT_POINT; |
|
1113 } |
|
1114 |
|
1115 // ----------------------------------------------------------------------------- |
|
1116 // CCalenController::RemoveCalendarL |
|
1117 // Removes all dead calendar files from the file system |
|
1118 // ----------------------------------------------------------------------------- |
|
1119 // |
|
1120 void CCalenController::RemoveDeadCalendarsL() |
|
1121 { |
|
1122 TRACE_ENTRY_POINT; |
|
1123 iGlobalData->RemoveDeadCalendarsL(); |
|
1124 TRACE_EXIT_POINT; |
|
1125 } |
|
1126 // ----------------------------------------------------------------------------- |
|
1127 // CCalenController::GetAllCalendarInfoL |
|
1128 // Get all available calendar info |
|
1129 // ----------------------------------------------------------------------------- |
|
1130 // |
|
1131 void CCalenController::GetAllCalendarInfoL( |
|
1132 RPointerArray<CCalCalendarInfo>& aCalendarInfoList) |
|
1133 { |
|
1134 TRACE_ENTRY_POINT; |
|
1135 iGlobalData->GetAllCalendarInfoL(aCalendarInfoList); |
|
1136 TRACE_EXIT_POINT; |
|
1137 } |
|
1138 |
|
1139 // ----------------------------------------------------------------------------- |
|
1140 // CCalenController::SetLaunchFromExternalApp |
|
1141 // |
|
1142 // (other items were commented in a header). |
|
1143 // ----------------------------------------------------------------------------- |
|
1144 // |
|
1145 void CCalenController::SetLaunchFromExternalApp( TBool aFlag ) |
|
1146 { |
|
1147 TRACE_ENTRY_POINT; |
|
1148 |
|
1149 iLaunchFromExternalApp = aFlag; |
|
1150 TRACE_EXIT_POINT; |
|
1151 } |
|
1152 |
|
1153 // ----------------------------------------------------------------------------- |
|
1154 // CCalenController::SetLaunchFromExternalApp |
|
1155 // |
|
1156 // (other items were commented in a header). |
|
1157 // ----------------------------------------------------------------------------- |
|
1158 // |
|
1159 TBool CCalenController::IsLaunchFromExternalApp() |
|
1160 { |
|
1161 TRACE_ENTRY_POINT; |
|
1162 TRACE_EXIT_POINT; |
|
1163 |
|
1164 return iLaunchFromExternalApp; |
|
1165 } |
|
1166 // End of file |
|
1167 |
|