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