author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:17:03 +0300 | |
branch | RCL_3 |
changeset 74 | 97232defd20e |
parent 66 | bd7edf625bdd |
child 86 | ed599363c2d7 |
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 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 |
* |
66 | 14 |
* Description: Implementation of calendar context. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
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 |
|
66 | 19 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#ifndef CALENCONTEXTIMPL_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#define CALENCONTEXTIMPL_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
// FORWARD DECLARATIONS |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
class MCalenContextChangeObserver; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
// INCLUDES |
66 | 27 |
#include <calencontext.h> |
28 |
#include <caleninstanceid.h> // TCalenInstanceId |
|
29 |
#include <calentry.h> |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include <vwsdef.h> |
66 | 31 |
#include <EPos_CPosLandmark.h> |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
// CLASS DEFINITIONS |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
* The controller handles events from the rest of Calendar and delegates |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
* them to the appropriate place (i.e. the action ui classes). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
*/ |
66 | 38 |
class CCalenContextImpl : public CBase, public MCalenContext |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
{ |
66 | 40 |
|
41 |
public: // Construction and destruction |
|
42 |
||
43 |
/** |
|
44 |
* The only reason this should be created outside of this dll is for |
|
45 |
* SCalenCommand, which needs a default constructor. Normal usage is |
|
46 |
* to use the accessor from the global data. Attempting to call |
|
47 |
* "setters" on any context not from the global data will panic. |
|
48 |
*/ |
|
49 |
CCalenContextImpl( MCalenContextChangeObserver* aObserver ); |
|
50 |
CCalenContextImpl(); |
|
51 |
CCalenContextImpl( const CCalenContextImpl& aContext ); |
|
52 |
~CCalenContextImpl(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
66 | 54 |
public: // from MCalenContext |
55 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
// Utils |
66 | 57 |
/** |
58 |
* Returns the default time for views. (Normally 8am.) This would be |
|
59 |
* used for example by the month view, which sets the focus time to |
|
60 |
* 8am on a day. Then when opening the week view, a sane time is shown. |
|
61 |
*/ |
|
62 |
TTimeIntervalMinutes DefaultTimeForViews() const; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
|
66 | 64 |
/** |
65 |
* Returns the default TCalTime for views. (Normally 8am today.) This |
|
66 |
* would be used for example when a view is the first view loaded in |
|
67 |
* Calendar. |
|
68 |
*/ |
|
69 |
TCalTime DefaultCalTimeForViewsL() const; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
// Setters |
66 | 72 |
/** |
73 |
* Sets the date and time currently focused. |
|
74 |
* @param aFocusTime The new focus date and time. |
|
75 |
* @param aViewId The view id of the currently active view. |
|
76 |
*/ |
|
77 |
void SetFocusDateAndTimeL( const TCalTime& aFocusDateTime, |
|
78 |
const TVwsViewId& aViewId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
|
66 | 80 |
/** |
81 |
* Sets the date currently focused. When retrieving the focus |
|
82 |
* date and time after calling this function, the time component |
|
83 |
* will be set to the default of view. When retrieving the focus |
|
84 |
* time only, it will be set to -1. |
|
85 |
* @param aFocusDate The new focus date and time. |
|
86 |
* @param aViewId The view id of the currently active view. |
|
87 |
*/ |
|
88 |
void SetFocusDateL( const TCalTime& aFocusDate, |
|
89 |
const TVwsViewId& aViewId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
|
66 | 91 |
/** |
92 |
* Sets the id of the instance currently focused. |
|
93 |
* @param aInstanceId the id of the focused instance. |
|
94 |
* @param aViewId The view id of the currently active view. |
|
95 |
*/ |
|
96 |
void SetInstanceIdL( const TCalenInstanceId& aInstanceId, |
|
97 |
const TVwsViewId& aViewId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
|
66 | 99 |
/** |
100 |
* Sets the time and instance currently focused. |
|
101 |
* @param aFocusTime The new focus time. If no time is focused, set |
|
102 |
* the Utc time of this object to be Time::NullTTime. |
|
103 |
* @param aInstanceId the id of the focused instance. |
|
104 |
* @param aViewId The view id of the currently active view. |
|
105 |
*/ |
|
106 |
void SetFocusDateAndTimeAndInstanceL( const TCalTime& aFocusDateTime, |
|
107 |
const TCalenInstanceId& aInstanceId, |
|
108 |
const TVwsViewId& aViewId ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
// Getters |
66 | 111 |
/** |
112 |
* Gets the date and time currently focused. |
|
113 |
* @return The currently focused date and time. When no time is |
|
114 |
* focused, the default time on the current date will be returned. |
|
115 |
*/ |
|
116 |
TCalTime FocusDateAndTimeL() const; |
|
117 |
||
118 |
/** |
|
119 |
* Gets the time currently focused. |
|
120 |
* @return The currently focused time. When no time is |
|
121 |
* focused, -1 will be returned. |
|
122 |
*/ |
|
123 |
TTimeIntervalMinutes FocusTime() const; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
|
66 | 125 |
/** |
126 |
* Gets the id of the instance currently focused. |
|
127 |
* @return The instance id currently focused. When no instance is focused, |
|
128 |
* this will be TCalenInstanceId::NullInstanceIdL() |
|
129 |
*/ |
|
130 |
TCalenInstanceId InstanceId() const; |
|
74
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
131 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
132 |
/** |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
133 |
* Sets the start and end time of the instance that has to be created. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
134 |
* @param aStartTime The start time of the instance that has to be created. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
135 |
* @param aEndTime The end time of the instance that has to be created. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
136 |
*/ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
137 |
void SetStartAndEndTimeForNewInstance( const TTime& aStartTime, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
138 |
const TTime& aEndTime ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
139 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
140 |
/** |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
141 |
* Gets the start and end time of the instance that has to be created. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
142 |
* @param aStartTime The start time of the instance that has to be created. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
143 |
* @param aEndTime The end time of the instance that has to be created. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
144 |
*/ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
145 |
void GetStartAndEndTimeForNewInstance( TTime& aStartTime, TTime& aEndTime ); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
|
66 | 147 |
/** |
148 |
* Gets the id of the currently active view. |
|
149 |
* @return The view id of the currently active view. |
|
150 |
*/ |
|
151 |
TVwsViewId ViewId() const; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
153 |
public: // Multiple Context support |
66 | 154 |
|
155 |
/** |
|
156 |
* Set multiple context ids |
|
157 |
* |
|
158 |
* @param aMutlipleContextIds |
|
159 |
*/ |
|
160 |
void SetMutlipleContextIds(RArray<TCalenInstanceId>& aMutlipleContextIds); |
|
161 |
||
162 |
/** |
|
163 |
* Remove multiple context id |
|
164 |
* |
|
165 |
* @param aInstanceId Instance Id for which context to be removed |
|
166 |
*/ |
|
167 |
void RemoveMultipleContextId(TCalenInstanceId aInstanceId); |
|
168 |
||
169 |
/** |
|
170 |
* Resets all the multiple context ids |
|
171 |
* |
|
172 |
*/ |
|
173 |
void ResetMultipleContextIds(TInt aDbId=0); |
|
174 |
||
175 |
/** |
|
176 |
* Getter for multiple context ids |
|
177 |
* |
|
178 |
* @return RArray<TCalenInstanceId>& |
|
179 |
*/ |
|
180 |
RArray<TCalenInstanceId>& GetMutlipleContextIds(TInt aDbId=0); |
|
181 |
||
182 |
/** |
|
183 |
* Returns mutliple context's count |
|
184 |
* |
|
185 |
* @return |
|
186 |
*/ |
|
187 |
TInt MutlipleContextIdsCount(); |
|
188 |
||
189 |
/** |
|
190 |
* Sets the user selected landmark |
|
191 |
* @param aLandMark Landmark object |
|
192 |
*/ |
|
193 |
void SetLandMark(CPosLandmark* aLandMark); |
|
194 |
||
195 |
/** |
|
196 |
* Returns the user selected landmark |
|
197 |
* @return Landmark object |
|
198 |
*/ |
|
199 |
CPosLandmark* GetLandMark(); |
|
200 |
||
201 |
/** |
|
202 |
* Resets the landmark |
|
203 |
*/ |
|
204 |
void ResetLandMark(); |
|
205 |
||
206 |
/** |
|
207 |
* Allows extending this API without breaking BC. |
|
208 |
* |
|
209 |
* @param aExtensionUid specifies |
|
210 |
* @return extension of the requested type |
|
211 |
*/ |
|
212 |
TAny* CalenContextExtensionL( TUid aExtensionUid ); |
|
213 |
||
214 |
/** |
|
215 |
* @brief Get calendar filename |
|
216 |
* |
|
217 |
* @return TDesC& reference to calendar filename |
|
218 |
*/ |
|
219 |
TDesC& GetCalendarFileNameL() const; |
|
220 |
||
221 |
/** |
|
222 |
* @brief Set the calendar filename |
|
223 |
* |
|
224 |
* @param aName referance to calendar file name |
|
225 |
*/ |
|
226 |
void SetCalendarFileNameL(const TDesC& aName); |
|
227 |
||
228 |
/** |
|
229 |
* @brief Resets calendar file name in context |
|
230 |
*/ |
|
231 |
void ResetCalendarFileName(); |
|
232 |
/** |
|
233 |
* @brief Set calendar file name of Alarm entry in context |
|
234 |
*/ |
|
235 |
void SetCalAlarmEntryFileNameL(const TDesC& aName); |
|
236 |
||
237 |
/** |
|
238 |
* @brief Get calendar filename |
|
239 |
* |
|
240 |
* @return HBufC pointer to calendar filename of Alarm entry |
|
241 |
*/ |
|
242 |
HBufC* GetCalAlarmEntryFileNameL() const; |
|
243 |
||
244 |
/** |
|
245 |
* @brief Resets Alarm Entry calendar file name in context |
|
246 |
*/ |
|
247 |
void ResetCalAlarmEntryFileName(); |
|
248 |
||
249 |
/** |
|
250 |
* @brief set Alarm Entry LocalUid in context |
|
251 |
*/ |
|
252 |
void SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId); |
|
253 |
||
254 |
/** |
|
255 |
* @brief Get Alarm Entry LocalUid from context |
|
256 |
*/ |
|
257 |
TCalLocalUid CalAlarmLocalUidL() const; |
|
258 |
||
259 |
private: // Data |
|
260 |
MCalenContextChangeObserver* iObserver; |
|
261 |
TCalTime iFocusDate; |
|
262 |
TTimeIntervalMinutes iFocusTime; |
|
263 |
TCalenInstanceId iInstanceId; |
|
264 |
TVwsViewId iViewId; |
|
265 |
CPosLandmark* iLandMark; |
|
266 |
CCalGeoValue* iGeoValue; |
|
267 |
HBufC* iLocation; |
|
268 |
// Multiple context ids |
|
269 |
RArray<TCalenInstanceId> iMutlipleContextIds; |
|
270 |
HBufC* iCalenFileName; |
|
271 |
HBufC* iCalAlarmEntryFileName; |
|
272 |
TCalLocalUid iCalAlarmLocalUid; |
|
74
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
273 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
274 |
// The new instance's start and end time |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
275 |
TTime iNewInstStartTime; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
276 |
TTime iNewInstEndTime; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
}; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
#endif // CALENCONTEXTIMPL_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
// End of file |