9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Calendar context, info on what's currently focused |
14 * Description: Calendar context, info on what's currently focused |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
|
19 |
19 //debug |
20 //debug |
20 #include "calendarui_debug.h" |
21 #include "calendarui_debug.h" |
|
22 |
21 #include "calencontextimpl.h" |
23 #include "calencontextimpl.h" |
|
24 |
22 #include "calencontextchangeobserver.h" |
25 #include "calencontextchangeobserver.h" |
23 #include "calendateutils.h" |
26 #include <calendateutils.h> |
24 //#include <lbsposition.h> |
27 #include <lbsposition.h> |
25 |
28 |
26 const int KCalenDefaultTimeForViews = 480; // 480 minutes == 8 hours == 8 am. |
29 const TInt KCalenDefaultTimeForViews = 480; // 480 minutes == 8 hours == 8 am. |
27 |
30 |
28 // ---------------------------------------------------------------------------- |
31 // ---------------------------------------------------------------------------- |
29 // CalenContextImpl::CalenContextImpl |
32 // CCalenContextImpl::CCalenContextImpl |
30 // Constructor. |
33 // Constructor. |
31 // (other items were commented in a header). |
34 // (other items were commented in a header). |
32 // ---------------------------------------------------------------------------- |
35 // ---------------------------------------------------------------------------- |
33 // |
36 // |
34 EXPORT_C CalenContextImpl::CalenContextImpl( MCalenContextChangeObserver* observer ) |
37 CCalenContextImpl::CCalenContextImpl( MCalenContextChangeObserver* aObserver ) |
35 : mObserver( observer ), |
38 : iObserver( aObserver ), |
36 mFocusTime( -1 ), |
39 iFocusTime( -1 ), |
37 mInstanceId( TCalenInstanceId::nullInstanceId() ) |
40 iInstanceId( TCalenInstanceId::NullInstanceId() ) |
38 { |
41 { |
39 } |
42 TRACE_ENTRY_POINT; |
40 |
43 TRACE_EXIT_POINT; |
41 // ---------------------------------------------------------------------------- |
44 } |
42 // CalenContextImpl::CalenContextImpl |
45 |
|
46 // ---------------------------------------------------------------------------- |
|
47 // CCalenContextImpl::CCalenContextImpl |
43 // Default Constructor. |
48 // Default Constructor. |
44 // (other items were commented in a header). |
49 // (other items were commented in a header). |
45 // ---------------------------------------------------------------------------- |
50 // ---------------------------------------------------------------------------- |
46 // |
51 // |
47 EXPORT_C CalenContextImpl::CalenContextImpl() |
52 CCalenContextImpl::CCalenContextImpl() |
48 : mInstanceId( TCalenInstanceId::nullInstanceId() ) |
53 : iInstanceId( TCalenInstanceId::NullInstanceId() ) |
49 { |
54 { |
50 } |
55 TRACE_ENTRY_POINT; |
51 |
56 TRACE_EXIT_POINT; |
52 // ---------------------------------------------------------------------------- |
57 } |
53 // CalenContextImpl::CalenContextImpl |
58 |
|
59 // ---------------------------------------------------------------------------- |
|
60 // CCalenContextImpl::CCalenContextImpl |
54 // Copy Constructor. |
61 // Copy Constructor. |
55 // (other items were commented in a header). |
62 // (other items were commented in a header). |
56 // ---------------------------------------------------------------------------- |
63 // ---------------------------------------------------------------------------- |
57 // |
64 // |
58 EXPORT_C CalenContextImpl::CalenContextImpl( const CalenContextImpl& aContext ) |
65 CCalenContextImpl::CCalenContextImpl( const CCalenContextImpl& aContext ) |
59 { |
66 { |
|
67 TRACE_ENTRY_POINT; |
|
68 |
60 // When copying, set the observer to NULL because the only context that |
69 // When copying, set the observer to NULL because the only context that |
61 // should be set is accessed from the global data. |
70 // should be set is accessed from the global data. |
62 mObserver = NULL; |
71 iObserver = NULL; |
63 mFocusTime = aContext.mFocusTime; |
72 iFocusTime = aContext.iFocusTime; |
64 mInstanceId = aContext.mInstanceId; |
73 iInstanceId = aContext.iInstanceId; |
65 mViewId = aContext.mViewId; |
74 iViewId = aContext.iViewId; |
66 } |
75 |
67 |
76 TRACE_EXIT_POINT; |
68 // ---------------------------------------------------------------------------- |
77 } |
69 // CalenContextImpl::~CalenContextImpl |
78 |
|
79 // ---------------------------------------------------------------------------- |
|
80 // CCalenContextImpl::~CCalenContextImpl |
70 // Destructor. |
81 // Destructor. |
71 // (other items were commented in a header). |
82 // (other items were commented in a header). |
72 // ---------------------------------------------------------------------------- |
83 // ---------------------------------------------------------------------------- |
73 // |
84 // |
74 EXPORT_C CalenContextImpl::~CalenContextImpl() |
85 CCalenContextImpl::~CCalenContextImpl() |
75 { |
86 { |
76 if(mMutlipleContextIds.count()) |
87 TRACE_ENTRY_POINT; |
77 { |
88 if(iCalAlarmEntryFileName) |
78 mMutlipleContextIds.clear(); |
89 { |
79 } |
90 delete iCalAlarmEntryFileName; |
80 } |
91 iCalAlarmEntryFileName = NULL; |
81 |
92 } |
82 // ---------------------------------------------------------------------------- |
93 TRACE_EXIT_POINT; |
83 // CalenContextImpl::DefaultTimeForViews |
94 } |
|
95 |
|
96 // ---------------------------------------------------------------------------- |
|
97 // CCalenContextImpl::DefaultTimeForViews |
84 // If a view knows what day they should be looking at, but doesn't know what |
98 // If a view knows what day they should be looking at, but doesn't know what |
85 // time (for example the month view only deals in days), they should set the |
99 // time (for example the month view only deals in days), they should set the |
86 // time to this value. |
100 // time to this value. |
87 // (other items were commented in a header). |
101 // (other items were commented in a header). |
88 // ---------------------------------------------------------------------------- |
102 // ---------------------------------------------------------------------------- |
89 // |
103 // |
90 int CalenContextImpl::defaultTimeForViewsInMinnutes() const |
104 TTimeIntervalMinutes CCalenContextImpl::DefaultTimeForViews() const |
91 { |
105 { |
92 return KCalenDefaultTimeForViews; |
106 TRACE_ENTRY_POINT; |
93 } |
107 TRACE_EXIT_POINT; |
94 |
108 return TTimeIntervalMinutes( KCalenDefaultTimeForViews ); |
95 // ---------------------------------------------------------------------------- |
109 } |
96 // CalenContextImpl::DefaultCalTimeForViewsL |
110 |
|
111 // ---------------------------------------------------------------------------- |
|
112 // CCalenContextImpl::DefaultCalTimeForViewsL |
97 // If a view has no preference as to what time/day to be focused on (e.g. when |
113 // If a view has no preference as to what time/day to be focused on (e.g. when |
98 // a view is the first view loaded), they should set focus to this TCalTime. |
114 // a view is the first view loaded), they should set focus to this TCalTime. |
99 // (other items were commented in a header). |
115 // (other items were commented in a header). |
100 // ---------------------------------------------------------------------------- |
116 // ---------------------------------------------------------------------------- |
101 // |
117 // |
102 QDateTime CalenContextImpl::defaultCalTimeForViewsL() const |
118 TCalTime CCalenContextImpl::DefaultCalTimeForViewsL() const |
103 { |
119 { |
104 QDateTime ret = CalenDateUtils::today(); |
120 TRACE_ENTRY_POINT; |
105 QTime currentTime = ret.time(); |
121 |
106 currentTime.setHMS(7, 0, 0, 0); |
122 TTime today; |
107 ret.setTime(currentTime); |
123 today.HomeTime(); |
108 |
124 today = CalenDateUtils::BeginningOfDay( today ); |
|
125 TCalTime ret; |
|
126 ret.SetTimeLocalL( today + CCalenContextImpl::DefaultTimeForViews() ); |
|
127 |
|
128 TRACE_EXIT_POINT; |
109 return ret; |
129 return ret; |
110 } |
130 } |
111 |
131 |
112 // ---------------------------------------------------------------------------- |
132 // ---------------------------------------------------------------------------- |
113 // CalenContextImpl::SetFocusDateAndTimeL |
133 // CCalenContextImpl::SetFocusDateAndTimeL |
114 // Sets the focus time |
134 // Sets the focus time |
115 // (other items were commented in a header). |
135 // (other items were commented in a header). |
116 // ---------------------------------------------------------------------------- |
136 // ---------------------------------------------------------------------------- |
117 // |
137 // |
118 void CalenContextImpl::setFocusDateAndTime( const QDateTime& focusDateTime) |
138 void CCalenContextImpl::SetFocusDateAndTimeL( const TCalTime& aFocusDateTime, |
119 { |
139 const TVwsViewId& aViewId ) |
120 |
140 { |
121 mFocusDate = focusDateTime; |
141 TRACE_ENTRY_POINT; |
122 mFocusTime = focusDateTime.time().minute() + 1; |
|
123 |
|
124 if( mFocusTime < 0 ) |
|
125 mFocusTime = 0; |
|
126 mInstanceId = TCalenInstanceId::nullInstanceId(); |
|
127 |
142 |
128 // If this fails you're using a context that was constructed yourself. |
143 // If this fails you're using a context that was constructed yourself. |
129 // Use the accessor from the global data instead, or don't try to set |
144 // Use the accessor from the global data instead, or don't try to set |
130 // anything on this context. |
145 // anything on this context. |
131 if(mObserver) |
146 ASSERT( iObserver ); |
132 mObserver->ContextChanged(); |
147 |
133 } |
148 #ifdef _DEBUG |
134 |
149 TDateTime dt = aFocusDateTime.TimeLocalL().DateTime(); |
135 // ---------------------------------------------------------------------------- |
150 #endif |
136 // CalenContextImpl::SetFocusDateL |
151 |
|
152 iFocusDate.SetTimeLocalL( CalenDateUtils::BeginningOfDay( aFocusDateTime.TimeLocalL() ) ); |
|
153 User::LeaveIfError( aFocusDateTime.TimeLocalL().MinutesFrom( iFocusDate.TimeLocalL(), |
|
154 iFocusTime ) ); |
|
155 ASSERT( iFocusTime.Int() >= 0 ); |
|
156 iInstanceId = TCalenInstanceId::NullInstanceId(); |
|
157 iViewId = aViewId; |
|
158 |
|
159 iObserver->ContextChanged(); |
|
160 |
|
161 TRACE_EXIT_POINT; |
|
162 } |
|
163 |
|
164 // ---------------------------------------------------------------------------- |
|
165 // CCalenContextImpl::SetFocusDateL |
137 // Sets the focus date |
166 // Sets the focus date |
138 // (other items were commented in a header). |
167 // (other items were commented in a header). |
139 // ---------------------------------------------------------------------------- |
168 // ---------------------------------------------------------------------------- |
140 // |
169 // |
141 void CalenContextImpl::setFocusDate( const QDateTime& focusDateTime) |
170 void CCalenContextImpl::SetFocusDateL( const TCalTime& aFocusDate, |
142 { |
171 const TVwsViewId& aViewId ) |
143 mFocusDate = focusDateTime; |
172 { |
144 mFocusTime = -1; |
173 TRACE_ENTRY_POINT; |
145 mInstanceId = TCalenInstanceId::nullInstanceId(); |
|
146 |
174 |
147 // If this fails you're using a context that was constructed yourself. |
175 // If this fails you're using a context that was constructed yourself. |
148 // Use the accessor from the global data instead, or don't try to set |
176 // Use the accessor from the global data instead, or don't try to set |
149 // anything on this context. |
177 // anything on this context. |
150 if(mObserver) |
178 ASSERT( iObserver ); |
151 mObserver->ContextChanged(); |
179 |
152 } |
180 #ifdef _DEBUG |
153 |
181 TDateTime dt = aFocusDate.TimeLocalL().DateTime(); |
154 // ---------------------------------------------------------------------------- |
182 #endif |
155 // CalenContextImpl::SetInstanceIdL |
183 |
|
184 iFocusDate.SetTimeLocalL( CalenDateUtils::BeginningOfDay( aFocusDate.TimeLocalL() ) ); |
|
185 iFocusTime = TTimeIntervalMinutes( -1 ); |
|
186 iInstanceId = TCalenInstanceId::NullInstanceId(); |
|
187 iViewId = aViewId; |
|
188 |
|
189 iObserver->ContextChanged(); |
|
190 |
|
191 TRACE_EXIT_POINT; |
|
192 } |
|
193 |
|
194 // ---------------------------------------------------------------------------- |
|
195 // CCalenContextImpl::SetInstanceIdL |
156 // Sets the instance id |
196 // Sets the instance id |
157 // (other items were commented in a header). |
197 // (other items were commented in a header). |
158 // ---------------------------------------------------------------------------- |
198 // ---------------------------------------------------------------------------- |
159 // |
199 // |
160 void CalenContextImpl::setInstanceId( const TCalenInstanceId& aInstanceId ) |
200 void CCalenContextImpl::SetInstanceIdL( const TCalenInstanceId& aInstanceId, |
161 { |
201 const TVwsViewId& aViewId ) |
162 |
202 { |
163 // Set the null date and time |
203 TRACE_ENTRY_POINT; |
164 mFocusDate = QDateTime(); |
|
165 mFocusTime = -1; |
|
166 mInstanceId = aInstanceId; |
|
167 |
204 |
168 // If this fails you're using a context that was constructed yourself. |
205 // If this fails you're using a context that was constructed yourself. |
169 // Use the accessor from the global data instead, or don't try to set |
206 // Use the accessor from the global data instead, or don't try to set |
170 // anything on this context. |
207 // anything on this context. |
171 if(mObserver) |
208 ASSERT( iObserver ); |
172 mObserver->ContextChanged(); |
209 |
173 } |
210 iFocusDate.SetTimeUtcL( Time::NullTTime() ); |
174 |
211 iFocusTime = TTimeIntervalMinutes( -1 ); |
175 // ----------------------------------------------------------------------------- |
212 iInstanceId = aInstanceId; |
176 // CalenContextImpl::SetFocusDateAndTimeAndInstanceL |
213 iViewId = aViewId; |
|
214 |
|
215 iObserver->ContextChanged(); |
|
216 |
|
217 TRACE_EXIT_POINT; |
|
218 } |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // CCalenContextImpl::SetFocusDateAndTimeAndInstanceL |
177 // Sets the currently focused time and instance |
222 // Sets the currently focused time and instance |
178 // (other items were commented in a header). |
223 // (other items were commented in a header). |
179 // ----------------------------------------------------------------------------- |
224 // ----------------------------------------------------------------------------- |
180 // |
225 // |
181 void CalenContextImpl::setFocusDateAndTimeAndInstance( const QDateTime& focusDateTime, |
226 void CCalenContextImpl::SetFocusDateAndTimeAndInstanceL( const TCalTime& aFocusDateTime, |
182 const TCalenInstanceId& instanceId ) |
227 const TCalenInstanceId& aInstanceId, |
183 { |
228 const TVwsViewId& aViewId ) |
184 mFocusDate = focusDateTime; |
229 { |
185 mFocusTime = focusDateTime.time().minute() + 1; |
230 TRACE_ENTRY_POINT; |
186 if( mFocusTime < 0 ) |
|
187 mFocusTime = 0; |
|
188 mInstanceId = instanceId; |
|
189 |
231 |
190 // If this fails you're using a context that was constructed yourself. |
232 // If this fails you're using a context that was constructed yourself. |
191 // Use the accessor from the global data instead, or don't try to set |
233 // Use the accessor from the global data instead, or don't try to set |
192 // anything on this context. |
234 // anything on this context. |
193 if(mObserver) |
235 ASSERT( iObserver ); |
194 mObserver->ContextChanged(); |
236 |
195 } |
237 #ifdef _DEBUG |
196 |
238 TDateTime dt = aFocusDateTime.TimeLocalL().DateTime(); |
197 // ----------------------------------------------------------------------------- |
239 #endif |
198 // CalenContextImpl::FocusDateAndTimeL |
240 |
|
241 iFocusDate.SetTimeLocalL( CalenDateUtils::BeginningOfDay( aFocusDateTime.TimeLocalL() ) ); |
|
242 User::LeaveIfError( aFocusDateTime.TimeLocalL().MinutesFrom( iFocusDate.TimeLocalL(), |
|
243 iFocusTime ) ); |
|
244 ASSERT( iFocusTime.Int() >= 0 ); |
|
245 iInstanceId = aInstanceId; |
|
246 iViewId = aViewId; |
|
247 |
|
248 iObserver->ContextChanged(); |
|
249 |
|
250 TRACE_EXIT_POINT; |
|
251 } |
|
252 |
|
253 // ----------------------------------------------------------------------------- |
|
254 // CCalenContextImpl::FocusDateAndTimeL |
199 // Returns the focus time |
255 // Returns the focus time |
200 // (other items were commented in a header). |
256 // (other items were commented in a header). |
201 // ----------------------------------------------------------------------------- |
257 // ----------------------------------------------------------------------------- |
202 // |
258 // |
203 QDateTime CalenContextImpl::focusDateAndTime() const |
259 TCalTime CCalenContextImpl::FocusDateAndTimeL() const |
204 { |
260 { |
205 QDateTime ret; |
261 TRACE_ENTRY_POINT; |
206 |
262 |
207 if( mFocusDate.isValid() ) |
263 TCalTime ret; |
208 { |
264 |
209 ret = mFocusDate; |
265 if( iFocusDate.TimeUtcL() != Time::NullTTime() ) |
|
266 { |
|
267 if ( iFocusTime.Int() >= 0 ) |
|
268 { |
|
269 ret.SetTimeLocalL( iFocusDate.TimeLocalL() + iFocusTime ); |
|
270 } |
|
271 else |
|
272 { |
|
273 ret.SetTimeLocalL( iFocusDate.TimeLocalL() + DefaultTimeForViews() ); |
|
274 } |
210 } |
275 } |
211 else |
276 else |
212 { |
277 { |
213 ret = mInstanceId.mInstanceTime; |
278 ret.SetTimeLocalL( iInstanceId.iInstanceTime ); |
214 } |
279 } |
215 |
280 |
|
281 TRACE_EXIT_POINT; |
216 return ret; |
282 return ret; |
217 } |
283 } |
218 |
284 |
219 // ----------------------------------------------------------------------------- |
285 // ----------------------------------------------------------------------------- |
220 // CalenContextImpl::FocusTime |
286 // CCalenContextImpl::FocusTime |
221 // Returns the focus time |
287 // Returns the focus time |
222 // (other items were commented in a header). |
288 // (other items were commented in a header). |
223 // ----------------------------------------------------------------------------- |
289 // ----------------------------------------------------------------------------- |
224 // |
290 // |
225 int CalenContextImpl::focusTime() const |
291 TTimeIntervalMinutes CCalenContextImpl::FocusTime() const |
226 { |
292 { |
227 TRACE_ENTRY_POINT; |
293 TRACE_ENTRY_POINT; |
228 TRACE_EXIT_POINT; |
294 TRACE_EXIT_POINT; |
229 return mFocusTime; |
295 return iFocusTime; |
230 } |
296 } |
231 |
297 |
232 // ----------------------------------------------------------------------------- |
298 // ----------------------------------------------------------------------------- |
233 // CalenContextImpl::InstanceId |
299 // CCalenContextImpl::InstanceId |
234 // Returns the instance id |
300 // Returns the instance id |
235 // (other items were commented in a header). |
301 // (other items were commented in a header). |
236 // ----------------------------------------------------------------------------- |
302 // ----------------------------------------------------------------------------- |
237 // |
303 // |
238 TCalenInstanceId CalenContextImpl::instanceId() const |
304 TCalenInstanceId CCalenContextImpl::InstanceId() const |
239 { |
305 { |
240 TRACE_ENTRY_POINT; |
306 TRACE_ENTRY_POINT; |
241 TRACE_EXIT_POINT; |
307 TRACE_EXIT_POINT; |
242 return mInstanceId; |
308 return iInstanceId; |
243 } |
309 } |
244 |
310 |
245 // ----------------------------------------------------------------------------- |
311 // ----------------------------------------------------------------------------- |
246 // CalenContextImpl::SetMutlipleContextIds |
312 // CCalenContextImpl::ViewId |
|
313 // Returns the view id |
|
314 // (other items were commented in a header). |
|
315 // ----------------------------------------------------------------------------- |
|
316 // |
|
317 TVwsViewId CCalenContextImpl::ViewId() const |
|
318 { |
|
319 TRACE_ENTRY_POINT; |
|
320 TRACE_EXIT_POINT; |
|
321 return iViewId; |
|
322 } |
|
323 |
|
324 // ----------------------------------------------------------------------------- |
|
325 // CCalenContextImpl::SetMutlipleContextIds |
247 // Set multiple context ids |
326 // Set multiple context ids |
248 // (other items were commented in a header). |
327 // (other items were commented in a header). |
249 // ----------------------------------------------------------------------------- |
328 // ----------------------------------------------------------------------------- |
250 // |
329 // |
251 void CalenContextImpl::setMutlipleContextIds( |
330 void CCalenContextImpl::SetMutlipleContextIds( |
252 QList<TCalenInstanceId>& mutlipleContextIds) |
331 RArray<TCalenInstanceId>& aMutlipleContextIds) |
253 { |
332 { |
|
333 TRACE_ENTRY_POINT; |
254 |
334 |
255 mMutlipleContextIds.clear(); |
335 iMutlipleContextIds.Reset(); |
256 mMutlipleContextIds = mutlipleContextIds; |
336 iMutlipleContextIds = aMutlipleContextIds; |
257 |
337 |
258 } |
338 TRACE_EXIT_POINT; |
259 |
339 } |
260 // ----------------------------------------------------------------------------- |
340 |
261 // CalenContextImpl::RemoveMultipleContextId |
341 // ----------------------------------------------------------------------------- |
|
342 // CCalenContextImpl::RemoveMultipleContextId |
262 // Remove multiple context id |
343 // Remove multiple context id |
263 // (other items were commented in a header). |
344 // (other items were commented in a header). |
264 // ----------------------------------------------------------------------------- |
345 // ----------------------------------------------------------------------------- |
265 // |
346 // |
266 void CalenContextImpl::removeMultipleContextId(TCalenInstanceId instanceId) |
347 void CCalenContextImpl::RemoveMultipleContextId(TCalenInstanceId aInstanceId) |
267 { |
348 { |
268 |
349 TRACE_ENTRY_POINT; |
269 for(int index = 0;index < mMutlipleContextIds.count();index++) |
350 |
|
351 for(TInt index = 0;index < iMutlipleContextIds.Count();index++) |
270 { |
352 { |
271 if(instanceId == mMutlipleContextIds[index]) |
353 if(aInstanceId == iMutlipleContextIds[index]) |
272 { |
354 { |
273 mMutlipleContextIds.removeAt(index); |
355 iMutlipleContextIds.Remove(index); |
274 } |
356 } |
275 } |
357 } |
276 |
358 |
277 } |
359 TRACE_EXIT_POINT; |
|
360 } |
278 |
361 |
279 // ----------------------------------------------------------------------------- |
362 // ----------------------------------------------------------------------------- |
280 // CalenContextImpl::ResetMultipleContextIds |
363 // CCalenContextImpl::ResetMultipleContextIds |
281 // Resets all the multiple context ids |
364 // Resets all the multiple context ids |
282 // (other items were commented in a header). |
365 // (other items were commented in a header). |
283 // ----------------------------------------------------------------------------- |
366 // ----------------------------------------------------------------------------- |
284 // |
367 // |
285 void CalenContextImpl::resetMultipleContextIds(TInt /*aDbId*/) |
368 void CCalenContextImpl::ResetMultipleContextIds(TInt /*aDbId*/) |
286 { |
369 { |
287 |
370 TRACE_ENTRY_POINT; |
288 if(mMutlipleContextIds.count()) |
371 |
|
372 //if(iMutlipleContextIds.Count()) |
289 { |
373 { |
290 mMutlipleContextIds.clear(); |
374 iMutlipleContextIds.Reset(); |
|
375 iMutlipleContextIds.Close(); |
291 } |
376 } |
292 |
377 |
293 } |
378 TRACE_EXIT_POINT; |
|
379 } |
294 |
380 |
295 // ----------------------------------------------------------------------------- |
381 // ----------------------------------------------------------------------------- |
296 // CalenContextImpl::GetMutlipleContextIds |
382 // CCalenContextImpl::GetMutlipleContextIds |
297 // Getter for multiple context ids |
383 // Getter for multiple context ids |
298 // (other items were commented in a header). |
384 // (other items were commented in a header). |
299 // ----------------------------------------------------------------------------- |
385 // ----------------------------------------------------------------------------- |
300 // |
386 // |
301 QList<TCalenInstanceId>& CalenContextImpl::getMutlipleContextIds(TInt /*aDbId*/) |
387 RArray<TCalenInstanceId>& CCalenContextImpl::GetMutlipleContextIds(TInt /*aDbId*/) |
302 { |
388 { |
303 return mMutlipleContextIds; |
389 TRACE_ENTRY_POINT; |
|
390 TRACE_EXIT_POINT; |
|
391 |
|
392 return iMutlipleContextIds; |
304 } |
393 } |
305 |
394 |
306 // ----------------------------------------------------------------------------- |
395 // ----------------------------------------------------------------------------- |
307 // CalenContextImpl::MutlipleContextIdsCount |
396 // CCalenContextImpl::MutlipleContextIdsCount |
308 // Returns mutliple context's count |
397 // Returns mutliple context's count |
309 // (other items were commented in a header). |
398 // (other items were commented in a header). |
310 // ----------------------------------------------------------------------------- |
399 // ----------------------------------------------------------------------------- |
311 // |
400 // |
312 int CalenContextImpl::mutlipleContextIdsCount() |
401 TInt CCalenContextImpl::MutlipleContextIdsCount() |
313 { |
402 { |
314 return mMutlipleContextIds.count(); |
403 TRACE_ENTRY_POINT; |
315 } |
404 TRACE_EXIT_POINT; |
|
405 |
|
406 return iMutlipleContextIds.Count(); |
|
407 } |
|
408 |
|
409 // ----------------------------------------------------------------------------- |
|
410 // CCalenContextImpl::SetLandMark |
|
411 // Sets the user selected landmark |
|
412 // (other items were commented in a header). |
|
413 // ----------------------------------------------------------------------------- |
|
414 // |
|
415 void CCalenContextImpl::SetLandMark(CPosLandmark* aLandMark) |
|
416 { |
|
417 TRACE_ENTRY_POINT; |
|
418 if(iLandMark) |
|
419 { |
|
420 delete iLandMark; |
|
421 } |
|
422 iLandMark = aLandMark; |
|
423 TRACE_EXIT_POINT; |
|
424 } |
|
425 |
|
426 // ----------------------------------------------------------------------------- |
|
427 // CCalenContextImpl::GetLandMark |
|
428 // Returns the user selected landmark |
|
429 // (other items were commented in a header). |
|
430 // ----------------------------------------------------------------------------- |
|
431 // |
|
432 CPosLandmark* CCalenContextImpl::GetLandMark() |
|
433 { |
|
434 TRACE_ENTRY_POINT; |
|
435 TRACE_EXIT_POINT; |
|
436 |
|
437 return(iLandMark); |
|
438 } |
|
439 |
|
440 // ----------------------------------------------------------------------------- |
|
441 // CCalenContextImpl::ResetLandMark |
|
442 // Resets the landmark |
|
443 // (other items were commented in a header). |
|
444 // ----------------------------------------------------------------------------- |
|
445 // |
|
446 void CCalenContextImpl::ResetLandMark() |
|
447 { |
|
448 TRACE_ENTRY_POINT; |
|
449 if(iLandMark) |
|
450 { |
|
451 delete iLandMark; |
|
452 iLandMark = NULL; |
|
453 } |
|
454 TRACE_EXIT_POINT; |
|
455 } |
|
456 |
|
457 // ---------------------------------------------------------------------------- |
|
458 // CCalenContextImpl::CalenCommandHandlerExtensionL |
|
459 // Dummy implementation. |
|
460 // (other items were commented in a header). |
|
461 // ---------------------------------------------------------------------------- |
|
462 // |
|
463 TAny* CCalenContextImpl::CalenContextExtensionL( TUid /*aExtensionUid*/ ) |
|
464 { |
|
465 TRACE_ENTRY_POINT; |
|
466 TRACE_EXIT_POINT; |
|
467 return NULL; |
|
468 } |
|
469 |
|
470 // ----------------------------------------------------------------------------- |
|
471 // CCalenContextImpl::GetCalendarFileNameL |
|
472 // Get calendar file name |
|
473 // ----------------------------------------------------------------------------- |
|
474 TDesC& CCalenContextImpl::GetCalendarFileNameL() const |
|
475 { |
|
476 TRACE_ENTRY_POINT |
|
477 TRACE_EXIT_POINT |
|
478 if(iCalenFileName) |
|
479 { |
|
480 return *iCalenFileName; |
|
481 } |
|
482 else |
|
483 { |
|
484 return const_cast<TDesC&> (KNullDesC()); |
|
485 } |
|
486 } |
|
487 |
|
488 // ----------------------------------------------------------------------------- |
|
489 // CCalenContextImpl::SetCalendarFileNameL |
|
490 // Set calendar file name to context |
|
491 // ----------------------------------------------------------------------------- |
|
492 void CCalenContextImpl::SetCalendarFileNameL(const TDesC& aCalFileName) |
|
493 { |
|
494 TRACE_ENTRY_POINT |
|
495 |
|
496 if(iCalenFileName) |
|
497 { |
|
498 delete iCalenFileName; |
|
499 iCalenFileName = NULL; |
|
500 } |
|
501 iCalenFileName = aCalFileName.AllocL(); |
|
502 TRACE_EXIT_POINT |
|
503 } |
|
504 |
|
505 // ----------------------------------------------------------------------------- |
|
506 // CCalenContextImpl::ResetCalendarFileName |
|
507 // Resets calendar file name in context |
|
508 // ----------------------------------------------------------------------------- |
|
509 void CCalenContextImpl::ResetCalendarFileName() |
|
510 { |
|
511 TRACE_ENTRY_POINT; |
|
512 if(iCalenFileName) |
|
513 { |
|
514 delete iCalenFileName; |
|
515 iCalenFileName = NULL; |
|
516 } |
|
517 |
|
518 TRACE_EXIT_POINT; |
|
519 } |
|
520 |
|
521 // ----------------------------------------------------------------------------- |
|
522 // CCalenContextImpl::SetCalAlarmEntryFileNameL |
|
523 // Set calendar file name of Alarm entry |
|
524 // ----------------------------------------------------------------------------- |
|
525 void CCalenContextImpl::SetCalAlarmEntryFileNameL(const TDesC& aName) |
|
526 { |
|
527 TRACE_ENTRY_POINT |
|
528 if (iCalAlarmEntryFileName) |
|
529 { |
|
530 delete iCalAlarmEntryFileName; |
|
531 iCalAlarmEntryFileName = NULL; |
|
532 } |
|
533 iCalAlarmEntryFileName = aName.AllocL(); |
|
534 TRACE_EXIT_POINT |
|
535 } |
|
536 |
|
537 // ----------------------------------------------------------------------------- |
|
538 // CCalenContextImpl::GetCalAlarmEntryFileNameL |
|
539 // Get calendar file name of Alarm entry |
|
540 // ----------------------------------------------------------------------------- |
|
541 HBufC* CCalenContextImpl::GetCalAlarmEntryFileNameL() const |
|
542 { |
|
543 TRACE_ENTRY_POINT |
|
544 TRACE_EXIT_POINT |
|
545 |
|
546 return iCalAlarmEntryFileName; |
|
547 } |
|
548 |
|
549 // ----------------------------------------------------------------------------- |
|
550 // CCalenContextImpl::ResetCalAlarmEntryFileName |
|
551 // Resets Alarm Entry file name in context |
|
552 // ----------------------------------------------------------------------------- |
|
553 void CCalenContextImpl::ResetCalAlarmEntryFileName() |
|
554 { |
|
555 TRACE_ENTRY_POINT |
|
556 if(iCalAlarmEntryFileName) |
|
557 { |
|
558 delete iCalAlarmEntryFileName; |
|
559 iCalAlarmEntryFileName = NULL; |
|
560 } |
|
561 |
|
562 TRACE_EXIT_POINT |
|
563 } |
|
564 // ----------------------------------------------------------------------------- |
|
565 // CCalenContextImpl::ResetCalAlarmEntryFileName |
|
566 // set Alarm Entry LocalUid in context |
|
567 // ----------------------------------------------------------------------------- |
|
568 void CCalenContextImpl::SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId) |
|
569 { |
|
570 TRACE_ENTRY_POINT |
|
571 iCalAlarmLocalUid = aLocalId; |
|
572 TRACE_EXIT_POINT |
|
573 } |
|
574 |
|
575 |
|
576 // ----------------------------------------------------------------------------- |
|
577 // CCalenContextImpl::ResetCalAlarmEntryFileName |
|
578 // Get Alarm Entry LocalUid from context |
|
579 // ----------------------------------------------------------------------------- |
|
580 TCalLocalUid CCalenContextImpl::CalAlarmLocalUidL() const |
|
581 { |
|
582 TRACE_ENTRY_POINT |
|
583 TRACE_EXIT_POINT |
|
584 return iCalAlarmLocalUid; |
|
585 } |
316 // End of file |
586 // End of file |