author | hgs |
Tue, 05 Oct 2010 13:57:00 +0530 | |
changeset 81 | ce92091cbd61 |
parent 75 | 7ac58b2aae6f |
child 89 | b57382753122 |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
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: Calendar view manager |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
15 |
* |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
19 |
//system includes |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
#include <hbmainwindow.h> |
45 | 21 |
#include <hbinstance.h> |
22 |
#include <hbapplication.h> // hbapplication |
|
23 |
#include <xqserviceutil.h> // service utils |
|
81 | 24 |
#include <afactivation.h> |
25 |
#include <AfActivityStorage.h> |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
//user includes |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#include "calenviewmanager.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
#include "calencontroller.h" |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
29 |
#include "hb_calencommands.hrh" |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include "calenservicesimpl.h" |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
31 |
#include "calenmonthview.h" |
45 | 32 |
#include "calenagendaview.h" |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
33 |
#include "calenmonthview.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
#include "agendaeventviewer.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
35 |
#include "calennotificationhandler.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
36 |
#include "CalenUid.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
37 |
#include "calenactionuiutils.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
#include "calensettingsview.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
39 |
#include "calendocloader.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
40 |
#include "calendarui_debug.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
41 |
#include "calencommon.h" |
45 | 42 |
#include "calendayview.h" |
55 | 43 |
#include <agendautil.h> |
51 | 44 |
#include "OstTraceDefinitions.h" |
45 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
46 |
#include "calenviewmanagerTraces.h" |
|
47 |
#endif |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
50 |
// CalenViewManager::CalenViewManager |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
// 2nd phase of construction. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
// |
45 | 55 |
CalenViewManager::CalenViewManager( CCalenController& aController) |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
: mController(aController) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
57 |
{ |
51 | 58 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_CALENVIEWMANAGER_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
|
45 | 60 |
// Following block intializes member variables |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
mCalenEventViewer = NULL; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
mMonthViewDocLoader = NULL; |
45 | 63 |
mAgendaViewDocLoader = NULL; |
64 |
mAgendaViewAltDocLoader = NULL; |
|
65 |
mCalenAgendaView = NULL; |
|
66 |
mCalenMonthView = NULL; |
|
67 |
mCalenAgendaViewAlt = NULL; |
|
68 |
mSettingsView = NULL; |
|
69 |
mCalenDayView = NULL; |
|
57 | 70 |
mInstanceViewCreated = false; |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
|
45 | 72 |
// Connect to instance view and entry view creation signals from agenda |
73 |
// interface |
|
74 |
connect(mController.agendaInterface(), SIGNAL(instanceViewCreationCompleted(int)), |
|
75 |
this, SLOT(handleInstanceViewCreation(int))); |
|
76 |
connect(mController.agendaInterface(), SIGNAL(entryViewCreationCompleted(int)), |
|
77 |
this, SLOT(handleEntryViewCreation(int))); |
|
51 | 78 |
connect(mController.agendaInterface(), SIGNAL(entriesChanged(QList<ulong>)), |
79 |
this, SLOT(handleEntriesChanged(QList<ulong>))); |
|
55 | 80 |
connect(mController.agendaInterface(), SIGNAL(entryUpdated(ulong)), |
81 |
this, SLOT(handleEntryUpdation(ulong))); |
|
82 |
connect(mController.agendaInterface(), SIGNAL(entryAdded(ulong)), |
|
83 |
this, SLOT(handleEntryUpdation(ulong))); |
|
51 | 84 |
OstTraceFunctionExit0( CALENVIEWMANAGER_CALENVIEWMANAGER_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
|
45 | 87 |
void CalenViewManager::SecondPhaseConstruction() |
88 |
{ |
|
51 | 89 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SECONDPHASECONSTRUCTION_ENTRY ); |
81 | 90 |
|
45 | 91 |
// Check if calendar is launched thru XQService framework |
92 |
bool isFromServiceFrmWrk = XQServiceUtil::isService(); // Since activateReason |
|
93 |
//of hbapplication is not returning right value if the activity is started |
|
94 |
//as services so using the above line temporarily untill a fix is available in |
|
81 | 95 |
// hbappliac |
96 |
AfActivation *activation = new AfActivation(); |
|
97 |
if(Af::ActivationReasonActivity == activation->reason()) |
|
45 | 98 |
// as an activity |
99 |
{ |
|
100 |
// Application is started from an activity |
|
101 |
// Extract activity data |
|
81 | 102 |
AfActivityStorage *activitystorage = new AfActivityStorage(); |
103 |
QVariant data = activitystorage->activityData(activation->name()); |
|
104 |
delete activitystorage; |
|
105 |
||
45 | 106 |
// Restore state from activity data |
107 |
QByteArray serializedModel = data.toByteArray(); |
|
108 |
QDataStream stream(&serializedModel, QIODevice::ReadOnly); |
|
109 |
int viewId; // int declared for debugging purpose |
|
110 |
stream >> viewId; // read stream into an int |
|
111 |
||
112 |
mFirstView = viewId; |
|
113 |
if (ECalenMonthView == viewId) // Check if Activity was stored for month view |
|
114 |
{ |
|
115 |
loadMonthView(); // Load month view |
|
116 |
} |
|
117 |
else if (ECalenAgendaView == viewId) // Check if Activity was stored for agenda view |
|
118 |
{ |
|
119 |
loadAgendaView(); // Load agenda view |
|
120 |
} |
|
121 |
||
122 |
ActivateDefaultViewL(viewId); |
|
123 |
// Connect to the view ready signal so that we can construct other views |
|
124 |
// once this view is ready |
|
125 |
connect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
126 |
this, SLOT(handleMainViewReady())); |
|
127 |
||
128 |
if (ECalenMonthView == viewId) // Check if Activity was stored for month view |
|
129 |
{ |
|
130 |
mController.MainWindow().addView(mCalenMonthView); // Add month view to main window |
|
131 |
mController.MainWindow().setCurrentView(mCalenMonthView); // Set month view as current view |
|
132 |
} |
|
133 |
else if (ECalenAgendaView == viewId) // Check if Activity was stored for agenda view |
|
134 |
{ |
|
135 |
mController.MainWindow().addView(mCalenAgendaView); // Add agenda view to main window |
|
136 |
mController.MainWindow().setCurrentView(mCalenAgendaView); // Set agenda view as current view |
|
137 |
} |
|
138 |
} else if (isFromServiceFrmWrk/*Hb::ActivationReasonService == activityReason*/) { |
|
139 |
// Dont load any views until our remote slot gets called in |
|
140 |
// calenserviceprovider.cpp |
|
141 |
// Just have an empty mainwindow |
|
142 |
} else { |
|
143 |
// Do the normal startup |
|
144 |
// Load the month view and active it and add it to main window |
|
145 |
mFirstView = ECalenMonthView; |
|
146 |
loadMonthView(); |
|
147 |
ActivateDefaultViewL(ECalenMonthView); |
|
148 |
// Connect to the view ready signal so that we construct other view |
|
149 |
// once this view is shown |
|
150 |
connect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
151 |
this, SLOT(handleMainViewReady())); |
|
152 |
||
153 |
mController.MainWindow().addView(mCalenMonthView); |
|
154 |
mController.MainWindow().setCurrentView(mCalenMonthView); |
|
155 |
} |
|
81 | 156 |
//delete the activity intsance |
157 |
delete activation; |
|
51 | 158 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SECONDPHASECONSTRUCTION_EXIT ); |
45 | 159 |
} |
160 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
// CalenViewManager::~CalenViewManager |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
163 |
// Destructor. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
CalenViewManager::~CalenViewManager() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
168 |
{ |
51 | 169 |
OstTraceFunctionEntry0( DUP1_CALENVIEWMANAGER_CALENVIEWMANAGER_ENTRY ); |
170 |
||
45 | 171 |
if (mSettingsView) { |
172 |
delete mSettingsView; |
|
173 |
mSettingsView = 0; |
|
174 |
} |
|
175 |
if (mAgendaViewDocLoader) { |
|
176 |
delete mAgendaViewDocLoader; |
|
177 |
mAgendaViewDocLoader = 0; |
|
178 |
} |
|
179 |
if (mAgendaViewAltDocLoader) { |
|
180 |
delete mAgendaViewAltDocLoader; |
|
181 |
mAgendaViewAltDocLoader = 0; |
|
182 |
} |
|
183 |
if (mMonthViewDocLoader) { |
|
184 |
delete mMonthViewDocLoader; |
|
185 |
mMonthViewDocLoader = 0; |
|
186 |
} |
|
51 | 187 |
|
188 |
OstTraceFunctionExit0( DUP1_CALENVIEWMANAGER_CALENVIEWMANAGER_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
189 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
192 |
// CalenViewManager::constructAndActivateView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
193 |
// Constructs and activates the requested view |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
197 |
void CalenViewManager::constructAndActivateView(int view) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
198 |
{ |
51 | 199 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_ENTRY ); |
200 |
||
201 |
// We are here because, some other application is launching calendar with |
|
45 | 202 |
// the view, hence connect to viewReady() signal to do any lazy loading |
203 |
// in the slot |
|
204 |
||
205 |
// Connect to the view ready signal so that we construct other view |
|
206 |
// once this view is shown |
|
207 |
connect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
208 |
this, SLOT(handleMainViewReady())); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
if (view == ECalenMonthView) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
210 |
mFirstView = ECalenMonthView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
211 |
loadMonthView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
ActivateDefaultViewL(ECalenMonthView); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
213 |
// Add month view to mainwindow. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
214 |
mController.MainWindow().addView(mCalenMonthView); |
45 | 215 |
mController.MainWindow().setCurrentView(mCalenMonthView); |
216 |
} else if (view == ECalenAgendaView) { |
|
217 |
mFirstView = ECalenAgendaView; |
|
218 |
loadAgendaView(); |
|
219 |
ActivateDefaultViewL(ECalenAgendaView); |
|
220 |
// Add agenda view to mainwindow. |
|
221 |
mController.MainWindow().addView(mCalenAgendaView); |
|
222 |
mController.MainWindow().setCurrentView(mCalenAgendaView); |
|
57 | 223 |
mController.MainWindow().addView(mCalenAgendaViewAlt); |
75 | 224 |
} else if (view == ECalenDayView) { |
225 |
mFirstView = ECalenDayView; |
|
226 |
loadDayView(); |
|
227 |
ActivateDefaultViewL(ECalenDayView); |
|
228 |
// Add day view to mainwindow. |
|
229 |
mController.MainWindow().addView(mCalenDayView); |
|
230 |
mController.MainWindow().setCurrentView(mCalenDayView); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
231 |
} |
51 | 232 |
OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
233 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
234 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
// CalenViewManager::loadMonthView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
// Loads month view frm the docml |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
241 |
void CalenViewManager::loadMonthView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
242 |
{ |
51 | 243 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LOADMONTHVIEW_ENTRY ); |
244 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
245 |
bool loadSuccess = false; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
246 |
Qt::Orientation currentOrienation = mController.MainWindow().orientation(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
// Create the month view docloader object. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
mMonthViewDocLoader = new CalenDocLoader(mController); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
mMonthViewDocLoader->load(CALEN_MONTHVIEW_XML_FILE, &loadSuccess); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
Q_ASSERT_X(loadSuccess, "calenviewmanager.cpp", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
"Unable to load month view XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
// Based on the current orientation, load the appropriate section |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
if (Qt::Vertical == currentOrienation) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
mMonthViewDocLoader->load(CALEN_MONTHVIEW_XML_FILE, |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
CALEN_PORTRAIT, &loadSuccess); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
256 |
} else { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
257 |
mMonthViewDocLoader->load(CALEN_MONTHVIEW_XML_FILE, |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
CALEN_LANDSCAPE, &loadSuccess); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
259 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
260 |
Q_ASSERT_X(loadSuccess, "calenviewmanager.cpp", "Unable to load XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
261 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
262 |
// Get the calenmonth view from the loader. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
mCalenMonthView = static_cast<CalenMonthView *> |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
264 |
(mMonthViewDocLoader->findWidget(CALEN_MONTHVIEW)); |
45 | 265 |
Q_ASSERT_X(mCalenMonthView, "calenviewmanager.cpp", |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
266 |
"Unable to load calenMonth view"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
267 |
|
64 | 268 |
// Set the parent to delete the view once will exit the application |
269 |
mCalenMonthView->setParent(this); |
|
270 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
271 |
// Setup the month view. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
272 |
mCalenMonthView->setupView(mMonthViewDocLoader); |
51 | 273 |
|
274 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LOADMONTHVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
275 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
// ---------------------------------------------------------------------------- |
45 | 278 |
// CalenViewManager::loadAgendaView |
279 |
// Loads the agenda view frm the docml |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
// |
45 | 283 |
void CalenViewManager::loadAgendaView() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
284 |
{ |
51 | 285 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LOADAGENDAVIEW_ENTRY ); |
286 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
287 |
bool loadSuccess = false; |
45 | 288 |
// Create the agenda view docloader object. |
289 |
mAgendaViewDocLoader = new CalenDocLoader(mController); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
290 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
291 |
// Load default section |
45 | 292 |
mAgendaViewDocLoader->load(CALEN_AGENDAVIEW_XML_FILE, &loadSuccess); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
293 |
if (!loadSuccess) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
294 |
qFatal("calenviewmanager.cpp : Unable to load XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
295 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
296 |
|
45 | 297 |
// Get the calenagenda view from the loader |
298 |
mCalenAgendaView = static_cast<CalenAgendaView *> (mAgendaViewDocLoader->findWidget(CALEN_AGENDAVIEW)); |
|
299 |
if (!mCalenAgendaView) { |
|
300 |
qFatal("calenviewmanager.cpp : Unable to find agenda view"); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
301 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
302 |
|
64 | 303 |
// Set the parent to delete the view once will exit the application |
304 |
mCalenAgendaView->setParent(this); |
|
305 |
||
45 | 306 |
// Setup the agenda view |
307 |
mCalenAgendaView->setupView(mAgendaViewDocLoader); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
308 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
309 |
// The following code is done to provide swipe support |
45 | 310 |
// in agenda view. Idea is to create two views and keep |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
311 |
// switiching between these two using view switch effects |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
312 |
// to provide an illusion of flow to the user |
45 | 313 |
loadAlternateAgendaView(); |
314 |
||
51 | 315 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LOADAGENDAVIEW_EXIT ); |
45 | 316 |
} |
317 |
||
318 |
// ---------------------------------------------------------------------------- |
|
55 | 319 |
// CalenViewManager::loadDayView |
320 |
// Loads day view from the docml |
|
321 |
// ---------------------------------------------------------------------------- |
|
322 |
void CalenViewManager::loadDayView() |
|
323 |
{ |
|
324 |
bool loadSuccess = false; |
|
325 |
||
326 |
// Create the docloader object |
|
327 |
CalenDocLoader *docLoader = new CalenDocLoader(mController); |
|
328 |
||
329 |
if (docLoader) { |
|
330 |
docLoader->load(CALEN_DAYVIEW_DOCML, &loadSuccess); |
|
331 |
if (!loadSuccess) { |
|
332 |
qFatal("calenviewmanager.cpp : Unable to load day view XML"); |
|
333 |
} |
|
334 |
||
335 |
// Get the CalenDayView object from the loader |
|
336 |
mCalenDayView = static_cast<CalenDayView *> |
|
337 |
(docLoader->findWidget(CALEN_DAYVIEW)); |
|
338 |
if (!mCalenDayView) { |
|
339 |
qFatal("calenviewmanager.cpp : Unable to find day view"); |
|
340 |
} |
|
341 |
||
64 | 342 |
// Set the parent to delete the view once will exit the application |
343 |
mCalenDayView->setParent(this); |
|
344 |
||
55 | 345 |
// Set up the day view - day view takes the ownership |
346 |
mCalenDayView->setupView(docLoader); |
|
347 |
} |
|
348 |
} |
|
349 |
||
350 |
// ---------------------------------------------------------------------------- |
|
45 | 351 |
// CalenViewManager::handleMainViewReady |
352 |
// Slot to handle viewReady() signal from mainwindow |
|
353 |
// (other items were commented in a header). |
|
354 |
// ---------------------------------------------------------------------------- |
|
355 |
// |
|
356 |
void CalenViewManager::handleMainViewReady() |
|
357 |
{ |
|
51 | 358 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEMAINVIEWREADY_ENTRY ); |
359 |
||
45 | 360 |
// Construct the month view part that is kept for lazy loading |
57 | 361 |
if (mCalenMonthView) { |
45 | 362 |
mCalenMonthView->doLazyLoading(); |
57 | 363 |
|
364 |
if (mInstanceViewCreated) { |
|
365 |
// populate entries for the month view if the month view is launched |
|
366 |
// from the service APIs. Otherwise the month view is not populated with |
|
367 |
// the entries as CalenViewManager::handleInstanceViewCreation is called |
|
368 |
// before the month view creation so the model array is not populated. |
|
369 |
mCalenMonthView->fetchEntriesAndUpdateModel(); |
|
370 |
} |
|
371 |
||
45 | 372 |
} |
373 |
||
374 |
// Construct other views |
|
375 |
constructOtherViews(); |
|
376 |
||
377 |
// Install the event filter for the controller once the view is ready |
|
378 |
// so that system language/locale changes can be handled |
|
379 |
//hbInstance->allMainWindows().first()->installEventFilter(&mController); |
|
380 |
||
381 |
// disconnect the view ready signal as we dont need it anymore |
|
382 |
disconnect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
383 |
this, SLOT(handleMainViewReady())); |
|
51 | 384 |
|
385 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEMAINVIEWREADY_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
386 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
389 |
// CalenViewManager::constructOtherViews |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
390 |
// Constructs the other views apart frm firstview and adds them to main window |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
394 |
void CalenViewManager::constructOtherViews() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
395 |
{ |
51 | 396 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_ENTRY ); |
397 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
398 |
// Load all other views except mFirstView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
399 |
|
75 | 400 |
// NOTE: Right now, since Calendar has three views, month view, day view |
45 | 401 |
// and agenda view, when client launches agenda view, then there is no need |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
402 |
// to construct the month view as per UI REQ., but tomorrow if new views |
45 | 403 |
// come after agenda view, then we need to construct those views if they are |
75 | 404 |
// native views. Right now, day view will be constructed as we need to |
405 |
// provide an option in options menu to switch between day view and agenda view |
|
406 |
// There is a event viewer but its not a native view, so no need to constrcut it |
|
407 |
// It will be constrcuted on demand. |
|
408 |
// Hence, if agenda view is launched, constrcut the day vuew but dont construct month view. |
|
409 |
// Vice-versa for when day view is maunched as first view |
|
410 |
if (mFirstView == ECalenMonthView) { |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
411 |
// Load all other views |
45 | 412 |
loadAgendaView(); |
413 |
||
414 |
if (!mCalenDayView) { |
|
55 | 415 |
loadDayView(); |
45 | 416 |
} |
75 | 417 |
} else if (mFirstView == ECalenAgendaView) { //agenda view was launched as first view |
418 |
// Load day view |
|
419 |
if (!mCalenDayView) { |
|
420 |
loadDayView(); |
|
421 |
} |
|
422 |
} else if (mFirstView == ECalenDayView) { // Day view was launched as first view |
|
423 |
// Load agenda view |
|
424 |
loadAgendaView(); |
|
425 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
426 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
427 |
// Setup the settings view |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
428 |
mSettingsView = new CalenSettingsView(mController.Services()); |
51 | 429 |
|
430 |
OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
431 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
434 |
// CalenViewManager::getFirstView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
435 |
// Returns the first view |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
439 |
int CalenViewManager::getFirstView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
440 |
{ |
51 | 441 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_GETFIRSTVIEW_ENTRY ); |
442 |
||
443 |
OstTraceFunctionExit0( CALENVIEWMANAGER_GETFIRSTVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
444 |
return mFirstView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
445 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
448 |
// CalenViewManager::showNextDay |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
449 |
// other items were commented in a header |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
450 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
451 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
452 |
void CalenViewManager::showNextDay() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
453 |
{ |
51 | 454 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SHOWNEXTDAY_ENTRY ); |
455 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
456 |
// Set the context for the next day |
45 | 457 |
QDateTime currentDay = mController.Services().Context().focusDateAndTime(); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
458 |
currentDay = currentDay.addDays(1); |
45 | 459 |
mController.Services().Context().setFocusDate(currentDay); |
460 |
mCurrentViewId = ECalenAgendaView; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
461 |
// Check which is the currently activated view |
45 | 462 |
if (mController.MainWindow().currentView() == mCalenAgendaView) { |
463 |
mCalenAgendaView->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaView to get aboutToQuit Events |
|
464 |
HbEffect::add(mCalenAgendaView, |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
465 |
":/fxml/view_hide", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
466 |
"hide"); |
45 | 467 |
HbEffect::add(mCalenAgendaViewAlt, |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
468 |
":/fxml/view_show", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
469 |
"show"); |
45 | 470 |
// Set the other agenda view as the current view |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
471 |
// and animate to provide illusion of swipe |
45 | 472 |
// It would also connect for aboutToQuit events |
473 |
mCalenAgendaViewAlt->doPopulation(); |
|
474 |
mController.MainWindow().setCurrentView(mCalenAgendaViewAlt, true, Hb::ViewSwitchUseNormalAnim); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
475 |
} else { |
45 | 476 |
mCalenAgendaViewAlt->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaViewAlt to get aboutToQuit Events |
477 |
HbEffect::add(mCalenAgendaViewAlt, |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
478 |
":/fxml/view_hide", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
479 |
"hide"); |
45 | 480 |
HbEffect::add(mCalenAgendaView, |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
481 |
":/fxml/view_show", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
482 |
"show"); |
45 | 483 |
// It would also connect for aboutToQuit events |
484 |
mCalenAgendaView->doPopulation(); |
|
485 |
mController.MainWindow().setCurrentView(mCalenAgendaView, true, Hb::ViewSwitchUseNormalAnim); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
} |
51 | 487 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SHOWNEXTDAY_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
488 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
491 |
// CalenViewManager::showPrevDay |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
492 |
// other items were commented in a header |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
495 |
void CalenViewManager::showPrevDay() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
496 |
{ |
51 | 497 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SHOWPREVDAY_ENTRY ); |
498 |
||
45 | 499 |
QDateTime currentDay = mController.Services().Context().focusDateAndTime(); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
500 |
currentDay = currentDay.addDays(-1); |
45 | 501 |
mController.Services().Context().setFocusDate(currentDay); |
502 |
mCurrentViewId = ECalenAgendaView; |
|
503 |
if (mController.MainWindow().currentView() == mCalenAgendaView) { |
|
504 |
mCalenAgendaView->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaView to get aboutToQuit Events |
|
505 |
HbEffect::add(mCalenAgendaView, |
|
506 |
":/fxml/view_hide_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
507 |
"hide"); |
45 | 508 |
HbEffect::add(mCalenAgendaViewAlt, |
509 |
":/fxml/view_show_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
510 |
"show"); |
45 | 511 |
// It would also connect for aboutToQuit events |
512 |
mCalenAgendaViewAlt->doPopulation(); |
|
513 |
mController.MainWindow().setCurrentView(mCalenAgendaViewAlt, true, Hb::ViewSwitchUseNormalAnim); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
514 |
} else { |
45 | 515 |
mCalenAgendaViewAlt->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaViewAlt to get aboutToQuit Events |
516 |
HbEffect::add(mCalenAgendaViewAlt, |
|
517 |
":/fxml/view_hide_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
518 |
"hide"); |
45 | 519 |
HbEffect::add(mCalenAgendaView, |
520 |
":/fxml/view_show_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
521 |
"show"); |
45 | 522 |
// It would also connect for aboutToQuit events |
523 |
mCalenAgendaView->doPopulation(); |
|
524 |
mController.MainWindow().setCurrentView(mCalenAgendaView, true, Hb::ViewSwitchUseNormalAnim); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
525 |
} |
51 | 526 |
|
527 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SHOWPREVDAY_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
528 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
// ---------------------------------------------------------------------------- |
45 | 531 |
// CalenViewManager::removePreviousView |
532 |
// Remove the previous view from main window |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
533 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
534 |
// |
45 | 535 |
void CalenViewManager::removePreviousView() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
536 |
{ |
51 | 537 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_REMOVEPREVIOUSVIEW_ENTRY ); |
538 |
||
45 | 539 |
if (ECalenAgendaView == mCurrentViewId) { |
540 |
mCalenAgendaView->clearListModel(); |
|
541 |
mCalenAgendaViewAlt->clearListModel(); |
|
542 |
mController.MainWindow().removeView(mCalenAgendaView); |
|
543 |
mController.MainWindow().removeView(mCalenAgendaViewAlt); |
|
544 |
} else if (ECalenDayView == mCurrentViewId) { |
|
545 |
mController.MainWindow().removeView(mCalenDayView); |
|
546 |
} else { |
|
547 |
if (ECalenMonthView == mCurrentViewId) { |
|
548 |
mController.MainWindow().removeView(mCalenMonthView); |
|
549 |
} |
|
550 |
} |
|
551 |
||
51 | 552 |
OstTraceFunctionExit0( CALENVIEWMANAGER_REMOVEPREVIOUSVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
553 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
554 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
555 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
556 |
// CalenViewManager::~ActivateDefaultViewL |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
557 |
// Activates the default view, as retrieved from settings. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
559 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
561 |
void CalenViewManager::ActivateDefaultViewL(int defaultView) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
562 |
{ |
51 | 563 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_ENTRY ); |
564 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
565 |
mCurrentViewId = defaultView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
566 |
if (ECalenMonthView == defaultView) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
567 |
mCalenMonthView->doPopulation(); |
45 | 568 |
} else if (ECalenAgendaView == defaultView) { |
569 |
mCalenAgendaView->doPopulation(); |
|
75 | 570 |
} else if (ECalenDayView == defaultView) { |
571 |
mCalenDayView->doPopulation(); |
|
572 |
} |
|
573 |
||
51 | 574 |
OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
575 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
576 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
577 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
578 |
// Refresh current view. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
579 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
580 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
581 |
void CalenViewManager::refreshCurrentViewL() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
582 |
{ |
51 | 583 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_REFRESHCURRENTVIEWL_ENTRY ); |
584 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
585 |
activateCurrentView(); |
51 | 586 |
|
587 |
OstTraceFunctionExit0( CALENVIEWMANAGER_REFRESHCURRENTVIEWL_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
589 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
590 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
591 |
// Activate current view. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
592 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
593 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
594 |
void CalenViewManager::activateCurrentView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
595 |
{ |
51 | 596 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_ACTIVATECURRENTVIEW_ENTRY ); |
597 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
598 |
switch (mCurrentViewId) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
599 |
case ECalenMonthView: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
600 |
mCalenMonthView->doPopulation(); |
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
601 |
mController.MainWindow().setCurrentView(mCalenMonthView); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
602 |
break; |
45 | 603 |
case ECalenAgendaView: |
604 |
if (mController.MainWindow().currentView() == mCalenAgendaView) { |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
605 |
// This happens when settings view or event viewer is opened |
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
606 |
// from the agenda view. Simply repopulate the view |
45 | 607 |
if (mCalenAgendaView) { |
608 |
mCalenAgendaView->doPopulation(); |
|
609 |
mController.MainWindow().setCurrentView(mCalenAgendaView); |
|
610 |
} |
|
611 |
} else if (mController.MainWindow().currentView() == mCalenAgendaViewAlt){ |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
612 |
// This happens when settings view or event viewer is opened |
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
613 |
// from the agenda view. Simply repopulate the view |
45 | 614 |
if (mCalenAgendaViewAlt) { |
615 |
mCalenAgendaViewAlt->doPopulation(); |
|
616 |
mController.MainWindow().setCurrentView(mCalenAgendaViewAlt); |
|
617 |
} |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
618 |
} else { |
45 | 619 |
// This is called whenever the agenda view is opened from the month |
620 |
// view. Since the agenda view is not added to the mainwindow, |
|
621 |
// add the agenda views to mainwindow and set any one of them as |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
622 |
// current view |
45 | 623 |
if (mCalenAgendaView) { |
624 |
mCalenAgendaView->doPopulation(); |
|
625 |
mController.MainWindow().addView(mCalenAgendaView); |
|
626 |
mController.MainWindow().setCurrentView(mCalenAgendaView); |
|
627 |
mController.MainWindow().addView(mCalenAgendaViewAlt); |
|
628 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
629 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
630 |
break; |
45 | 631 |
case ECalenShowSettings: |
632 |
mSettingsView->refreshView(); |
|
633 |
break; |
|
634 |
case ECalenDayView: |
|
635 |
mCalenDayView->doPopulation(); |
|
636 |
mController.MainWindow().setCurrentView(mCalenDayView); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
637 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
638 |
} |
51 | 639 |
|
640 |
OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATECURRENTVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
641 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
642 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
643 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
644 |
// CalenViewManager::launchEventView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
645 |
// Launch event view. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
646 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
647 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
648 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
649 |
void CalenViewManager::launchEventView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
650 |
{ |
51 | 651 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LAUNCHEVENTVIEW_ENTRY ); |
652 |
||
45 | 653 |
// capture cureent view in case app closed/quits from AgendaEventViewer |
654 |
if (mCalenMonthView) { |
|
655 |
mCalenMonthView->captureScreenshot(true); |
|
656 |
} |
|
657 |
else if (mCalenAgendaView) { |
|
658 |
mCalenAgendaView->captureScreenshot(true); |
|
659 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
660 |
MCalenContext& context = mController.Services().Context(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
661 |
AgendaEntry viewEntry= mController.Services().agendaInterface()->fetchById( |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
662 |
context.instanceId().mEntryLocalUid ); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
663 |
if (viewEntry.isRepeating() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
664 |
&& viewEntry.type() != AgendaEntry::TypeTodo) { |
45 | 665 |
QDateTime startDateTime = context.focusDateAndTime(); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
666 |
viewEntry.setStartAndEndTime(startDateTime, |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
667 |
startDateTime.addSecs(viewEntry.durationInSecs())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
668 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
669 |
mCalenEventViewer = new AgendaEventViewer( |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
670 |
mController.Services().agendaInterface(), this); |
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
671 |
connect(mCalenEventViewer, SIGNAL(viewingCompleted(const QDate)), |
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
672 |
this, SLOT(handleViewingCompleted(const QDate))); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
673 |
connect(mCalenEventViewer, SIGNAL(editingStarted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
674 |
this, SLOT(handleEditingStarted())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
675 |
connect(mCalenEventViewer, SIGNAL(editingCompleted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
676 |
this, SLOT(handleEditingCompleted())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
677 |
connect(mCalenEventViewer, SIGNAL(deletingStarted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
678 |
this, SLOT(handleDeletingStarted())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
679 |
connect(mCalenEventViewer, SIGNAL(deletingCompleted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
680 |
this, SLOT(handleDeletingCompleted())); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
681 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
682 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
683 |
// Launch agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
684 |
mCalenEventViewer->view(viewEntry, AgendaEventViewer::ActionEditDelete); |
51 | 685 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LAUNCHEVENTVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
686 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
687 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
688 |
// ---------------------------------------------------------------------------- |
45 | 689 |
// CalenViewManager::loadAlternateAgendaView |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
690 |
// other items were commented in a header |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
691 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
692 |
// |
45 | 693 |
void CalenViewManager::loadAlternateAgendaView() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
694 |
{ |
51 | 695 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LOADALTERNATEAGENDAVIEW_ENTRY ); |
696 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
697 |
bool loadSuccess = false; |
45 | 698 |
// Create the agenda view docloader object. |
699 |
mAgendaViewAltDocLoader = new CalenDocLoader(mController); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
700 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
701 |
// Load default section |
45 | 702 |
mAgendaViewAltDocLoader->load(CALEN_AGENDAVIEW_XML_FILE, &loadSuccess); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
703 |
if (!loadSuccess) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
704 |
qFatal("calenviewmanager.cpp : Unable to load XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
705 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
706 |
|
45 | 707 |
// Get the calenagenda view from the loader |
708 |
mCalenAgendaViewAlt = static_cast<CalenAgendaView *> (mAgendaViewAltDocLoader->findWidget(CALEN_AGENDAVIEW)); |
|
709 |
if (!mCalenAgendaViewAlt) { |
|
710 |
qFatal("calenviewmanager.cpp : Unable to find alternate agenda view"); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
711 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
712 |
|
64 | 713 |
// Set the parent to delete the view once will exit the application |
714 |
mCalenAgendaViewAlt->setParent(this); |
|
715 |
||
45 | 716 |
// Setup the agenda view |
717 |
mCalenAgendaViewAlt->setupView(mAgendaViewAltDocLoader); |
|
51 | 718 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LOADALTERNATEAGENDAVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
719 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
720 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
721 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
722 |
// CalenViewManager::HandleCommandL |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
723 |
// Handles view manager commands. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
724 |
// @return ETrue if command is handled, EFalse otherwise |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
725 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
726 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
727 |
TBool CalenViewManager::HandleCommandL(const TCalenCommand& command) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
728 |
{ |
51 | 729 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLECOMMANDL_ENTRY ); |
730 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
731 |
TBool commandUsed(EFalse); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
732 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
733 |
switch (command.Command()) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
734 |
case ECalenMonthView: |
45 | 735 |
// First remove the previous native view before |
736 |
// we set the mCurrentViewId with the current view |
|
737 |
removePreviousView(); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
738 |
// Add month view to mainwindow. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
739 |
mController.MainWindow().addView(mCalenMonthView); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
740 |
mCurrentViewId = ECalenMonthView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
741 |
activateCurrentView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
742 |
break; |
45 | 743 |
case ECalenAgendaView: |
744 |
// First remove the previous native view before |
|
745 |
// we set the mCurrentViewId with the current view |
|
746 |
removePreviousView(); |
|
747 |
mCurrentViewId = ECalenAgendaView; |
|
748 |
activateCurrentView(); |
|
749 |
break; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
750 |
case ECalenDayView: |
45 | 751 |
{ |
55 | 752 |
// First add new view |
45 | 753 |
mController.MainWindow().addView(mCalenDayView); |
55 | 754 |
|
755 |
// Removes current view |
|
756 |
// Notice: removing view should be done after new view is set as current to |
|
757 |
// avoid situation that there is no current view in application |
|
758 |
removePreviousView(); |
|
759 |
||
760 |
// Sets and activates day view |
|
761 |
mCurrentViewId = ECalenDayView; |
|
762 |
activateCurrentView(); |
|
45 | 763 |
} |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
764 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
765 |
case ECalenEventView: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
766 |
launchEventView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
767 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
768 |
case ECalenStartActiveStep: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
769 |
activateCurrentView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
770 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
771 |
case ECalenShowNextDay: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
772 |
showNextDay(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
773 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
774 |
case ECalenShowPrevDay: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
775 |
showPrevDay(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
776 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
777 |
} |
51 | 778 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLECOMMANDL_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
779 |
return commandUsed; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
780 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
781 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
782 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
783 |
// CalenViewManager::HandleNotification |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
784 |
// Handles notifications. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
785 |
// (other items were commented in a header). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
786 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
787 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
788 |
void CalenViewManager::HandleNotification( |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
789 |
const TCalenNotification notification) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
790 |
{ |
51 | 791 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLENOTIFICATION_ENTRY ); |
792 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
793 |
switch (notification) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
794 |
case ECalenNotifyExternalDatabaseChanged: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
795 |
case ECalenNotifyDialogClosed: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
796 |
case ECalenNotifyMultipleEntriesDeleted: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
797 |
case ECalenNotifyEntrySaved: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
798 |
case ECalenNotifyEntryDeleted: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
799 |
case ECalenNotifyInstanceDeleted: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
800 |
case ECalenNotifyEntryClosed: |
45 | 801 |
case ECalenNotifySystemLocaleChanged: |
55 | 802 |
case ECalenNotifySystemTimeChanged: |
51 | 803 |
case ECalenNotifySystemLanguageChanged: { |
55 | 804 |
|
805 |
if (notification == ECalenNotifySystemTimeChanged) { |
|
806 |
MCalenContext &context = mController.context(); |
|
807 |
QDateTime defaultTime = context.defaultCalTimeForViewsL(); |
|
808 |
context.setFocusDateAndTime(defaultTime); |
|
809 |
} |
|
810 |
activateCurrentView(); |
|
811 |
if (mCalenMonthView) { |
|
812 |
mCalenMonthView->captureScreenshot(); |
|
813 |
} else if (mCalenAgendaView) { |
|
814 |
mCalenAgendaView->captureScreenshot(); |
|
815 |
} |
|
51 | 816 |
} |
45 | 817 |
break; |
51 | 818 |
case ECalenNotifySettingsClosed: { |
45 | 819 |
//when setting view closed , switch to the previous view |
820 |
mCurrentViewId = mPreviousViewsId ; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
821 |
mController.Services().IssueCommandL(ECalenStartActiveStep); |
45 | 822 |
|
823 |
// invalidate captured screenshots as either agenda view is activated now |
|
824 |
if (mCalenMonthView) { |
|
825 |
mCalenMonthView->captureScreenshot(); |
|
826 |
} else if (mCalenAgendaView) { |
|
827 |
mCalenAgendaView->captureScreenshot(); |
|
828 |
} |
|
829 |
||
830 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
831 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
832 |
default: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
833 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
834 |
} |
51 | 835 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLENOTIFICATION_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
836 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
837 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
838 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
839 |
// CalenViewManager::settingsView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
840 |
// Returns the settings view |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
841 |
// (other items were commented in a header). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
842 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
843 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
844 |
CalenSettingsView* CalenViewManager::settingsView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
845 |
{ |
51 | 846 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SETTINGSVIEW_ENTRY ); |
847 |
||
848 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SETTINGSVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
849 |
return mSettingsView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
850 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
851 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
852 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
853 |
// CalenViewManager::handleViewingCompleted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
854 |
// Slot to handle signal viewingCompleted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
855 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
856 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
857 |
// |
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
858 |
void CalenViewManager::handleViewingCompleted(const QDate date) |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
859 |
{ |
55 | 860 |
Q_UNUSED(date); |
51 | 861 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEVIEWINGCOMPLETED_ENTRY ); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
862 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
863 |
// Cleanup. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
864 |
mCalenEventViewer->deleteLater(); |
55 | 865 |
if (!date.isNull() && date.isValid()) { |
866 |
mController.Services().Context().setFocusDate(QDateTime(date)); |
|
867 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
868 |
mController.Services().IssueNotificationL(ECalenNotifyEntryClosed); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
869 |
|
45 | 870 |
// invalidate captured screenshots as either agenda view is activated now |
871 |
if (mCalenMonthView) { |
|
872 |
mCalenMonthView->captureScreenshot(); |
|
873 |
} else if (mCalenAgendaView) { |
|
874 |
mCalenAgendaView->captureScreenshot(); |
|
875 |
} |
|
51 | 876 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEVIEWINGCOMPLETED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
877 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
878 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
879 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
880 |
// CalenViewManager::handleEditingStarted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
881 |
// Slot to handle signal editingStarted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
882 |
// (other items were commented in a header). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
883 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
884 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
885 |
void CalenViewManager::handleEditingStarted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
886 |
{ |
51 | 887 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEEDITINGSTARTED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
888 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
889 |
mController.IssueCommandL(ECalenEditEntryFromViewer); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
890 |
|
51 | 891 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEEDITINGSTARTED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
892 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
893 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
894 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
895 |
// CalenViewManager::handleEditingCompleted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
896 |
// Slot to handle signal editingCompleted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
897 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
898 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
899 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
900 |
void CalenViewManager::handleEditingCompleted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
901 |
{ |
51 | 902 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEEDITINGCOMPLETED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
903 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
904 |
mController.Services().IssueNotificationL(ECalenNotifyEditorClosedFromViewer); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
905 |
|
51 | 906 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEEDITINGCOMPLETED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
907 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
908 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
909 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
910 |
// CalenViewManager::handleDeletingStarted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
911 |
// Slot to handle signal deletingStarted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
912 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
913 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
914 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
915 |
void CalenViewManager::handleDeletingStarted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
916 |
{ |
51 | 917 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEDELETINGSTARTED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
918 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
919 |
mController.IssueCommandL(ECalenDeleteEntryFromViewer); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
920 |
|
51 | 921 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEDELETINGSTARTED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
922 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
923 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
924 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
925 |
// CalenViewManager::handleDeletingCompleted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
926 |
// Slot to handle signal deletingCompleted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
927 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
928 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
929 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
930 |
void CalenViewManager::handleDeletingCompleted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
931 |
{ |
51 | 932 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEDELETINGCOMPLETED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
933 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
934 |
mController.Services().IssueNotificationL(ECalenNotifyEntryDeleted); |
45 | 935 |
|
936 |
// invalidate captured screenshots as either month view or agenda view is activated now |
|
937 |
if (mCalenMonthView) { |
|
938 |
mCalenMonthView->captureScreenshot(); |
|
939 |
} else if (mCalenAgendaView) { |
|
940 |
mCalenAgendaView->captureScreenshot(); |
|
941 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
942 |
|
51 | 943 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEDELETINGCOMPLETED_EXIT ); |
45 | 944 |
} |
945 |
||
946 |
// ---------------------------------------------------------------------------- |
|
947 |
// CalenViewManager::handleInstanceViewCreation |
|
948 |
// Slot to handle completion of instance view creation |
|
949 |
// (other items were commented in a header). |
|
950 |
// ---------------------------------------------------------------------------- |
|
951 |
// |
|
952 |
void CalenViewManager::handleInstanceViewCreation(int status) |
|
953 |
{ |
|
51 | 954 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEINSTANCEVIEWCREATION_ENTRY ); |
955 |
||
45 | 956 |
Q_UNUSED(status); |
57 | 957 |
|
958 |
// This flag is needed if mCalenMonthView and mCalenAgendaview is not created |
|
959 |
// and before that this slot is getting called. |
|
960 |
// if we launch views through services then this slot is getting called |
|
961 |
// before the view construction. |
|
962 |
mInstanceViewCreated = true; |
|
963 |
||
45 | 964 |
// handleInstanceViewCreation function is called only once. Now that the instance |
965 |
// view creation is successfull. Events need to be populated on screen |
|
966 |
// Ideal colution should be to call a uniform function, e.g. PopulateEvents |
|
967 |
// where PopulateEvents should be implemeted by all views. Since the current |
|
968 |
// solution for the month view implements the construction in two phases so |
|
969 |
// it needs to be refactored and a common solution needs to be put here. So |
|
970 |
// that code doesn't break if another view is added tomorow |
|
63 | 971 |
HbView *currentview = mController.MainWindow().currentView(); |
972 |
||
973 |
if (mCalenMonthView && currentview == mCalenMonthView) { |
|
45 | 974 |
mCalenMonthView->fetchEntriesAndUpdateModel(); |
975 |
} |
|
63 | 976 |
else if (mCalenAgendaView && currentview == mCalenAgendaView) { |
45 | 977 |
mCalenAgendaView->doPopulation(); |
978 |
} |
|
64 | 979 |
else if (mCalenDayView && currentview == mCalenDayView) { |
980 |
mCalenDayView->doPopulation(); |
|
981 |
} |
|
55 | 982 |
// Calls the emitAppReady function of CalenController. Need to emit this |
983 |
// signal after the view is fully constructed & populated |
|
984 |
// with actual data and ready to be used. So entry view & instance view |
|
985 |
// needs to be created so that a new entry can also be created. Finally |
|
986 |
// NotesApplication object needs to emit applicationReady Signal. |
|
987 |
mController.emitAppReady(); |
|
51 | 988 |
|
989 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEINSTANCEVIEWCREATION_EXIT ); |
|
45 | 990 |
} |
991 |
||
992 |
// ---------------------------------------------------------------------------- |
|
993 |
// CalenViewManager::handleDeletingCompleted |
|
994 |
// Slot to handle completion of entry view creation |
|
995 |
// (other items were commented in a header). |
|
996 |
// ---------------------------------------------------------------------------- |
|
997 |
// |
|
998 |
void CalenViewManager::handleEntryViewCreation(int status) |
|
999 |
{ |
|
51 | 1000 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEENTRYVIEWCREATION_ENTRY ); |
1001 |
||
45 | 1002 |
// Nothing Yet |
1003 |
Q_UNUSED(status); |
|
51 | 1004 |
|
1005 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEENTRYVIEWCREATION_EXIT ); |
|
45 | 1006 |
} |
1007 |
||
1008 |
// ---------------------------------------------------------------------------- |
|
51 | 1009 |
// CalenViewManager::handleEntriesChanged |
1010 |
// this function will be called when someone else has changed the database |
|
1011 |
// ---------------------------------------------------------------------------- |
|
1012 |
// |
|
1013 |
void CalenViewManager::handleEntriesChanged(QList<ulong> ids) |
|
1014 |
{ |
|
55 | 1015 |
Q_UNUSED(ids); |
57 | 1016 |
HbView *currentview = mController.MainWindow().currentView(); |
1017 |
if((mCalenMonthView == currentview)||(mCalenDayView == currentview)|| |
|
81 | 1018 |
(mCalenAgendaView == currentview )||(mCalenAgendaViewAlt == currentview)) |
57 | 1019 |
{ |
1020 |
activateCurrentView(); |
|
1021 |
} |
|
81 | 1022 |
delete currentview; |
45 | 1023 |
} |
1024 |
||
1025 |
// ---------------------------------------------------------------------------- |
|
55 | 1026 |
// CalenViewManager::handleEntryUpdation |
1027 |
// this function will be called when any entry is updated or added into database |
|
1028 |
// Here we need to set the context to the entry updated or added. |
|
1029 |
// ---------------------------------------------------------------------------- |
|
1030 |
// |
|
1031 |
void CalenViewManager::handleEntryUpdation(ulong id) |
|
1032 |
{ |
|
1033 |
AgendaEntry updatedEntry = mController.agendaInterface()->fetchById(id); |
|
1034 |
||
1035 |
// Agenda entry is not null then refresh the view else close event viewer |
|
1036 |
if (!updatedEntry.isNull()) { |
|
1037 |
if (AgendaEntry::TypeTodo != updatedEntry.type()) { |
|
1038 |
QDate date = updatedEntry.startTime().date(); |
|
1039 |
if (!date.isNull() && date.isValid()) { |
|
1040 |
mController.Services().Context().setFocusDate(QDateTime(date)); |
|
1041 |
} |
|
1042 |
} |
|
1043 |
} |
|
1044 |
||
1045 |
} |
|
1046 |
||
1047 |
// ---------------------------------------------------------------------------- |
|
45 | 1048 |
// CalenViewManager::launchSettingsView |
1049 |
// Launches settings view |
|
1050 |
// (other items were commented in a header). |
|
1051 |
// ---------------------------------------------------------------------------- |
|
1052 |
// |
|
1053 |
void CalenViewManager::launchSettingsView() |
|
1054 |
{ |
|
51 | 1055 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LAUNCHSETTINGSVIEW_ENTRY ); |
1056 |
||
45 | 1057 |
mPreviousViewsId = mCurrentViewId ; |
1058 |
mCurrentViewId = ECalenShowSettings; |
|
1059 |
mSettingsView->initializeForm(); |
|
1060 |
mController.Services().MainWindow().setCurrentView(mSettingsView); |
|
1061 |
||
1062 |
// capture cureent view in case app closed/quits from settings view |
|
1063 |
if (mCalenMonthView){ |
|
1064 |
mCalenMonthView->captureScreenshot(true); |
|
1065 |
} else if(mCalenAgendaView){ |
|
1066 |
mCalenAgendaView->captureScreenshot(true); |
|
1067 |
} |
|
51 | 1068 |
|
1069 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LAUNCHSETTINGSVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1070 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1071 |
|
63 | 1072 |
|
1073 |
// ---------------------------------------------------------------------------- |
|
1074 |
// CalenViewManager::removeSettingsView |
|
1075 |
// remove settings view |
|
1076 |
// ---------------------------------------------------------------------------- |
|
1077 |
// |
|
1078 |
void CalenViewManager::removeSettingsView() |
|
1079 |
{ |
|
1080 |
if(mSettingsView){ |
|
1081 |
mController.Services().MainWindow().removeView(mSettingsView); |
|
1082 |
} |
|
1083 |
} |
|
1084 |
||
1085 |
// ---------------------------------------------------------------------------- |
|
1086 |
// CalenViewManager::isEventViewerActive |
|
1087 |
// check if Agenda Event Viewer is active |
|
1088 |
// ---------------------------------------------------------------------------- |
|
1089 |
// |
|
1090 |
bool CalenViewManager::isEventViewerActive() |
|
1091 |
{ |
|
1092 |
if(mCalenEventViewer) |
|
1093 |
return true; |
|
1094 |
else |
|
1095 |
return false; |
|
1096 |
} |
|
1097 |
||
1098 |
// ---------------------------------------------------------------------------- |
|
1099 |
// CalenViewManager::saveAndCloseEditor |
|
1100 |
// save the entry and close the editor |
|
1101 |
// isEventViewerActive() should be called before this function |
|
1102 |
// ---------------------------------------------------------------------------- |
|
1103 |
// |
|
1104 |
void CalenViewManager::saveAndCloseEditor() |
|
1105 |
{ |
|
1106 |
mCalenEventViewer->saveAndCloseEditor(); |
|
1107 |
} |
|
1108 |
||
1109 |
// ---------------------------------------------------------------------------- |
|
1110 |
// CalenViewManager::closeAgendaEventView |
|
1111 |
// close the agenda event view |
|
1112 |
// isEventViewerActive() should be called before this function |
|
1113 |
// ---------------------------------------------------------------------------- |
|
1114 |
// |
|
1115 |
void CalenViewManager::closeAgendaEventView() |
|
1116 |
{ |
|
1117 |
mCalenEventViewer->closeAgendaEventView(); |
|
1118 |
} |
|
1119 |
||
1120 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1121 |
// End of file --Don't remove this. |