author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:17:03 +0300 | |
branch | RCL_3 |
changeset 31 | 97232defd20e |
parent 30 | bd7edf625bdd |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
30 | 2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: This class is the base class of all Calendar views. |
30 | 15 |
* |
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <calenconstants.h> |
|
21 |
#include <calenagendautils.h> |
|
22 |
#include <calendateutils.h> |
|
23 |
#include <calentoolbar.h> |
|
24 |
#include <Calendar.rsg> |
|
25 |
#include <CalenStatusPaneUtils.h> |
|
26 |
#include <calencontext.h> |
|
27 |
#include <caltime.h> |
|
28 |
#include <calinstance.h> |
|
29 |
#include <calinstanceview.h> |
|
30 |
#include <calentry.h> |
|
31 |
#include <aknlists.h> |
|
32 |
#include <aknnavide.h> |
|
33 |
#include <aknnotewrappers.h> |
|
34 |
#include <AknWaitDialog.h> |
|
35 |
#include <eikbtgpc.h> |
|
36 |
#include <centralrepository.h> |
|
37 |
#include <StringLoader.h> |
|
38 |
#include <sysutil.h> |
|
39 |
#include <hlplch.h> |
|
40 |
#include <akntoolbar.h> |
|
41 |
#include <calencommands.hrh> |
|
42 |
#include <calenservices.h> |
|
43 |
#include <calsession.h> |
|
44 |
#include <calenviewutils.h> |
|
45 |
#include <calcalendarinfo.h> |
|
46 |
#include <caleninstanceid.h> // TCalenInstanceId |
|
47 |
||
48 |
||
49 |
#include "calendarui_debug.h" // Debug. |
|
50 |
#include "CalendarVariant.hrh" |
|
51 |
#include "calennativeview.h" |
|
52 |
#include "calencontainer.h" |
|
53 |
#include "CalenInterimUtils2.h" |
|
54 |
#include "calensend.h" |
|
55 |
#include "calentitlepane.h" |
|
56 |
#include "CleanupResetAndDestroy.h" |
|
57 |
#include "CalenPaths.h" |
|
58 |
#include "calendar.hrh" |
|
59 |
#include "CalenUid.h" |
|
60 |
#include "CalendarPrivateCRKeys.h" |
|
61 |
#include "multicaluidialog.h" |
|
62 |
||
63 |
const TInt KAbbreviatedWeekNames[] = |
|
64 |
{ |
|
65 |
R_QTN_WEEK_TWO_CHARS_MO, |
|
66 |
R_QTN_WEEK_TWO_CHARS_TU, |
|
67 |
R_QTN_WEEK_TWO_CHARS_WE, |
|
68 |
R_QTN_WEEK_TWO_CHARS_TH, |
|
69 |
R_QTN_WEEK_TWO_CHARS_FR, |
|
70 |
R_QTN_WEEK_TWO_CHARS_SA, |
|
71 |
R_QTN_WEEK_TWO_CHARS_SU |
|
72 |
}; |
|
73 |
||
74 |
||
75 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
76 |
#include <aiwservicehandler.h> |
|
77 |
||
78 |
// MIME types |
|
79 |
_LIT8(KContentTypeCalendar, "text/calendar"); |
|
80 |
||
81 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
82 |
||
83 |
||
84 |
#include <aknnavilabel.h> |
|
85 |
#include <calennavilabel.h> |
|
86 |
||
87 |
||
88 |
// ================= MEMBER FUNCTIONS ======================= |
|
89 |
||
90 |
// ---------------------------------------------------------------------------- |
|
91 |
// CCalenNativeView::~CCalenNativeView |
|
92 |
// Destructor |
|
93 |
// (other items were commented in a header). |
|
94 |
// ---------------------------------------------------------------------------- |
|
95 |
// |
|
96 |
CCalenNativeView::~CCalenNativeView() |
|
97 |
{ |
|
98 |
TRACE_ENTRY_POINT; |
|
99 |
||
100 |
CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); |
|
101 |
appui->RemoveFromStack( iContainer ); |
|
102 |
||
103 |
delete iContainer; |
|
104 |
||
105 |
iServices.CancelNotifications( this ); |
|
106 |
||
107 |
delete iAbbreviatedDayArray; |
|
108 |
||
109 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
110 |
//delete AIW iServiceHandler; |
|
111 |
ReleaseServiceHandler(); |
|
112 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
113 |
||
114 |
delete iMenuName; |
|
115 |
delete iSettingsName; |
|
116 |
||
117 |
delete iSPUtils; |
|
118 |
||
119 |
if( iAsyncCallback ) |
|
120 |
{ |
|
121 |
iAsyncCallback->Cancel(); |
|
122 |
delete iAsyncCallback; |
|
123 |
iAsyncCallback = NULL; |
|
124 |
} |
|
125 |
||
126 |
TRACE_EXIT_POINT; |
|
127 |
} |
|
128 |
||
129 |
// ---------------------------------------------------------------------------- |
|
130 |
// CCalenNativeView::SetStatusPaneFromActiveContextL( |
|
131 |
// This function sets the status pane based upon the context |
|
132 |
// (other items were commented in a header). |
|
133 |
// ---------------------------------------------------------------------------- |
|
134 |
// |
|
135 |
void CCalenNativeView::SetStatusPaneFromActiveContextL() |
|
136 |
{ |
|
137 |
TRACE_ENTRY_POINT; |
|
138 |
iSPUtils->RefreshStatusPane(); |
|
139 |
TRACE_EXIT_POINT; |
|
140 |
} |
|
141 |
||
142 |
// ---------------------------------------------------------------------------- |
|
143 |
// CCalenNativeView::Container |
|
144 |
// Return container control pointer. |
|
145 |
// (other items were commented in a header). |
|
146 |
// ---------------------------------------------------------------------------- |
|
147 |
// |
|
148 |
CCalenContainer* CCalenNativeView::Container() |
|
149 |
{ |
|
150 |
TRACE_ENTRY_POINT; |
|
151 |
||
152 |
TRACE_EXIT_POINT; |
|
153 |
return iContainer; |
|
154 |
} |
|
155 |
||
156 |
// ---------------------------------------------------------------------------- |
|
157 |
// CCalenNativeView::OnCmdGotoDateL |
|
158 |
// Handling command "Go to day" |
|
159 |
// (other items were commented in a header). |
|
160 |
// ---------------------------------------------------------------------------- |
|
161 |
// |
|
162 |
void CCalenNativeView::OnCmdGotoDateL() |
|
163 |
{ |
|
164 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
|
30 | 166 |
TTime date = CalenDateUtils::Today(); |
167 |
||
168 |
TInt buttonId = CalenViewUtils::DateQueryL( date, 0 ); |
|
169 |
||
170 |
//test |
|
171 |
TDateTime dateTime = date.DateTime(); |
|
172 |
||
173 |
if (buttonId == EAknSoftkeyOk || buttonId == EEikBidOk) |
|
174 |
{ |
|
175 |
MCalenContext& context = iServices.Context(); |
|
176 |
TCalTime dateCalTime; |
|
177 |
dateCalTime.SetTimeLocalL( date ); |
|
178 |
context.SetFocusDateAndTimeL( dateCalTime, context.ViewId() ); |
|
179 |
iContainer->NotifyChangeDateL(); |
|
180 |
} |
|
181 |
||
182 |
TRACE_EXIT_POINT; |
|
183 |
} |
|
184 |
||
185 |
// ---------------------------------------------------------------------------- |
|
186 |
// CCalenNativeView::OnCmdGotoTodayL |
|
187 |
// Handling command "Today". # key is pressed. |
|
188 |
// (other items were commented in a header). |
|
189 |
// ---------------------------------------------------------------------------- |
|
190 |
// |
|
191 |
void CCalenNativeView::OnCmdGotoTodayL() |
|
192 |
{ |
|
193 |
TRACE_ENTRY_POINT; |
|
194 |
||
195 |
TTime today = CalenDateUtils::Today(); |
|
196 |
||
197 |
MCalenContext& context = iServices.Context(); |
|
198 |
TCalTime todayCalTime; |
|
199 |
todayCalTime.SetTimeLocalL( today ); |
|
200 |
context.SetFocusDateAndTimeL( todayCalTime, context.ViewId() ); |
|
201 |
||
202 |
iContainer->NotifyChangeDateL(); |
|
203 |
||
204 |
TRACE_EXIT_POINT; |
|
205 |
} |
|
206 |
||
207 |
// ---------------------------------------------------------------------------- |
|
208 |
// CCalenNativeView::NotifyFocusChanged |
|
209 |
// Notified that the focus of Container changes. |
|
210 |
// (other items were commented in a header). |
|
211 |
// ---------------------------------------------------------------------------- |
|
212 |
// |
|
213 |
void CCalenNativeView::NotifyFocusChanged() |
|
214 |
{ |
|
215 |
TRACE_ENTRY_POINT; |
|
216 |
||
217 |
// FIXME: iLocChangeReason doesn't seem to serve any purpose. |
|
218 |
// Debug how it is used. |
|
219 |
if (iContainer && iNeedsRefresh) |
|
220 |
{ |
|
221 |
if (IsForeground() && IsContainerFocused()) |
|
222 |
{ |
|
223 |
//The database was changed while calendar was running as a |
|
224 |
//background task or the editor was open. We need to refresh. |
|
225 |
TRAP_IGNORE(BeginRepopulationL()); |
|
226 |
iNeedsRefresh = EFalse; |
|
227 |
} |
|
228 |
} |
|
229 |
if (iLocChangeReason && IsContainerFocused()) |
|
230 |
{ |
|
231 |
PIM_TRAPD_HANDLE( OnLocaleChangedL( iLocChangeReason ) ); |
|
232 |
} |
|
233 |
iLocChangeReason = 0; |
|
234 |
||
235 |
TRACE_EXIT_POINT; |
|
236 |
} |
|
237 |
||
238 |
// ---------------------------------------------------------------------------- |
|
239 |
// CCalenNativeView::IsContainerFocused |
|
240 |
// Is container focused? |
|
241 |
// (other items were commented in a header). |
|
242 |
// ---------------------------------------------------------------------------- |
|
243 |
// |
|
244 |
TBool CCalenNativeView::IsContainerFocused() |
|
245 |
{ |
|
246 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
|
30 | 248 |
TRACE_EXIT_POINT; |
249 |
return (iContainer && iContainer->IsVisible()); |
|
250 |
} |
|
251 |
||
252 |
// ---------------------------------------------------------------------------- |
|
253 |
// CCalenNativeView::ShowValidScrollButtons |
|
254 |
// (other items were commented in a header). |
|
255 |
// ---------------------------------------------------------------------------- |
|
256 |
// |
|
257 |
void CCalenNativeView::ShowValidScrollButtons(CAknNavigationDecorator& aNaviLabel, |
|
258 |
const TTime& aBeforeRange, |
|
259 |
const TTime& aAfterRange) |
|
260 |
{ |
|
261 |
TRACE_ENTRY_POINT; |
|
262 |
||
263 |
aNaviLabel.MakeScrollButtonVisible(ETrue); |
|
264 |
||
265 |
// FIXME can be written more simply. |
|
266 |
TBool mirrored(AknLayoutUtils::LayoutMirrored()); |
|
267 |
if (mirrored) |
|
268 |
{ |
|
269 |
TBool validDay(CalenDateUtils::IsValidDay(aBeforeRange)); |
|
270 |
aNaviLabel.SetScrollButtonDimmed( |
|
271 |
CAknNavigationDecorator::ERightButton, !validDay); |
|
272 |
validDay = CalenDateUtils::IsValidDay(TTime(aAfterRange)); |
|
273 |
aNaviLabel.SetScrollButtonDimmed( |
|
274 |
CAknNavigationDecorator::ELeftButton, !validDay); |
|
275 |
} |
|
276 |
else |
|
277 |
{ |
|
278 |
TBool validDay(CalenDateUtils::IsValidDay(aBeforeRange)); |
|
279 |
aNaviLabel.SetScrollButtonDimmed( |
|
280 |
CAknNavigationDecorator::ELeftButton, !validDay); |
|
281 |
validDay = CalenDateUtils::IsValidDay(aAfterRange); |
|
282 |
aNaviLabel.SetScrollButtonDimmed( |
|
283 |
CAknNavigationDecorator::ERightButton, !validDay); |
|
284 |
} |
|
285 |
||
286 |
||
287 |
if(iContainer && AknLayoutUtils::PenEnabled()) |
|
288 |
{ |
|
289 |
aNaviLabel.SetNaviDecoratorObserver(static_cast<MAknNaviDecoratorObserver*>(iContainer)); |
|
290 |
CCoeControl* coeRes = aNaviLabel.DecoratedControl(); |
|
291 |
CCalenNaviLabel *actualLabel = static_cast<CCalenNaviLabel*>(coeRes); |
|
292 |
actualLabel->SetLabelObserver(static_cast<MCCalenNaviLabelObserver*>(iContainer)); |
|
293 |
} |
|
294 |
||
295 |
||
296 |
TRACE_EXIT_POINT; |
|
297 |
} |
|
298 |
||
299 |
// ---------------------------------------------------------------------------- |
|
300 |
// CCalenNativeView::DynInitMenuPaneL |
|
301 |
// Initialization of Options menu |
|
302 |
// (other items were commented in a header). |
|
303 |
// ---------------------------------------------------------------------------- |
|
304 |
// |
|
305 |
void CCalenNativeView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
|
306 |
{ |
|
307 |
TRACE_ENTRY_POINT; |
|
308 |
||
309 |
switch (aResourceId) |
|
310 |
{ |
|
311 |
case R_CALENDAR_NOTETYPE_MENUPANE: |
|
312 |
{ |
|
313 |
if( !iServices.InterimUtilsL().MRViewersEnabledL( ETrue ) ) |
|
314 |
{ |
|
315 |
aMenuPane->DeleteMenuItem( ECalenNewMeetingRequest ); |
|
316 |
} |
|
317 |
break; |
|
318 |
} |
|
319 |
case R_CALENDAR_CHANGE_VIEW_MENUPANE: |
|
320 |
{ |
|
321 |
// If we get the cascading view switch menu pane, |
|
322 |
// need to offer it to the services, to remove |
|
323 |
// the current view. |
|
324 |
iServices.OfferMenuPaneL( aResourceId, aMenuPane ); |
|
325 |
} |
|
326 |
break; |
|
327 |
default: |
|
328 |
{ |
|
329 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
330 |
// do we have a service handler, if not create one |
|
331 |
if (!iServiceHandler) |
|
332 |
{ |
|
333 |
CreateServiceHandlerL(ETrue); |
|
334 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
335 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
336 |
|
30 | 337 |
if (iServiceHandler->HandleSubmenuL(*aMenuPane)) |
338 |
{ |
|
339 |
return; |
|
340 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
|
30 | 342 |
// is the menu item AIW menu item if so, we will initialize our menu item |
343 |
if (iServiceHandler->IsAiwMenu(aResourceId)) |
|
344 |
{ |
|
345 |
CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); |
|
346 |
TInt extrainfo=0; |
|
347 |
TAiwVariant variant(extrainfo); |
|
348 |
// No generic param for integer, therefore use EGenericParamError. |
|
349 |
TAiwGenericParam param(EGenericParamError, variant); |
|
350 |
inParamList.AppendL(param); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
351 |
|
30 | 352 |
iServiceHandler->InitializeMenuPaneL( |
353 |
*aMenuPane, |
|
354 |
aResourceId, |
|
355 |
ECalenExtAiwCommandId, |
|
356 |
inParamList); |
|
357 |
} |
|
358 |
#endif |
|
359 |
break; |
|
360 |
} |
|
361 |
} |
|
362 |
TRACE_EXIT_POINT; |
|
363 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
|
30 | 365 |
// ---------------------------------------------------------------------------- |
366 |
// CCalenNativeView::HandleCommandL |
|
367 |
// Command handling for each view |
|
368 |
// (other items were commented in a header). |
|
369 |
// ---------------------------------------------------------------------------- |
|
370 |
// |
|
371 |
void CCalenNativeView::HandleCommandL(TInt aCommand) |
|
372 |
{ |
|
373 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
374 |
|
30 | 375 |
switch (aCommand) |
376 |
{ |
|
377 |
case EAknCmdHelp: |
|
378 |
HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), iAvkonAppUi->AppHelpContextL() ); |
|
379 |
break; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
380 |
|
30 | 381 |
// Context should be 8am on current focused day for these actions. |
382 |
case ECalenNewMeeting: |
|
383 |
case ECalenNewMeetingRequest: |
|
384 |
case ECalenNewAnniv: |
|
385 |
case ECalenNewDayNote: |
|
386 |
case ECalenNewTodo: |
|
387 |
{ |
|
388 |
iIsEditorActive = ETrue; |
|
389 |
MCalenContext& context = iServices.Context(); |
|
390 |
// Set the date on the context. It will set it to be the |
|
391 |
// default of view (8am) on that day as we don't set the time. |
|
392 |
TCalTime time; |
|
393 |
time.SetTimeLocalL( CCalenContainer::DateFromContextL( context ) ); |
|
394 |
context.SetFocusDateL( time, |
|
395 |
TVwsViewId( KUidCalendar, Id() ) ); |
|
396 |
iServices.IssueCommandL( aCommand ); |
|
397 |
} |
|
398 |
break; |
|
399 |
case ECalenShowSettings: |
|
400 |
{ |
|
401 |
iIsEditorActive = ETrue; |
|
402 |
iServices.IssueCommandL( aCommand ); |
|
403 |
} |
|
404 |
break; |
|
405 |
case ECalenMonthView: |
|
406 |
case ECalenWeekView: |
|
407 |
case ECalenDayView: |
|
408 |
case ECalenTodoView: |
|
409 |
{ |
|
410 |
MCalenContext& context = iServices.Context(); |
|
411 |
// Set the date on the context. It will set it to be the |
|
412 |
// default of view (8am) on that day as we don't set the time. |
|
413 |
TCalTime time; |
|
414 |
time.SetTimeLocalL( CCalenContainer::DateFromContextL( context ) ); |
|
415 |
context.SetFocusDateL( time, |
|
416 |
TVwsViewId( KUidCalendar, Id() ) ); |
|
417 |
iServices.IssueCommandL( aCommand ); |
|
418 |
} |
|
419 |
break; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
|
30 | 421 |
// The context should remain the same for these actions. |
422 |
case ECalenForwardsToDayView: |
|
423 |
case ECalenNextView: |
|
424 |
case ECalenPrevView: |
|
425 |
case ECalenViewCurrentEntry: |
|
426 |
case ECalenEditCurrentEntry: |
|
427 |
case ECalenCompleteTodo: |
|
428 |
case ECalenRestoreTodo: |
|
429 |
case ECalenDeleteAllEntries: |
|
430 |
case ECalenDeleteCurrentEntry: |
|
431 |
case ECalenDeleteEntriesBeforeDate: |
|
432 |
//case ECalenGlobalSendAsCmdId: |
|
433 |
||
434 |
||
435 |
SetCommandHandlingInProgress( ETrue ); |
|
436 |
iServices.IssueCommandL( aCommand ); |
|
437 |
break; |
|
438 |
||
439 |
case ECalenEventView: |
|
440 |
case ECalenSwitchView: |
|
441 |
case ECalenSend: |
|
442 |
iServices.IssueCommandL( aCommand ); |
|
443 |
break; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
|
30 | 445 |
case ECalenGotoDate: |
446 |
OnCmdGotoDateL(); |
|
447 |
break; |
|
448 |
||
449 |
case ECalenGotoToday: |
|
450 |
OnCmdGotoTodayL(); |
|
451 |
break; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
|
30 | 453 |
default: |
454 |
{ |
|
455 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
456 |
// by default we will check also AIW commands |
|
457 |
if (!iServiceHandler) |
|
458 |
{ |
|
459 |
CreateServiceHandlerL(ETrue); |
|
460 |
} |
|
461 |
||
462 |
||
463 |
TInt aiwCmd = iServiceHandler->ServiceCmdByMenuCmd(aCommand); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
|
30 | 465 |
// if we have right one, handle it |
466 |
if(aiwCmd) |
|
467 |
{ |
|
468 |
// add current focused date to param list |
|
469 |
MCalenContext& context = iServices.Context(); |
|
470 |
TTime time = context.FocusTime().TimeLocalL(); |
|
471 |
||
472 |
CAiwGenericParamList& inparams=iServiceHandler->InParamListL(); |
|
473 |
TAiwGenericParam date(EGenericParamDateTime); |
|
474 |
date.Value().Set(time); |
|
475 |
inparams.AppendL(date); |
|
476 |
||
477 |
// Execute AIW menu service command. |
|
478 |
PIM_TRAPD_HANDLE( |
|
479 |
iServiceHandler->ExecuteMenuCmdL( |
|
480 |
aCommand, // The service command |
|
481 |
inparams, // pass our date |
|
482 |
iServiceHandler->OutParamListL(), // No output parameters needed |
|
483 |
KAiwOptASyncronous, // we are using async version |
|
484 |
this )); // and we want to call us back |
|
485 |
} |
|
486 |
// if not then let ui framwork handle it |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
|
30 | 488 |
else |
489 |
{ |
|
490 |
#endif |
|
491 |
iServices.IssueCommandL( aCommand ); |
|
492 |
||
493 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
494 |
} |
|
495 |
#endif // RD_CALEN_EXTERNAL_CAL |
|
496 |
||
497 |
break; |
|
498 |
||
499 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
|
30 | 501 |
} |
502 |
||
503 |
TRACE_EXIT_POINT; |
|
504 |
} |
|
505 |
||
506 |
// ---------------------------------------------------------------------------- |
|
507 |
// CCalenNativeView::DynInitMenuBarL |
|
508 |
// other details are commented in the header |
|
509 |
// ---------------------------------------------------------------------------- |
|
510 |
// |
|
511 |
void CCalenNativeView::DynInitMenuBarL( TInt /*aResourceId*/, CEikMenuBar* aMenuBar ) |
|
512 |
{ |
|
513 |
TRACE_ENTRY_POINT; |
|
29
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
514 |
|
30 | 515 |
if( aMenuBar && IsCommandHandlingInProgress() ) |
516 |
{ |
|
517 |
aMenuBar->StopDisplayingMenuBar(); |
|
518 |
} |
|
29
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
519 |
|
30 | 520 |
TRACE_EXIT_POINT; |
521 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
522 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
523 |
// ---------------------------------------------------------------------------- |
30 | 524 |
// CCalenNativeView::CopytoCalendarsL |
525 |
// From CAknView |
|
526 |
// Return the UID of the day view |
|
527 |
// (other items were commented in a header) |
|
528 |
// ---------------------------------------------------------------------------- |
|
529 |
// |
|
530 |
void CCalenNativeView::CopyToCalendarsL() |
|
531 |
{ |
|
532 |
TRACE_ENTRY_POINT; |
|
533 |
||
534 |
iAsyncCallback->CallBack(); |
|
535 |
||
536 |
TRACE_EXIT_POINT; |
|
537 |
} |
|
538 |
||
539 |
// ---------------------------------------------------------------------------- |
|
540 |
// CCalenNativeView::AsyncCopyToCalendarsL |
|
541 |
// From CAknView |
|
542 |
// Return the UID of the day view |
|
543 |
// (other items were commented in a header) |
|
11
0f07cd1b5772
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
544 |
// ---------------------------------------------------------------------------- |
30 | 545 |
// |
546 |
TInt CCalenNativeView::AsyncCopyToCalendarsL( TAny* aThisPtr ) |
|
11
0f07cd1b5772
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
547 |
{ |
30 | 548 |
TRACE_ENTRY_POINT; |
549 |
||
550 |
static_cast<CCalenNativeView*>(aThisPtr)->CopyEntryToCalendarsL(); |
|
551 |
||
552 |
TRACE_EXIT_POINT; |
|
553 |
return 0; |
|
554 |
||
555 |
} |
|
556 |
||
557 |
// ---------------------------------------------------------------------------- |
|
558 |
// CCalenNativeView::CopyEntryToCalendarsL |
|
559 |
// From CAknView |
|
560 |
// Return the UID of the day view |
|
561 |
// (other items were commented in a header) |
|
562 |
// ---------------------------------------------------------------------------- |
|
563 |
// |
|
564 |
void CCalenNativeView::CopyEntryToCalendarsL() |
|
565 |
{ |
|
566 |
TRACE_ENTRY_POINT; |
|
11
0f07cd1b5772
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
567 |
|
30 | 568 |
// Create settings own titlepane and navipane, and swap with existing ones |
569 |
CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
570 |
||
571 |
// Hide the toolbar before we display settings menu |
|
572 |
MCalenToolbar* toolbar = iServices.ToolbarOrNull(); |
|
573 |
if(toolbar) |
|
574 |
{ |
|
575 |
toolbar->SetToolbarVisibilityL(EFalse); |
|
576 |
} |
|
577 |
iSPUtils->UnderLineTitleText( EFalse ); |
|
578 |
||
579 |
// Titlepane |
|
580 |
CAknTitlePane* newtp = new( ELeave ) CAknTitlePane(); |
|
581 |
CleanupStack::PushL( newtp ); |
|
582 |
CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp ); |
|
583 |
CleanupStack::Pop( newtp ); // ownership is passed to statuspane |
|
584 |
TRect oldRect( 0, 0, 0, 0 ); |
|
585 |
if( oldtp ) |
|
586 |
{ |
|
587 |
CleanupStack::PushL( oldtp ); |
|
588 |
oldRect = oldtp->Rect(); |
|
589 |
CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle )); |
|
590 |
newtp->SetContainerWindowL( *ctrl ); |
|
591 |
newtp->ConstructL(); |
|
592 |
newtp->SetRect(oldRect); |
|
593 |
newtp->ActivateL(); |
|
594 |
} |
|
595 |
||
596 |
// NaviPane |
|
597 |
CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer(); |
|
598 |
CleanupStack::PushL( newnp ); |
|
599 |
CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp ); |
|
600 |
CleanupStack::Pop( newnp ); // ownership is passed to statuspane |
|
601 |
if( oldnp ) |
|
602 |
{ |
|
603 |
CleanupStack::PushL( oldnp ); |
|
604 |
oldRect = oldnp->Rect(); |
|
605 |
CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
606 |
newnp->SetContainerWindowL( *ctrl ); |
|
607 |
newnp->ConstructL(); |
|
608 |
newnp->SetRect( oldRect ); |
|
609 |
newnp->PushDefaultL(); |
|
610 |
newnp->ActivateL(); |
|
611 |
} |
|
612 |
||
613 |
MCalenContext& context = iServices.Context(); |
|
614 |
TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid; |
|
615 |
||
616 |
CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId); |
|
617 |
CleanupStack::PushL(entry); |
|
618 |
||
619 |
RPointerArray<CCalEntry> calentryArray; |
|
620 |
calentryArray.Append( entry ); |
|
621 |
||
622 |
// Launch the Calendar List Dialiog. |
|
623 |
CMultiCalUiDialog* calenDbListDialog = CMultiCalUiDialog::NewLC(calentryArray, EFalse); |
|
624 |
TInt err = KErrNone; |
|
625 |
// Execute. |
|
626 |
TRAP( err,calenDbListDialog->LaunchL() ); |
|
627 |
CleanupStack::PopAndDestroy( calenDbListDialog ); |
|
628 |
||
629 |
iSPUtils->UnderLineTitleText( EFalse ); |
|
630 |
// Unhide the toolbar when settings is closed |
|
631 |
if(toolbar) |
|
632 |
{ |
|
633 |
toolbar->SetToolbarVisibilityL(ETrue); |
|
634 |
} |
|
635 |
||
636 |
CleanupStack::Pop(entry); |
|
637 |
calentryArray.ResetAndDestroy(); |
|
638 |
||
639 |
// When setting is closed, swap back old titlepane and navipane |
|
640 |
if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) ) |
|
641 |
{ |
|
642 |
CleanupStack::Pop( oldnp ); |
|
643 |
delete newnp; |
|
644 |
oldnp->ActivateL(); |
|
11
0f07cd1b5772
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
645 |
} |
30 | 646 |
|
647 |
if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) ) |
|
648 |
{ |
|
649 |
CleanupStack::Pop( oldtp ); |
|
650 |
delete newtp; |
|
651 |
oldtp->ActivateL(); |
|
652 |
} |
|
653 |
||
654 |
BeginRepopulationL(); |
|
655 |
||
656 |
TRACE_EXIT_POINT; |
|
657 |
||
658 |
} |
|
659 |
||
660 |
// ---------------------------------------------------------------------------- |
|
661 |
// C++ constructor can NOT contain any code, that |
|
662 |
// might leave. |
|
663 |
// ---------------------------------------------------------------------------- |
|
664 |
// |
|
665 |
CCalenNativeView::CCalenNativeView( MCalenServices& aServices ) |
|
666 |
: iServices( aServices ) |
|
667 |
{ |
|
668 |
TRACE_ENTRY_POINT; |
|
669 |
TRACE_EXIT_POINT; |
|
670 |
} |
|
671 |
||
672 |
// ---------------------------------------------------------------------------- |
|
673 |
// CCalenNativeView::ConstructL |
|
674 |
// Symbian OS default constructor |
|
675 |
// (other items were commented in a header). |
|
676 |
// ---------------------------------------------------------------------------- |
|
677 |
// |
|
678 |
void CCalenNativeView::CommonConstructL( TInt aViewResource ) |
|
679 |
{ |
|
680 |
TRACE_ENTRY_POINT; |
|
681 |
||
682 |
BaseConstructL( aViewResource ); |
|
11
0f07cd1b5772
Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
683 |
|
30 | 684 |
// Initialize CCalenStatusPaneUtils |
685 |
CEikStatusPane* sp = StatusPane(); |
|
686 |
iSPUtils = CCalenStatusPaneUtils::NewL( sp ); |
|
687 |
||
688 |
ClearViewSpecificDataL(); // Reset vsd. |
|
689 |
||
690 |
// Create services API and register for notifications |
|
691 |
RArray<TCalenNotification> notificationArray; |
|
692 |
notificationArray.Append(ECalenNotifySystemTimeChanged); |
|
693 |
notificationArray.Append(ECalenNotifyMarkedEntryDeleted); |
|
694 |
notificationArray.Append(ECalenNotifyContextChanged); |
|
695 |
notificationArray.Append(ECalenNotifyDialogClosed); |
|
696 |
notificationArray.Append(ECalenNotifyEntrySent); |
|
697 |
notificationArray.Append(ECalenNotifyEntryClosed); |
|
698 |
notificationArray.Append(ECalenNotifySystemLocaleChanged); |
|
699 |
notificationArray.Append(ECalenNotifyAppForegrounded); |
|
700 |
notificationArray.Append(ECalenNotifyAppBackgrounded); |
|
701 |
notificationArray.Append(ECalenNotifyEntrySaved); |
|
702 |
notificationArray.Append(ECalenNotifyInstanceSaved); |
|
703 |
notificationArray.Append(ECalenNotifySettingsClosed); |
|
704 |
notificationArray.Append(ECalenNotifySettingsChanged); |
|
705 |
notificationArray.Append(ECalenNotifyMarkedEntryCompleted); |
|
706 |
notificationArray.Append(ECalenNotifyDeleteInstanceView); |
|
707 |
notificationArray.Append(ECalenNotifyStopAlarm); |
|
708 |
notificationArray.Append(ECalenNotifyDeleteFailed); |
|
709 |
notificationArray.Append(ECalenNotifyEntryDeleted); |
|
710 |
notificationArray.Append(ECalenNotifyResourceChanged); |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
711 |
notificationArray.Append(ECalenNotifyCalenLaunchedFromExtApp); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
712 |
|
30 | 713 |
|
714 |
iServices.RegisterForNotificationsL( this,notificationArray); |
|
715 |
||
716 |
notificationArray.Reset(); |
|
717 |
||
718 |
iIgnoreTap = EFalse; |
|
719 |
||
720 |
iCommandProcessing = EFalse; |
|
721 |
TCallBack callback(CCalenNativeView::AsyncCopyToCalendarsL,this); |
|
722 |
iAsyncCallback = new(ELeave) CAsyncCallBack(callback,CActive::EPriorityStandard); |
|
723 |
||
724 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
725 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
726 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
727 |
// ---------------------------------------------------------------------------- |
30 | 728 |
// CCalenNativeView::CreateContainerL |
729 |
// A container control is created. |
|
730 |
// (other items were commented in a header). |
|
731 |
// ---------------------------------------------------------------------------- |
|
732 |
// |
|
733 |
void CCalenNativeView::CreateContainerL() |
|
734 |
{ |
|
735 |
TRACE_ENTRY_POINT; |
|
736 |
||
737 |
if (!iContainer) |
|
738 |
{ |
|
739 |
CCalenContainer* container = CreateContainerImplL(); |
|
740 |
CleanupStack::PushL(container); |
|
741 |
container->SetMopParent(this); |
|
742 |
container->ConstructL(); |
|
743 |
CleanupStack::Pop(); // container |
|
744 |
||
745 |
iContainer = container; |
|
746 |
iContainer->SetRect( ClientRect() ); |
|
747 |
iContainer->ActivateL(); |
|
748 |
} |
|
749 |
else |
|
750 |
{ |
|
751 |
iContainer->MakeVisible(ETrue); |
|
752 |
} |
|
753 |
||
754 |
TRACE_EXIT_POINT; |
|
755 |
} |
|
756 |
||
757 |
// ---------------------------------------------------------------------------- |
|
758 |
// CCalenNativeView::AbbreviatedDayArrayL |
|
759 |
// Returns an array of descriptors of abbreviated days (e.g. MO, TU). This |
|
760 |
// will only get called by the month and week views. |
|
761 |
// (other items were commented in a header). |
|
762 |
// ---------------------------------------------------------------------------- |
|
763 |
// |
|
764 |
const CDesCArrayFlat& CCalenNativeView::AbbreviatedDayArrayL() |
|
765 |
{ |
|
766 |
TRACE_ENTRY_POINT; |
|
767 |
||
768 |
if( !iAbbreviatedDayArray ) |
|
769 |
{ |
|
770 |
iAbbreviatedDayArray = new( ELeave )CDesCArrayFlat( 7 ); |
|
771 |
HBufC* dayAbb; |
|
772 |
||
773 |
for ( TInt i(0); i<7; ++i ) |
|
774 |
{ |
|
775 |
dayAbb = StringLoader::LoadLC( KAbbreviatedWeekNames[i] ); |
|
776 |
iAbbreviatedDayArray->AppendL( *dayAbb ); |
|
777 |
CleanupStack::PopAndDestroy( dayAbb ); |
|
778 |
} |
|
779 |
} |
|
780 |
||
781 |
TRACE_EXIT_POINT; |
|
782 |
return *iAbbreviatedDayArray; |
|
783 |
} |
|
784 |
||
785 |
// ---------------------------------------------------------------------------- |
|
786 |
// CCalenNativeView::DoActivateL |
|
787 |
// View activation handler |
|
788 |
// (other items were commented in a header). |
|
789 |
// ---------------------------------------------------------------------------- |
|
790 |
// |
|
791 |
void CCalenNativeView::DoActivateL( const TVwsViewId& aPrevViewId, |
|
792 |
TUid aCustomMessageId, |
|
793 |
const TDesC8& aCustomMessage) |
|
794 |
{ |
|
795 |
TRACE_ENTRY_POINT; |
|
796 |
||
797 |
iLocChangeReason = 0; |
|
798 |
||
799 |
if( KCalenHideInBackGround.iUid == aCustomMessageId.iUid ) |
|
800 |
{ |
|
801 |
SetFasterAppActive(ETrue); |
|
802 |
DoDeactivate(); |
|
803 |
} |
|
804 |
||
805 |
if( AknLayoutUtils::PenEnabled() ) |
|
806 |
{ |
|
807 |
MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull(); |
|
808 |
if(toolbarImpl) |
|
809 |
{ |
|
810 |
CAknToolbar& toolbar = toolbarImpl->Toolbar(); |
|
811 |
toolbar.SetToolbarVisibility(ETrue); |
|
812 |
} |
|
813 |
} |
|
814 |
||
815 |
if ( Toolbar() ) |
|
816 |
{ |
|
817 |
ShowToolbarOnViewActivation( ETrue ); |
|
818 |
} |
|
819 |
||
820 |
CreateContainerL(); |
|
821 |
||
822 |
DoActivateImplL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
|
823 |
||
824 |
TRACE_EXIT_POINT; |
|
825 |
} |
|
826 |
||
827 |
// ---------------------------------------------------------------------------- |
|
828 |
// CCalenNativeView::DoDeactivate |
|
829 |
// View deactivation handler |
|
830 |
// (other items were commented in a header). |
|
831 |
// ---------------------------------------------------------------------------- |
|
832 |
// |
|
833 |
void CCalenNativeView::DoDeactivate() |
|
834 |
{ |
|
835 |
TRACE_ENTRY_POINT; |
|
836 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
837 |
//delete AIW iServiceHandler; |
|
838 |
ReleaseServiceHandler(); |
|
839 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
840 |
||
841 |
if (iContainer) |
|
842 |
{ |
|
843 |
iContainer->RemoveFromStackAndMakeInvisible(); |
|
844 |
DoDeactivateImpl(); |
|
845 |
delete iContainer; |
|
846 |
iContainer = NULL; |
|
847 |
} |
|
848 |
TRACE_EXIT_POINT; |
|
849 |
} |
|
850 |
||
851 |
// ---------------------------------------------------------------------------- |
|
852 |
// CCalenNativeView::HandleDBChangeL |
|
853 |
// Called from CCalenGlobalData when the agenda database |
|
854 |
// is modified from an external session. |
|
855 |
// ---------------------------------------------------------------------------- |
|
856 |
// |
|
857 |
void CCalenNativeView::HandleDBChangeL() |
|
858 |
{ |
|
859 |
TRACE_ENTRY_POINT; |
|
860 |
||
861 |
// If iContainer is NULL then this is not the active view, so do nothing. |
|
862 |
// The view will be refreshed when the container is constructed. |
|
863 |
if ( iContainer ) |
|
864 |
{ |
|
865 |
if (IsForeground() && Container()->ComponentControl(0)->IsFocused()) |
|
866 |
{ |
|
867 |
// Application is in the foreground and the container is visible |
|
868 |
// on screen. We know that the editor is not open as the |
|
869 |
// containers first component control currently has keyboard focus. |
|
870 |
// The first component control will either be a listbox or grid |
|
871 |
// depending on the viewtype. Refresh the container. |
|
872 |
BeginRepopulationL(); |
|
873 |
iNeedsRefresh = EFalse; |
|
874 |
} |
|
875 |
else |
|
876 |
{ |
|
877 |
// This is the active view, but we are in one of two states: |
|
878 |
// 1: The application is in the background |
|
879 |
// 2: The editor is open and currently has keyboard focus. |
|
880 |
// When we recieve a focus change notification we will need to |
|
881 |
// refresh the view. This happens in CCalenNativeView::NotifyFocusChanged |
|
882 |
iNeedsRefresh = ETrue; |
|
883 |
} |
|
884 |
} |
|
885 |
||
886 |
TRACE_EXIT_POINT; |
|
887 |
} |
|
888 |
||
889 |
// ---------------------------------------------------------------------------- |
|
890 |
// CCalenNativeView::SetCbaL() |
|
891 |
// Set CBA and change button from Back to Exit if necessary |
|
892 |
// (other items were commented in a header). |
|
893 |
// ---------------------------------------------------------------------------- |
|
894 |
// |
|
895 |
void CCalenNativeView::SetCbaL(TInt aCbaResourceId) |
|
896 |
{ |
|
897 |
TRACE_ENTRY_POINT; |
|
898 |
||
899 |
CEikButtonGroupContainer* cba = Cba(); |
|
900 |
cba->SetCommandSetL(aCbaResourceId); |
|
901 |
cba->DrawNow(); |
|
902 |
||
903 |
TRACE_EXIT_POINT; |
|
904 |
} |
|
905 |
||
906 |
||
907 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
908 |
||
909 |
// ---------------------------------------------------------------------------- |
|
910 |
// CCalenNativeView::CreateServiceHandlerL() |
|
911 |
// Create new AIW service handler and attach to menu services if needed |
|
912 |
// (other items were commented in a header). |
|
913 |
// ---------------------------------------------------------------------------- |
|
914 |
// |
|
915 |
void CCalenNativeView::CreateServiceHandlerL(TBool aAttachMenu) |
|
916 |
{ |
|
917 |
TRACE_ENTRY_POINT; |
|
918 |
||
919 |
||
920 |
if ((iServiceHandler!=NULL) && (aAttachMenu==EFalse)) |
|
921 |
{ |
|
922 |
TRACE_EXIT_POINT; |
|
923 |
return; |
|
924 |
} |
|
925 |
||
926 |
// Create service handler instance. |
|
927 |
if (!iServiceHandler) |
|
928 |
{ |
|
929 |
iServiceHandler = CAiwServiceHandler::NewL(); |
|
930 |
} |
|
931 |
if (aAttachMenu) |
|
932 |
{ |
|
933 |
// Attach menu service interest to AIW framework. We will add |
|
934 |
// menus to all the views |
|
935 |
PIM_TRAPD_HANDLE( iServiceHandler->AttachMenuL(R_CALENDAR_DAY_MENUPANE, |
|
936 |
R_EXTERNAL_CALENDAR_AIW_INTEREST) ); |
|
937 |
||
938 |
PIM_TRAPD_HANDLE( iServiceHandler->AttachMenuL(R_CALENDAR_MONTH_MENUPANE, |
|
939 |
R_EXTERNAL_CALENDAR_AIW_INTEREST) ); |
|
940 |
||
941 |
||
942 |
PIM_TRAPD_HANDLE( iServiceHandler->AttachMenuL(R_CALENDAR_WEEK_MENUPANE, |
|
943 |
R_EXTERNAL_CALENDAR_AIW_INTEREST) ); |
|
944 |
||
945 |
PIM_TRAPD_HANDLE( iServiceHandler->AttachMenuL(R_TODO_LIST_MENUPANE, |
|
946 |
R_EXTERNAL_CALENDAR_AIW_INTEREST) ); |
|
947 |
} |
|
948 |
||
949 |
||
950 |
TRACE_EXIT_POINT; |
|
951 |
} |
|
952 |
||
953 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
954 |
||
955 |
||
956 |
||
957 |
||
958 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
959 |
// ---------------------------------------------------------------------------- |
|
960 |
// CCalenNativeView::ReleaseServiceHandler() |
|
961 |
// Release service handler and unload provider |
|
962 |
// (other items were commented in a header). |
|
963 |
// ---------------------------------------------------------------------------- |
|
964 |
// |
|
965 |
void CCalenNativeView::ReleaseServiceHandler() |
|
966 |
{ |
|
967 |
TRACE_ENTRY_POINT; |
|
968 |
if (iServiceHandler) |
|
969 |
{ |
|
970 |
iServiceHandler->Reset(); |
|
971 |
delete iServiceHandler; |
|
972 |
iServiceHandler=NULL; |
|
973 |
} |
|
974 |
TRACE_EXIT_POINT; |
|
975 |
} |
|
976 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
977 |
||
978 |
||
979 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
980 |
// ---------------------------------------------------------------------------- |
|
981 |
// CCalenNativeView::ServiceHandler() |
|
982 |
// Return pointer to service handler |
|
983 |
// (other items were commented in a header). |
|
984 |
// ---------------------------------------------------------------------------- |
|
985 |
// |
|
986 |
CAiwServiceHandler* CCalenNativeView::ServiceHandler() |
|
987 |
{ |
|
988 |
TRACE_ENTRY_POINT; |
|
989 |
return iServiceHandler; |
|
990 |
TRACE_EXIT_POINT; |
|
991 |
} |
|
992 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
993 |
||
994 |
||
995 |
||
996 |
||
997 |
||
998 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
999 |
||
1000 |
// ---------------------------------------------------------------------------- |
|
1001 |
//* Handles notifications caused by an asynchronous Execute*CmdL call |
|
1002 |
//* or an event. |
|
1003 |
//* |
|
1004 |
//* @param aCmdId The service command associated to the event. |
|
1005 |
//* @param aEventId Occured event, see AiwCommon.hrh. |
|
1006 |
//* @param aEventParamList Event parameters, if any, as defined per |
|
1007 |
//* each event. |
|
1008 |
//* @param aInParamList Input parameters, if any, given in the |
|
1009 |
//* related HandleCommmandL. |
|
1010 |
//* @return Error code for the callback. |
|
1011 |
// ---------------------------------------------------------------------------- |
|
1012 |
// |
|
1013 |
TInt CCalenNativeView::HandleNotifyL(TInt /*aCmdId*/,TInt /*aEventId*/,CAiwGenericParamList& aEventParamList,const CAiwGenericParamList& /*aInParamList*/) |
|
1014 |
{ |
|
1015 |
TRACE_ENTRY_POINT; |
|
1016 |
TInt count=aEventParamList.Count(); |
|
1017 |
TInt index=0; |
|
1018 |
TTime date(0); |
|
1019 |
||
1020 |
// find first TTime parameter |
|
1021 |
const TAiwGenericParam* param = aEventParamList.FindFirst(index, EGenericParamDateTime); |
|
1022 |
if (index >= 0) |
|
1023 |
{ |
|
1024 |
// get date value from it |
|
1025 |
const TAiwVariant& val = param->Value(); |
|
1026 |
val.Get(date); |
|
1027 |
} |
|
1028 |
else |
|
1029 |
{ |
|
1030 |
TRACE_EXIT_POINT; |
|
1031 |
return KErrNone; |
|
1032 |
} |
|
1033 |
||
1034 |
// use date got from provider and set it to calendar |
|
1035 |
MCalenContext& context = iServices.Context(); |
|
1036 |
TCalTime focusTime; |
|
1037 |
focusTime.SetTimeLocalL( date + TCalenContext::DefaultTimeForViews() ); |
|
1038 |
context.SetFocusTime( focusTime , context.ViewId() ); |
|
1039 |
iContainer->NotifyChangeDateL(); |
|
1040 |
TRACE_EXIT_POINT; |
|
1041 |
return KErrNone; |
|
1042 |
} |
|
1043 |
||
1044 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
1045 |
||
1046 |
// ---------------------------------------------------------------------------- |
|
1047 |
// CCalenNativeView::HandleNotification |
|
1048 |
// From MCalenNotificationHandler |
|
1049 |
// Handles a notification of a calendar event that this |
|
1050 |
// MCalenNotificationHandler has registered for |
|
1051 |
// ---------------------------------------------------------------------------- |
|
1052 |
// |
|
1053 |
void CCalenNativeView::HandleNotification(const TCalenNotification aNotification ) |
|
1054 |
{ |
|
1055 |
TRACE_ENTRY_POINT; |
|
1056 |
||
1057 |
switch ( aNotification ) |
|
1058 |
{ |
|
1059 |
case ECalenNotifyContextChanged: |
|
1060 |
{ |
|
1061 |
// If we're not on screen, clear VSD. |
|
1062 |
if ( !iContainer ) |
|
1063 |
{ |
|
1064 |
PIM_TRAPD_HANDLE( ClearViewSpecificDataL() ); |
|
1065 |
} |
|
1066 |
} |
|
1067 |
break; |
|
1068 |
case ECalenNotifyMarkedEntryDeleted: // Todo view specific notification |
|
1069 |
{ |
|
1070 |
PIM_TRAPD_HANDLE( NotifyMarkedEntryDeletedL() ); |
|
1071 |
} |
|
1072 |
break; |
|
1073 |
case ECalenNotifyMarkedEntryCompleted: // Todo view specific notification |
|
1074 |
{ |
|
1075 |
PIM_TRAPD_HANDLE( NotifyMarkedEntryCompletedL() ); |
|
1076 |
} |
|
1077 |
break; |
|
1078 |
case ECalenNotifySystemTimeChanged: |
|
1079 |
{ |
|
1080 |
PIM_TRAPD_HANDLE( OnLocaleChangedL( EChangesSystemTime ) ); |
|
1081 |
} |
|
1082 |
break; |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1083 |
case ECalenNotifyCalenLaunchedFromExtApp: |
30 | 1084 |
{ |
1085 |
SetTapIgnore(ETrue); |
|
1086 |
} |
|
1087 |
break; |
|
1088 |
case ECalenNotifyEntryClosed: |
|
1089 |
{ |
|
1090 |
// The editor/ viewer is changed |
|
1091 |
PIM_TRAPD_HANDLE( OnEditorClosedL() ); |
|
1092 |
} |
|
1093 |
break; |
|
1094 |
case ECalenNotifyDialogClosed: |
|
1095 |
case ECalenNotifySettingsClosed: |
|
1096 |
case ECalenNotifySettingsChanged: |
|
1097 |
case ECalenNotifyEntrySent: |
|
1098 |
{ |
|
1099 |
iIsEditorActive = EFalse; |
|
1100 |
iCommandProcessing = EFalse; |
|
1101 |
} |
|
1102 |
break; |
|
1103 |
case ECalenNotifyEntrySaved: |
|
1104 |
case ECalenNotifyInstanceSaved: |
|
1105 |
{ |
|
1106 |
iIsEditorActive = EFalse; |
|
1107 |
if( Container() ) |
|
1108 |
{ |
|
1109 |
PIM_TRAPD_HANDLE(UpdateDateFromContextL()); |
|
1110 |
} |
|
1111 |
} |
|
1112 |
break; |
|
1113 |
case ECalenNotifySystemLocaleChanged: |
|
1114 |
{ |
|
1115 |
PIM_TRAPD_HANDLE( OnLocaleChangedL( EChangesLocale ) ); |
|
1116 |
} |
|
1117 |
break; |
|
1118 |
case ECalenNotifyAppForegrounded: |
|
1119 |
{ |
|
1120 |
iIsBackgrounded = EFalse; |
|
1121 |
// Updates the previewpane/preview popup in month view/week view |
|
1122 |
if(iFasterAppActive) |
|
1123 |
{ |
|
1124 |
iFasterAppActive = EFalse; |
|
1125 |
if(iIsEditorActive) |
|
1126 |
{ |
|
1127 |
iIsEditorActive = EFalse; |
|
1128 |
} |
|
1129 |
} |
|
1130 |
PIM_TRAPD_HANDLE(UpdatePreviewPaneL()); |
|
1131 |
} |
|
1132 |
break; |
|
1133 |
case ECalenNotifyAppBackgrounded: |
|
1134 |
{ |
|
1135 |
iIsBackgrounded = ETrue; |
|
1136 |
// Hides previewpane/preview popup in month view/week view when |
|
1137 |
// application goes to background or whenever fake exit is done |
|
1138 |
PIM_TRAPD_HANDLE(HidePreviewPane()); |
|
1139 |
} |
|
1140 |
break; |
|
1141 |
case ECalenNotifyEntryDeleted: |
|
1142 |
case ECalenNotifyMultipleEntriesDeleted: |
|
1143 |
case ECalenNotifyInstanceDeleted: |
|
1144 |
case ECalenNotifyCancelDelete: |
|
1145 |
case ECalenNotifyDeleteInstanceView: |
|
1146 |
{ |
|
1147 |
// Called when user does not delete an entry. |
|
1148 |
if( IsCommandHandlingInProgress() ) |
|
1149 |
{ |
|
1150 |
SetCommandHandlingInProgress( EFalse ); |
|
1151 |
} |
|
1152 |
||
1153 |
if(iContainer) |
|
1154 |
{ |
|
1155 |
iContainer->CleanupInstances(); |
|
1156 |
} |
|
1157 |
} |
|
1158 |
break; |
|
1159 |
case ECalenNotifyDeleteFailed: |
|
1160 |
{ |
|
1161 |
// Called when user does not delete an entry. |
|
1162 |
if( IsCommandHandlingInProgress() ) |
|
1163 |
{ |
|
1164 |
SetCommandHandlingInProgress( EFalse ); |
|
1165 |
} |
|
1166 |
||
1167 |
} |
|
1168 |
break; |
|
1169 |
case ECalenNotifyStopAlarm: |
|
1170 |
{ |
|
1171 |
if(iContainer) |
|
1172 |
{ |
|
1173 |
PIM_TRAPD_HANDLE(iContainer->HandleStopCommandL()); |
|
1174 |
} |
|
1175 |
} |
|
1176 |
break; |
|
1177 |
case ECalenNotifyResourceChanged: |
|
1178 |
{ |
|
1179 |
if(iContainer ) |
|
1180 |
{ |
|
1181 |
CAknAppUi* Appui = (CAknAppUi*)CEikonEnv::Static()->EikAppUi(); |
|
1182 |
//handle this event when the app is in background |
|
1183 |
if(!Appui->IsForeground()) |
|
1184 |
{ |
|
1185 |
iContainer->HandleResourceChange(KEikDynamicLayoutVariantSwitch); |
|
1186 |
} |
|
1187 |
} |
|
1188 |
} |
|
1189 |
break; |
|
1190 |
default: |
|
1191 |
ASSERT( 0 ); // should never get here |
|
1192 |
break; |
|
1193 |
} |
|
1194 |
||
1195 |
TRACE_EXIT_POINT; |
|
1196 |
} |
|
1197 |
||
1198 |
#ifdef RD_CALEN_EXTERNAL_CAL |
|
1199 |
// ---------------------------------------------------------------------------- |
|
1200 |
// ?classname::?member_function |
|
1201 |
// ?implementation_description |
|
1202 |
// (other items were commented in a header). |
|
1203 |
// ---------------------------------------------------------------------------- |
|
1204 |
// |
|
1205 |
TBool CCalenNativeView::ExtCalendarAvailableL() |
|
1206 |
{ |
|
1207 |
TRACE_ENTRY_POINT; |
|
1208 |
||
1209 |
||
1210 |
TBool res=EFalse; |
|
1211 |
||
1212 |
||
1213 |
TInt enabled( 0 ); |
|
1214 |
CRepository* repository = NULL; |
|
1215 |
||
1216 |
// first we check central repository if it has our external calendar enabled. |
|
1217 |
PIM_TRAPD_HANDLE( (repository = CRepository::NewL( KCRUidCalenUIExtensions )) ); |
|
1218 |
if( repository ) |
|
1219 |
{ |
|
1220 |
TInt err = repository->Get( KCalenExternalCalendarEnabled, enabled ); |
|
1221 |
delete repository; |
|
1222 |
} |
|
1223 |
// if setting says it is not enabled there is no point of loading provider at all, improves performance. |
|
1224 |
if (!enabled) |
|
1225 |
{ |
|
1226 |
TRACE_EXIT_POINT; |
|
1227 |
return EFalse; |
|
1228 |
} |
|
1229 |
||
1230 |
// if setting was enabled we should also find out if there is a service provider. |
|
1231 |
CreateServiceHandlerL(EFalse); |
|
1232 |
CAiwCriteriaItem* crit = CAiwCriteriaItem::NewLC(ECalenExtAiwCommandId, KAiwCmdView, KContentTypeCalendar); |
|
1233 |
// we will connect to base service which is currently just empty. This is needed just for finding out if |
|
1234 |
// there are any providers available. This will change in the future in AIW framework as it is a bug. |
|
1235 |
crit->SetServiceClass(TUid::Uid(KAiwClassBase)); |
|
1236 |
crit->SetMaxProviders(1); |
|
1237 |
RCriteriaArray array; |
|
1238 |
array.Append(crit); |
|
1239 |
||
1240 |
// attach to base service. |
|
1241 |
// ownership of array is not transferred. |
|
1242 |
iServiceHandler->AttachL(array); |
|
1243 |
||
1244 |
// get number of matching providers. |
|
1245 |
TInt num=iServiceHandler->NbrOfProviders(crit); |
|
1246 |
||
1247 |
||
1248 |
array.ResetAndDestroy(); |
|
1249 |
CleanupStack::Pop(crit); |
|
1250 |
||
1251 |
// ok if we have provider and setting was also enabled then we should show menu items. |
|
1252 |
if ((num>0)&&(enabled)) |
|
1253 |
{ |
|
1254 |
res=ETrue; |
|
1255 |
} |
|
1256 |
TRACE_EXIT_POINT; |
|
1257 |
return res; |
|
1258 |
} |
|
1259 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
1260 |
||
1261 |
// ---------------------------------------------------------------------------- |
|
1262 |
// CCalenNativeView::BeginRepopulationL |
|
1263 |
// Starts population again. |
|
1264 |
// (other items were commented in a header). |
|
1265 |
// ---------------------------------------------------------------------------- |
|
1266 |
// |
|
1267 |
void CCalenNativeView::BeginRepopulationL() |
|
1268 |
{ |
|
1269 |
TRACE_ENTRY_POINT; |
|
1270 |
||
1271 |
CancelPopulation(); |
|
1272 |
iServices.IssueCommandL( ECalenStartActiveStep ); |
|
1273 |
||
1274 |
TRACE_EXIT_POINT; |
|
1275 |
} |
|
1276 |
||
1277 |
// ---------------------------------------------------------------------------- |
|
1278 |
// CCalenNativeView::RemoveViewsFromCycle |
|
1279 |
// From CCalenView. Does nothing. |
|
1280 |
// (other items were commented in a header). |
|
1281 |
// ---------------------------------------------------------------------------- |
|
1282 |
// |
|
1283 |
void CCalenNativeView::RemoveViewsFromCycle( RArray<TInt>& /*aViews*/ ) |
|
1284 |
{ |
|
1285 |
TRACE_ENTRY_POINT; |
|
1286 |
TRACE_EXIT_POINT; |
|
1287 |
} |
|
1288 |
||
1289 |
// ---------------------------------------------------------------------------- |
|
1290 |
// CCalenNativeView::GetHelpContext |
|
1291 |
// From CCalenView. Does nothing. |
|
1292 |
// (other items were commented in a header). |
|
1293 |
// ---------------------------------------------------------------------------- |
|
1294 |
// |
|
1295 |
void CCalenNativeView::GetHelpContext( TCoeHelpContext& /*aHelpContext*/ ) |
|
1296 |
{ |
|
1297 |
TRACE_ENTRY_POINT; |
|
1298 |
TRACE_EXIT_POINT; |
|
1299 |
} |
|
1300 |
||
1301 |
// ---------------------------------------------------------------------------- |
|
1302 |
// CCalenNativeView::CalenViewExtensionL |
|
1303 |
// From CCalenView. Does nothing. |
|
1304 |
// (other items were commented in a header). |
|
1305 |
// ---------------------------------------------------------------------------- |
|
1306 |
// |
|
1307 |
TAny* CCalenNativeView::CalenViewExtensionL( TUid /*aExtensionId*/ ) |
|
1308 |
{ |
|
1309 |
TRACE_ENTRY_POINT; |
|
1310 |
TRACE_EXIT_POINT; |
|
1311 |
return NULL; |
|
1312 |
} |
|
1313 |
||
1314 |
// ---------------------------------------------------------------------------- |
|
1315 |
// CCalenNativeView::OnEditorClosedL |
|
1316 |
// Called when editor/viewer is closed |
|
1317 |
// (other items were commented in a header). |
|
1318 |
// ---------------------------------------------------------------------------- |
|
1319 |
// |
|
1320 |
void CCalenNativeView::OnEditorClosedL() |
|
1321 |
{ |
|
1322 |
TRACE_ENTRY_POINT; |
|
1323 |
||
1324 |
SetTapIgnore(EFalse); |
|
1325 |
// If the view is active, then update status pane |
|
1326 |
if( Container() ) |
|
1327 |
{ |
|
1328 |
RedrawStatusPaneL(); |
|
1329 |
iIsEditorActive = EFalse; |
|
1330 |
} |
|
1331 |
TRACE_EXIT_POINT; |
|
1332 |
} |
|
1333 |
||
1334 |
// ---------------------------------------------------------------------------- |
|
1335 |
// CCalenNativeView::SetEditorActive |
|
1336 |
// Set the flag iIsEditorActive whenever new event editor is launched from any |
|
1337 |
// native view.This is to prevent the preview popup display |
|
1338 |
// (other items were commented in a header). |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1339 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1340 |
// |
30 | 1341 |
void CCalenNativeView::SetEditorActive(TBool aEditorActive) |
1342 |
{ |
|
1343 |
TRACE_ENTRY_POINT; |
|
1344 |
||
1345 |
iIsEditorActive = aEditorActive; |
|
1346 |
||
1347 |
TRACE_EXIT_POINT; |
|
1348 |
} |
|
1349 |
||
1350 |
// ---------------------------------------------------------------------------- |
|
1351 |
// CCalenNativeView::IsCommandHandlingInProgress |
|
1352 |
// other details are commented in the header |
|
1353 |
// ---------------------------------------------------------------------------- |
|
1354 |
// |
|
1355 |
TBool CCalenNativeView::IsCommandHandlingInProgress() |
|
1356 |
{ |
|
1357 |
TRACE_ENTRY_POINT; |
|
1358 |
||
1359 |
return iCommandProcessing; |
|
1360 |
||
1361 |
TRACE_EXIT_POINT; |
|
1362 |
} |
|
1363 |
||
1364 |
// ---------------------------------------------------------------------------- |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1365 |
// CCalenNativeView::IsCalenLaunchedFromExtApp |
30 | 1366 |
// other details are commented in the header |
1367 |
// ---------------------------------------------------------------------------- |
|
1368 |
// |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1369 |
TBool CCalenNativeView::IsCalenLaunchedFromExtApp() |
30 | 1370 |
{ |
1371 |
TRACE_ENTRY_POINT; |
|
1372 |
return iIgnoreTap; |
|
1373 |
TRACE_EXIT_POINT; |
|
1374 |
} |
|
1375 |
// ---------------------------------------------------------------------------- |
|
1376 |
// CCalenNativeView::SetCommandHandlingProgress |
|
1377 |
// other details are commented in the header |
|
1378 |
// ---------------------------------------------------------------------------- |
|
1379 |
// |
|
1380 |
void CCalenNativeView::SetCommandHandlingInProgress( TBool aInProgress ) |
|
1381 |
{ |
|
1382 |
TRACE_ENTRY_POINT; |
|
1383 |
||
1384 |
iCommandProcessing = aInProgress; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1385 |
|
30 | 1386 |
TRACE_EXIT_POINT; |
1387 |
} |
|
1388 |
||
1389 |
||
1390 |
// ---------------------------------------------------------------------------- |
|
1391 |
// CCalenNativeView::SetEditorActive |
|
1392 |
// Returns an array of active collection ids. |
|
1393 |
// (other items were commented in a header). |
|
1394 |
// ---------------------------------------------------------------------------- |
|
1395 |
// |
|
1396 |
void CCalenNativeView::GetActiveCollectionidsL( |
|
1397 |
MCalenServices& aServices, |
|
1398 |
RArray< TInt >& aCollectionIds ) |
|
1399 |
{ |
|
1400 |
TRACE_ENTRY_POINT; |
|
1401 |
RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
1402 |
CleanupClosePushL(calendarInfoList); |
|
1403 |
aServices.GetAllCalendarInfoL(calendarInfoList); |
|
1404 |
||
1405 |
for(TInt index=0;index<calendarInfoList.Count();index++) |
|
1406 |
{ |
|
1407 |
if(calendarInfoList[index]->Enabled()) |
|
1408 |
{ |
|
1409 |
aCollectionIds.Append( aServices.SessionL( |
|
1410 |
calendarInfoList[index]->FileNameL() ).CollectionIdL() ); |
|
1411 |
} |
|
1412 |
} |
|
1413 |
||
1414 |
CleanupStack::PopAndDestroy(&calendarInfoList); |
|
1415 |
TRACE_EXIT_POINT; |
|
1416 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1417 |
|
30 | 1418 |
// ---------------------------------------------------------------------------- |
1419 |
// CCalenNativeView::SetFasterAppActive |
|
1420 |
// Set the flag 'iFasterApp' to ETrue if application is fake exited |
|
1421 |
// and to EFalse once the application comes to foreground. |
|
1422 |
// (other items were commented in a header). |
|
1423 |
// ---------------------------------------------------------------------------- |
|
1424 |
void CCalenNativeView::SetFasterAppActive( TBool aFlag ) |
|
1425 |
{ |
|
1426 |
TRACE_ENTRY_POINT; |
|
1427 |
TRACE_EXIT_POINT; |
|
1428 |
iFasterAppActive = aFlag; |
|
1429 |
} |
|
1430 |
||
1431 |
// ---------------------------------------------------------------------------- |
|
1432 |
// CCalenNativeView::IsEditorActiveOrFasterAppExit |
|
1433 |
// Returns ETrue whenever editor is active or whenever fake exit is active |
|
1434 |
// (other items were commented in a header). |
|
1435 |
// ---------------------------------------------------------------------------- |
|
1436 |
// |
|
1437 |
TBool CCalenNativeView::IsEditorActiveOrFasterAppExit() |
|
1438 |
{ |
|
1439 |
TRACE_ENTRY_POINT; |
|
1440 |
||
1441 |
if( iIsEditorActive || iFasterAppActive || iIsBackgrounded ) |
|
1442 |
{ |
|
1443 |
TRACE_EXIT_POINT; |
|
1444 |
return ETrue; |
|
1445 |
} |
|
1446 |
else |
|
1447 |
{ |
|
1448 |
TRACE_EXIT_POINT; |
|
1449 |
return EFalse; |
|
1450 |
} |
|
1451 |
} |
|
1452 |
||
1453 |
// ---------------------------------------------------------------------------- |
|
1454 |
// CCalenNativeView::SetTapIgnore |
|
1455 |
// Sets flag to ignore tap on any of the views |
|
1456 |
// (other items were commented in a header). |
|
1457 |
// ---------------------------------------------------------------------------- |
|
1458 |
// |
|
1459 |
void CCalenNativeView::SetTapIgnore(TBool aIgnore) |
|
1460 |
{ |
|
1461 |
iIgnoreTap = aIgnore; |
|
1462 |
} |
|
1463 |
||
1464 |
// End of File |