author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:32:31 +0100 | |
branch | RCL_3 |
changeset 66 | bd7edf625bdd |
parent 65 | 12af337248b1 |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
66 | 2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: For Month view of calendar application. |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
66 | 16 |
*/ |
17 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
66 | 19 |
#include <aknnavide.h> |
20 |
#include <bldvariant.hrh> // For FeatureIds (lint warns without) |
|
21 |
#include <eikmenup.h> |
|
22 |
#include <eikspane.h> //CEikStatusPane |
|
23 |
#include <StringLoader.h> |
|
24 |
#include <aknappui.h> |
|
25 |
#include <featmgr.h> |
|
26 |
#include <calinstance.h> |
|
27 |
#include <calinstanceview.h> |
|
28 |
#include <calcommon.h> |
|
29 |
#include <caliterator.h> |
|
30 |
#include <Calendar.rsg> |
|
31 |
#include <calencommonui.rsg> |
|
32 |
#include <calencommands.hrh> // Calendar commands |
|
33 |
#include <calencontext.h> |
|
34 |
#include <CalenStatusPaneUtils.h> |
|
35 |
#include <calenservices.h> |
|
36 |
#include <caleninstanceid.h> |
|
37 |
#include <calenviewutils.h> |
|
38 |
#include <calcalendarinfo.h> |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
|
66 | 40 |
#include "calendarui_debug.h" |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
#include "calenmonthview.h" |
66 | 42 |
#include "calenmonthcontainer.h" |
43 |
#include <CalenInterimUtils2.h> |
|
44 |
#include "calentitlepane.h" |
|
45 |
#include "calensend.h" |
|
46 |
#include "ToDo.hrh" |
|
47 |
#include "calendar.hrh" |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
#include "CalenUid.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
|
66 | 50 |
// ================= MEMBER FUNCTIONS ========================================= |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
66 | 52 |
// ---------------------------------------------------------------------------- |
53 |
// CCalenMonthView::NewLC |
|
54 |
// First stage construction |
|
55 |
// (other items were commented in a header). |
|
56 |
// ---------------------------------------------------------------------------- |
|
57 |
// |
|
58 |
EXPORT_C CCalenMonthView* CCalenMonthView::NewL( MCalenServices& aServices ) |
|
59 |
{ |
|
60 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
|
66 | 62 |
CCalenMonthView* self = new( ELeave ) CCalenMonthView( aServices ); |
63 |
CleanupStack::PushL( self ); |
|
64 |
self->ConstructL(); |
|
65 |
CleanupStack::Pop( self ); |
|
66 |
||
67 |
TRACE_EXIT_POINT; |
|
68 |
return self; |
|
69 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
66 | 71 |
// ---------------------------------------------------------------------------- |
72 |
// CCalenMonthView::~CCalenMonthView |
|
73 |
// Destructor |
|
74 |
// (other items were commented in a header). |
|
75 |
// ---------------------------------------------------------------------------- |
|
76 |
// |
|
77 |
CCalenMonthView::~CCalenMonthView() |
|
78 |
{ |
|
79 |
TRACE_ENTRY_POINT; |
|
80 |
TRACE_EXIT_POINT; |
|
81 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
|
66 | 83 |
// ---------------------------------------------------------------------------- |
84 |
// CCalenMonthView::CCalenMonthView |
|
85 |
// C++ default constructor can NOT contain any code, that might leave. |
|
86 |
// (other items were commented in a header). |
|
87 |
// ---------------------------------------------------------------------------- |
|
88 |
// |
|
89 |
CCalenMonthView::CCalenMonthView( MCalenServices& aServices ) |
|
90 |
: CCalenNativeView( aServices ), |
|
91 |
iPopulationStep( ENothingDone ) |
|
92 |
{ |
|
93 |
TRACE_ENTRY_POINT; |
|
94 |
TRACE_EXIT_POINT; |
|
95 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
96 |
|
66 | 97 |
// ---------------------------------------------------------------------------- |
98 |
// CCalenMonthView::ConstructL |
|
99 |
// Symbian OS constructor can leave. |
|
100 |
// (other items were commented in a header). |
|
101 |
// ---------------------------------------------------------------------------- |
|
102 |
// |
|
103 |
void CCalenMonthView::ConstructL() |
|
104 |
{ |
|
105 |
TRACE_ENTRY_POINT; |
|
106 |
||
107 |
CommonConstructL( R_CALEN_MONTHVIEW_INFO ); |
|
108 |
//iLocalisedViewName = StringLoader::LoadL( R_CALEN_VIEW_MONTH, iCoeEnv ); |
|
109 |
||
110 |
TRACE_EXIT_POINT; |
|
111 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
|
66 | 113 |
// ---------------------------------------------------------------------------- |
114 |
// CCalenMonthView::SetStatusPaneFromActiveContextL |
|
115 |
// Set active date to Status pane |
|
116 |
// (other items were commented in a header). |
|
117 |
// ---------------------------------------------------------------------------- |
|
118 |
// |
|
119 |
void CCalenMonthView::SetStatusPaneFromActiveContextL() |
|
120 |
{ |
|
121 |
TRACE_ENTRY_POINT; |
|
122 |
||
123 |
// title pane |
|
124 |
TBuf<KMaxMonthName> title; |
|
125 |
TTime activeDay = CCalenContainer::DateFromContextL( iServices.Context() ); |
|
126 |
TDateTime activeDayTime = activeDay.DateTime(); |
|
127 |
iSPUtils->MonthNameByActiveTime( title, activeDay ); |
|
128 |
iSPUtils->UnderLineTitleText( EFalse ); |
|
129 |
iSPUtils->SetTitleTextL( title ); |
|
130 |
||
131 |
||
132 |
// navi pane |
|
133 |
CAknNavigationDecorator* naviLabel = iSPUtils->ShowNaviPaneL( activeDay ); |
|
134 |
ShowValidScrollButtons( *naviLabel, |
|
135 |
activeDay - TTimeIntervalMonths(1), |
|
136 |
activeDay + TTimeIntervalMonths(1) ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
|
66 | 138 |
iSPUtils->RefreshStatusPane(); |
139 |
TRACE_EXIT_POINT; |
|
140 |
} |
|
141 |
||
142 |
// ---------------------------------------------------------------------------- |
|
143 |
// CCalenMonthView::DoActivateImplL |
|
144 |
// CCalenNativeView::DoActivateL() calls DoActivateImplL() |
|
145 |
// (other items were commented in a header). |
|
146 |
// ---------------------------------------------------------------------------- |
|
147 |
// |
|
148 |
void CCalenMonthView::DoActivateImplL( const TVwsViewId& /*aPrevViewId*/, |
|
149 |
TUid /*aCustomMessageId*/, |
|
150 |
const TDesC8& /*aCustomMessage*/ ) |
|
151 |
{ |
|
152 |
TRACE_ENTRY_POINT; |
|
153 |
||
154 |
static_cast<CCalenMonthContainer*>(iContainer)->InitDataForMonthL(); |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
155 |
|
66 | 156 |
TRACE_EXIT_POINT; |
157 |
} |
|
158 |
||
159 |
// ---------------------------------------------------------------------------- |
|
160 |
// CCalenMonthView::DoDeactivateImpl |
|
161 |
// CCalenNativeView::DoDeactivateL() calls DoDeactivateImplL() |
|
162 |
// (other items were commented in a header). |
|
163 |
// ---------------------------------------------------------------------------- |
|
164 |
// |
|
165 |
void CCalenMonthView::DoDeactivateImpl() |
|
166 |
{ |
|
167 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
|
66 | 169 |
if (!iAvkonAppUi->IsDisplayingMenuOrDialog()) |
170 |
{ |
|
171 |
iSPUtils->HideNaviPane(); |
|
172 |
//iNaviContainer->Pop(iNaviLabel); |
|
173 |
//delete iNaviLabel; |
|
174 |
//iNaviLabel = NULL; |
|
175 |
} |
|
176 |
||
177 |
TRACE_EXIT_POINT; |
|
178 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
179 |
|
66 | 180 |
// ---------------------------------------------------------------------------- |
181 |
// CCalenMonthView::CreateContainerImplL |
|
182 |
// making CCalendarContainer. In this class, it is CCalenMonthContainer. |
|
183 |
// (other items were commented in a header). |
|
184 |
// ---------------------------------------------------------------------------- |
|
185 |
// |
|
186 |
CCalenContainer* CCalenMonthView::CreateContainerImplL() |
|
187 |
{ |
|
188 |
TRACE_ENTRY_POINT; |
|
189 |
||
190 |
TRACE_EXIT_POINT; |
|
191 |
return new( ELeave )CCalenMonthContainer( this, iDate, iServices ); |
|
192 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
|
66 | 194 |
// ---------------------------------------------------------------------------- |
195 |
// CCalenMonthView::OnLocaleChangedL |
|
196 |
// Locale or Today was changed when this function is called. |
|
197 |
// (other items were commented in a header). |
|
198 |
// ---------------------------------------------------------------------------- |
|
199 |
// |
|
200 |
void CCalenMonthView::OnLocaleChangedL(TInt aReason) |
|
201 |
{ |
|
202 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
|
66 | 204 |
if (iContainer) |
205 |
{ |
|
206 |
if (iContainer->IsVisible()) |
|
207 |
{ |
|
208 |
if (aReason & EChangesLocale) |
|
209 |
{ |
|
210 |
if (IsContainerFocused()) |
|
211 |
{ |
|
212 |
SetStatusPaneFromActiveContextL(); |
|
213 |
} |
|
214 |
else |
|
215 |
{ |
|
216 |
iLocChangeReason = aReason; |
|
217 |
} |
|
218 |
} |
|
219 |
if ((aReason & EChangesSystemTime ) || (aReason & EChangesMidnightCrossover )) |
|
220 |
{ |
|
221 |
static_cast<CCalenMonthContainer*>(iContainer)->ChangesMidnightCrossover(); |
|
222 |
} |
|
223 |
} |
|
224 |
else |
|
225 |
{ // Not visible |
|
226 |
iLocChangeReason = aReason; |
|
227 |
} |
|
228 |
} |
|
229 |
||
230 |
TRACE_EXIT_POINT; |
|
231 |
} |
|
232 |
||
233 |
// ---------------------------------------------------------------------------- |
|
234 |
// CCalenMonthView::RedrawStatusPaneL |
|
235 |
// Redraw status pane when Form is closed |
|
236 |
// (other items were commented in a header). |
|
237 |
// ---------------------------------------------------------------------------- |
|
238 |
// |
|
239 |
void CCalenMonthView::RedrawStatusPaneL() |
|
240 |
{ |
|
241 |
TRACE_ENTRY_POINT; |
|
242 |
||
243 |
SetStatusPaneFromActiveContextL(); |
|
244 |
||
245 |
static_cast<CCalenMonthContainer*>( |
|
246 |
iContainer)->ChangesMidnightCrossover(); |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
247 |
|
66 | 248 |
static_cast<CCalenMonthContainer*>( |
249 |
iContainer)->RedrawPreviewPane(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
|
66 | 251 |
TRACE_EXIT_POINT; |
252 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
253 |
|
66 | 254 |
// ---------------------------------------------------------------------------- |
255 |
// CCalenMonthView::DynInitMenuPaneL |
|
256 |
// Changes MenuPane dynamically |
|
257 |
// (other items were commented in a header). |
|
258 |
// ---------------------------------------------------------------------------- |
|
259 |
// |
|
260 |
void CCalenMonthView::DynInitMenuPaneL(TInt aResourceId, |
|
261 |
CEikMenuPane* aMenuPane) |
|
262 |
{ |
|
263 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
264 |
|
66 | 265 |
TBool isEntry = EFalse; |
266 |
static_cast<CCalenMonthContainer*>(iContainer)->HidePopup(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
|
66 | 269 |
CCalenNativeView::DynInitMenuPaneL(aResourceId, aMenuPane); |
270 |
switch (aResourceId) |
|
271 |
{ |
|
272 |
case R_CALENDAR_MONTH_MENUPANE: |
|
273 |
{ |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
274 |
|
66 | 275 |
#ifdef RD_CALEN_EXTERNAL_CAL |
276 |
TBool isit=ExtCalendarAvailableL(); |
|
277 |
if (!isit) |
|
278 |
{ |
|
279 |
ReleaseServiceHandler(); |
|
280 |
TInt dummy; |
|
281 |
if (aMenuPane->MenuItemExists(ECalenExtAiwCommandId,dummy)) |
|
282 |
{ |
|
283 |
aMenuPane->DeleteMenuItem(ECalenExtAiwCommandId); |
|
284 |
} |
|
285 |
} |
|
286 |
#endif //RD_CALEN_EXTERNAL_CAL |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
287 |
|
66 | 288 |
if ( ! FeatureManager::FeatureSupported(KFeatureIdHelp) ) |
289 |
{ |
|
290 |
aMenuPane->DeleteMenuItem(EAknCmdHelp); |
|
291 |
} |
|
292 |
||
293 |
RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
294 |
iServices.GetAllCalendarInfoL(calendarInfoList); |
|
295 |
CleanupClosePushL(calendarInfoList); |
|
296 |
||
297 |
for(TInt index=0 ; index < calendarInfoList.Count();index++ ) |
|
298 |
{ |
|
299 |
if(calendarInfoList[index]->Enabled() ) |
|
300 |
{ |
|
301 |
CCalIter* iterator = CCalIter::NewL( |
|
302 |
iServices.SessionL(calendarInfoList[index]->FileNameL()) ); |
|
303 |
CleanupStack::PushL( iterator ); |
|
304 |
if( iterator->FirstL() != KNullDesC8() ) |
|
305 |
{ |
|
306 |
isEntry = ETrue; |
|
307 |
} |
|
308 |
CleanupStack::PopAndDestroy( iterator ); |
|
309 |
} |
|
310 |
||
311 |
} |
|
312 |
CleanupStack::PopAndDestroy(&calendarInfoList); |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
313 |
|
66 | 314 |
if( !isEntry ) |
315 |
{ |
|
316 |
aMenuPane->DeleteMenuItem( ECalenDeleteAllEntries ); |
|
317 |
} |
|
318 |
if( !iServices.InterimUtilsL().MRViewersEnabledL( ETrue ) ) |
|
319 |
{ |
|
320 |
aMenuPane->DeleteMenuItem( ECalenNewMeetingRequest ); |
|
321 |
} |
|
322 |
// Offer the menu pane to the services for customisation by the |
|
323 |
// the view manager/plugins |
|
324 |
iServices.OfferMenuPaneL( aResourceId, aMenuPane ); |
|
325 |
} |
|
326 |
break; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
327 |
|
66 | 328 |
default: |
329 |
break; |
|
330 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
|
66 | 332 |
TRACE_EXIT_POINT; |
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
333 |
} |
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
334 |
|
66 | 335 |
// ---------------------------------------------------------------------------- |
336 |
// CMonthCalenView::HandleCommandL |
|
337 |
// Command handling for month view. |
|
338 |
// (other items were commented in a header). |
|
339 |
// ---------------------------------------------------------------------------- |
|
340 |
// |
|
341 |
void CCalenMonthView::HandleCommandL(TInt aCommand) |
|
342 |
{ |
|
343 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
344 |
|
66 | 345 |
switch (aCommand) |
346 |
{ |
|
347 |
// if MSK Open was selected then switch into Day view. |
|
348 |
case EAknSoftkeyOpen: |
|
349 |
CCalenNativeView::HandleCommandL( ECalenForwardsToDayView ); |
|
350 |
break; |
|
351 |
// otherwise let CCalenNativeView handle the command. |
|
352 |
default: |
|
353 |
CCalenNativeView::HandleCommandL(aCommand); |
|
354 |
break; |
|
355 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
356 |
|
66 | 357 |
TRACE_EXIT_POINT; |
358 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
359 |
|
66 | 360 |
// ---------------------------------------------------------------------------- |
361 |
// CCalenMonthView::Id |
|
362 |
// From CAknView |
|
363 |
// Return the UID of the month view |
|
364 |
// (other items were commented in a header) |
|
365 |
// ---------------------------------------------------------------------------- |
|
366 |
// |
|
367 |
TUid CCalenMonthView::Id() const |
|
368 |
{ |
|
369 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
370 |
|
66 | 371 |
TRACE_EXIT_POINT; |
372 |
return KUidCalenMonthView; |
|
373 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
374 |
|
66 | 375 |
// ---------------------------------------------------------------------------- |
376 |
// CCalenMonthView::ClearViewSpecificDataL |
|
377 |
// Clears any cached data for the specific view, e.g. currently |
|
378 |
// highlighted row, column, etc. |
|
379 |
// (other items were commented in a header) |
|
380 |
// ---------------------------------------------------------------------------- |
|
381 |
// |
|
382 |
void CCalenMonthView::ClearViewSpecificDataL() |
|
383 |
{ |
|
384 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
385 |
|
66 | 386 |
iDate = Time::NullTTime(); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
|
66 | 388 |
TRACE_EXIT_POINT; |
389 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
390 |
|
66 | 391 |
// ---------------------------------------------------------------------------- |
392 |
// CCalenMonthView::IsViewSpecificDataNullL |
|
393 |
// From CCalenNativeView |
|
394 |
// Returns ETrue if the view specific data is null, EFalse otherwise. |
|
395 |
// (other items were commented in a header) |
|
396 |
// ---------------------------------------------------------------------------- |
|
397 |
// |
|
398 |
TBool CCalenMonthView::IsViewSpecificDataNullL() |
|
399 |
{ |
|
400 |
TRACE_ENTRY_POINT; |
|
401 |
TRACE_EXIT_POINT; |
|
402 |
return ( iDate == Time::NullTTime() ); |
|
403 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
404 |
|
66 | 405 |
// ---------------------------------------------------------------------------- |
406 |
// CCalenMonthView::ActiveStepL |
|
407 |
// From CCalenView |
|
408 |
// (other items were commented in a header) |
|
409 |
// ---------------------------------------------------------------------------- |
|
410 |
// |
|
411 |
CCalenView::TNextPopulationStep CCalenMonthView::ActiveStepL() |
|
412 |
{ |
|
413 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
414 |
|
66 | 415 |
CCalenMonthContainer* cnt = static_cast<CCalenMonthContainer*>( iContainer ); |
416 |
if(!cnt) |
|
417 |
{ |
|
418 |
TRACE_EXIT_POINT; |
|
419 |
iPopulationStep = EPopulationDone; |
|
420 |
return CCalenView::EDone; |
|
421 |
} |
|
422 |
||
423 |
switch( iPopulationStep ) |
|
424 |
{ |
|
425 |
case ENothingDone: |
|
426 |
{ |
|
427 |
cnt->PrepareForPopulationL(); |
|
428 |
iPopulationStep = ERequestedInstanceView; |
|
429 |
||
430 |
CCalenView::TNextPopulationStep nextStep = CCalenView::EDone; |
|
431 |
||
432 |
// Get the active collection ids. |
|
433 |
RArray<TInt> colIdArray; |
|
434 |
CCalenNativeView::GetActiveCollectionidsL( iServices, colIdArray ); |
|
435 |
||
436 |
if(colIdArray.Count() > 0) |
|
437 |
{ |
|
438 |
if( !iServices.InstanceViewL(colIdArray) ) |
|
439 |
{ |
|
440 |
TRACE_EXIT_POINT; |
|
441 |
nextStep = CCalenView::EWaitForInstanceView; |
|
442 |
} |
|
443 |
else |
|
444 |
{ |
|
445 |
TRACE_EXIT_POINT; |
|
446 |
nextStep = CCalenView::EKeepGoing; |
|
447 |
} |
|
448 |
} |
|
449 |
else |
|
450 |
{ |
|
451 |
if( !iServices.InstanceViewL() ) |
|
452 |
{ |
|
453 |
TRACE_EXIT_POINT; |
|
454 |
nextStep = CCalenView::EWaitForInstanceView; |
|
455 |
} |
|
456 |
else |
|
457 |
{ |
|
458 |
TRACE_EXIT_POINT; |
|
459 |
nextStep = CCalenView::EKeepGoing; |
|
460 |
} |
|
461 |
} |
|
462 |
colIdArray.Reset(); |
|
463 |
return nextStep; |
|
464 |
} |
|
465 |
||
466 |
case ERequestedInstanceView: |
|
467 |
{ |
|
468 |
cnt->PopulateWithInstanceViewL(); |
|
469 |
iPopulationStep = ESetIndicatorNext; |
|
470 |
TRACE_EXIT_POINT; |
|
471 |
return CCalenView::EKeepGoing; |
|
472 |
} |
|
473 |
case ESetIndicatorNext: |
|
474 |
{ |
|
475 |
cnt->SetIndicatorL(); |
|
476 |
iPopulationStep = ESetFocusNext; |
|
477 |
TRACE_EXIT_POINT; |
|
478 |
return CCalenView::EKeepGoing; |
|
479 |
} |
|
480 |
case ESetFocusNext: |
|
481 |
{ |
|
482 |
cnt->SetFocusL(); |
|
483 |
iPopulationStep = EPopulationDone; |
|
484 |
TRACE_EXIT_POINT; |
|
485 |
return CCalenView::EKeepGoing; |
|
486 |
} |
|
487 |
case EPopulationDone: /* fall through... */ |
|
488 |
default: |
|
489 |
{ |
|
490 |
cnt->CompletePopulationL(); |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
491 |
|
66 | 492 |
TRACE_EXIT_POINT; |
493 |
return CCalenView::EDone; |
|
494 |
} |
|
495 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
496 |
} |
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
497 |
|
66 | 498 |
// ---------------------------------------------------------------------------- |
499 |
// CCalenMonthView::CancelPopulation |
|
500 |
// From CCalenView |
|
501 |
// (other items were commented in a header) |
|
502 |
// ---------------------------------------------------------------------------- |
|
503 |
// |
|
504 |
void CCalenMonthView::CancelPopulation() |
|
505 |
{ |
|
506 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
507 |
|
66 | 508 |
iPopulationStep = ENothingDone; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
509 |
|
66 | 510 |
TRACE_EXIT_POINT; |
511 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
512 |
|
66 | 513 |
// ---------------------------------------------------------------------------- |
514 |
// CCalenMonthView::CyclePosition |
|
515 |
// From CCalenView |
|
516 |
// (other items were commented in a header) |
|
517 |
// ---------------------------------------------------------------------------- |
|
518 |
// |
|
519 |
CCalenView::TCyclePosition CCalenMonthView::CyclePosition() const |
|
520 |
{ |
|
521 |
TRACE_ENTRY_POINT; |
|
522 |
TRACE_EXIT_POINT; |
|
523 |
return CCalenView::EReplaceMonthView; |
|
524 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
525 |
|
66 | 526 |
// ---------------------------------------------------------------------------- |
527 |
// CCalenMonthView::LocalisedViewNameL |
|
528 |
// From CCalenView |
|
529 |
// (other items were commented in a header) |
|
530 |
// ---------------------------------------------------------------------------- |
|
531 |
// |
|
532 |
const TDesC& CCalenMonthView::LocalisedViewNameL( CCalenView::TViewName aViewName ) |
|
533 |
{ |
|
534 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
535 |
|
66 | 536 |
HBufC* ret = NULL; |
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
537 |
|
66 | 538 |
switch ( aViewName ) |
539 |
{ |
|
540 |
case CCalenView::EMenuName: |
|
541 |
if ( !iMenuName ) |
|
542 |
{ |
|
543 |
iMenuName = StringLoader::LoadL( R_CALEN_VIEW_MONTH, iCoeEnv ); |
|
544 |
} |
|
545 |
ret = iMenuName; |
|
546 |
break; |
|
547 |
case CCalenView::ESettingsName: |
|
548 |
if ( !iSettingsName ) |
|
549 |
{ |
|
550 |
iSettingsName = StringLoader::LoadL( R_CALEN_QTN_DEFAULT_MONTH_VIEW, |
|
551 |
iCoeEnv ); |
|
552 |
} |
|
553 |
ret = iSettingsName; |
|
554 |
break; |
|
555 |
default: |
|
556 |
ASSERT( EFalse ); |
|
557 |
break; |
|
558 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
559 |
|
66 | 560 |
TRACE_EXIT_POINT; |
561 |
return *ret; |
|
562 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
563 |
|
66 | 564 |
// ---------------------------------------------------------------------------- |
565 |
// CCalenMonthView::ViewIconL |
|
566 |
// From CCalenView |
|
567 |
// (other items were commented in a header) |
|
568 |
// ---------------------------------------------------------------------------- |
|
569 |
// |
|
570 |
CGulIcon* CCalenMonthView::ViewIconL() const |
|
571 |
{ |
|
572 |
TRACE_ENTRY_POINT; |
|
573 |
TRACE_EXIT_POINT; |
|
574 |
return iServices.GetIconL( MCalenServices::ECalenMonthViewIcon ); |
|
575 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
576 |
|
66 | 577 |
// ---------------------------------------------------------------------------- |
578 |
// CCalenMonthView::UpdatePreviewPaneL |
|
579 |
// Updates preview pane/preview popup |
|
580 |
// (other items were commented in a header) |
|
581 |
// ---------------------------------------------------------------------------- |
|
582 |
// |
|
583 |
void CCalenMonthView::UpdatePreviewPaneL() |
|
584 |
{ |
|
585 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
586 |
|
66 | 587 |
CCalenMonthContainer* cnt = static_cast<CCalenMonthContainer*>( iContainer ); |
588 |
if(cnt) |
|
589 |
{ |
|
590 |
cnt->RedrawPreviewPane(); |
|
591 |
} |
|
592 |
||
593 |
TRACE_EXIT_POINT; |
|
594 |
} |
|
595 |
||
596 |
// ---------------------------------------------------------------------------- |
|
597 |
// CCalenMonthView::HidePreviewPane |
|
598 |
// Hides preview pane/preview popup |
|
599 |
// (other items were commented in a header) |
|
600 |
// ---------------------------------------------------------------------------- |
|
601 |
// |
|
602 |
void CCalenMonthView::HidePreviewPane() |
|
603 |
{ |
|
604 |
TRACE_ENTRY_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
605 |
|
66 | 606 |
CCalenMonthContainer* cnt = static_cast<CCalenMonthContainer*>( iContainer ); |
607 |
if(cnt) |
|
608 |
{ |
|
609 |
cnt->HidePopup(); |
|
610 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
611 |
|
66 | 612 |
TRACE_EXIT_POINT; |
613 |
} |
|
614 |
||
615 |
// End of File |