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 EXPORT_C CalenContextImpl::~CalenContextImpl() |
86 { |
75 { |
87 TRACE_ENTRY_POINT; |
76 if(mMutlipleContextIds.count()) |
88 if(iCalAlarmEntryFileName) |
77 { |
89 { |
78 mMutlipleContextIds.clear(); |
90 delete iCalAlarmEntryFileName; |
79 } |
91 iCalAlarmEntryFileName = NULL; |
80 } |
92 } |
81 |
93 TRACE_EXIT_POINT; |
82 // ---------------------------------------------------------------------------- |
94 } |
83 // CalenContextImpl::DefaultTimeForViews |
95 |
|
96 // ---------------------------------------------------------------------------- |
|
97 // CCalenContextImpl::DefaultTimeForViews |
|
98 // If a view knows what day they should be looking at, but doesn't know what |
84 // If a view knows what day they should be looking at, but doesn't know what |
99 // time (for example the month view only deals in days), they should set the |
85 // time (for example the month view only deals in days), they should set the |
100 // time to this value. |
86 // time to this value. |
101 // (other items were commented in a header). |
87 // (other items were commented in a header). |
102 // ---------------------------------------------------------------------------- |
88 // ---------------------------------------------------------------------------- |
103 // |
89 // |
104 TTimeIntervalMinutes CCalenContextImpl::DefaultTimeForViews() const |
90 int CalenContextImpl::defaultTimeForViewsInMinnutes() const |
105 { |
91 { |
106 TRACE_ENTRY_POINT; |
92 return KCalenDefaultTimeForViews; |
107 TRACE_EXIT_POINT; |
93 } |
108 return TTimeIntervalMinutes( KCalenDefaultTimeForViews ); |
94 |
109 } |
95 // ---------------------------------------------------------------------------- |
110 |
96 // CalenContextImpl::DefaultCalTimeForViewsL |
111 // ---------------------------------------------------------------------------- |
|
112 // CCalenContextImpl::DefaultCalTimeForViewsL |
|
113 // If a view has no preference as to what time/day to be focused on (e.g. when |
97 // If a view has no preference as to what time/day to be focused on (e.g. when |
114 // a view is the first view loaded), they should set focus to this TCalTime. |
98 // a view is the first view loaded), they should set focus to this TCalTime. |
115 // (other items were commented in a header). |
99 // (other items were commented in a header). |
116 // ---------------------------------------------------------------------------- |
100 // ---------------------------------------------------------------------------- |
117 // |
101 // |
118 TCalTime CCalenContextImpl::DefaultCalTimeForViewsL() const |
102 QDateTime CalenContextImpl::defaultCalTimeForViewsL() const |
119 { |
103 { |
120 TRACE_ENTRY_POINT; |
104 QDateTime ret = CalenDateUtils::today(); |
121 |
105 QTime currentTime = ret.time(); |
122 TTime today; |
106 currentTime.setHMS(7, 0, 0, 0); |
123 today.HomeTime(); |
107 ret.setTime(currentTime); |
124 today = CalenDateUtils::BeginningOfDay( today ); |
108 |
125 TCalTime ret; |
|
126 ret.SetTimeLocalL( today + CCalenContextImpl::DefaultTimeForViews() ); |
|
127 |
|
128 TRACE_EXIT_POINT; |
|
129 return ret; |
109 return ret; |
130 } |
110 } |
131 |
111 |
132 // ---------------------------------------------------------------------------- |
112 // ---------------------------------------------------------------------------- |
133 // CCalenContextImpl::SetFocusDateAndTimeL |
113 // CalenContextImpl::SetFocusDateAndTimeL |
134 // Sets the focus time |
114 // Sets the focus time |
135 // (other items were commented in a header). |
115 // (other items were commented in a header). |
136 // ---------------------------------------------------------------------------- |
116 // ---------------------------------------------------------------------------- |
137 // |
117 // |
138 void CCalenContextImpl::SetFocusDateAndTimeL( const TCalTime& aFocusDateTime, |
118 void CalenContextImpl::setFocusDateAndTime( const QDateTime& focusDateTime) |
139 const TVwsViewId& aViewId ) |
119 { |
140 { |
120 |
141 TRACE_ENTRY_POINT; |
121 mFocusDate = focusDateTime; |
|
122 mFocusTime = focusDateTime.time().minute() + 1; |
|
123 |
|
124 if( mFocusTime < 0 ) |
|
125 mFocusTime = 0; |
|
126 mInstanceId = TCalenInstanceId::nullInstanceId(); |
142 |
127 |
143 // If this fails you're using a context that was constructed yourself. |
128 // If this fails you're using a context that was constructed yourself. |
144 // Use the accessor from the global data instead, or don't try to set |
129 // Use the accessor from the global data instead, or don't try to set |
145 // anything on this context. |
130 // anything on this context. |
146 ASSERT( iObserver ); |
131 if(mObserver) |
147 |
132 mObserver->ContextChanged(); |
148 #ifdef _DEBUG |
133 } |
149 TDateTime dt = aFocusDateTime.TimeLocalL().DateTime(); |
134 |
150 #endif |
135 // ---------------------------------------------------------------------------- |
151 |
136 // CalenContextImpl::SetFocusDateL |
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 |
|
166 // Sets the focus date |
137 // Sets the focus date |
167 // (other items were commented in a header). |
138 // (other items were commented in a header). |
168 // ---------------------------------------------------------------------------- |
139 // ---------------------------------------------------------------------------- |
169 // |
140 // |
170 void CCalenContextImpl::SetFocusDateL( const TCalTime& aFocusDate, |
141 void CalenContextImpl::setFocusDate( const QDateTime& focusDateTime) |
171 const TVwsViewId& aViewId ) |
142 { |
172 { |
143 mFocusDate = focusDateTime; |
173 TRACE_ENTRY_POINT; |
144 mFocusTime = -1; |
|
145 mInstanceId = TCalenInstanceId::nullInstanceId(); |
174 |
146 |
175 // If this fails you're using a context that was constructed yourself. |
147 // If this fails you're using a context that was constructed yourself. |
176 // Use the accessor from the global data instead, or don't try to set |
148 // Use the accessor from the global data instead, or don't try to set |
177 // anything on this context. |
149 // anything on this context. |
178 ASSERT( iObserver ); |
150 if(mObserver) |
179 |
151 mObserver->ContextChanged(); |
180 #ifdef _DEBUG |
152 } |
181 TDateTime dt = aFocusDate.TimeLocalL().DateTime(); |
153 |
182 #endif |
154 // ---------------------------------------------------------------------------- |
183 |
155 // CalenContextImpl::SetInstanceIdL |
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 |
|
196 // Sets the instance id |
156 // Sets the instance id |
197 // (other items were commented in a header). |
157 // (other items were commented in a header). |
198 // ---------------------------------------------------------------------------- |
158 // ---------------------------------------------------------------------------- |
199 // |
159 // |
200 void CCalenContextImpl::SetInstanceIdL( const TCalenInstanceId& aInstanceId, |
160 void CalenContextImpl::setInstanceId( const TCalenInstanceId& aInstanceId ) |
201 const TVwsViewId& aViewId ) |
161 { |
202 { |
162 |
203 TRACE_ENTRY_POINT; |
163 // Set the null date and time |
|
164 mFocusDate = QDateTime(); |
|
165 mFocusTime = -1; |
|
166 mInstanceId = aInstanceId; |
204 |
167 |
205 // If this fails you're using a context that was constructed yourself. |
168 // If this fails you're using a context that was constructed yourself. |
206 // Use the accessor from the global data instead, or don't try to set |
169 // Use the accessor from the global data instead, or don't try to set |
207 // anything on this context. |
170 // anything on this context. |
208 ASSERT( iObserver ); |
171 if(mObserver) |
209 |
172 mObserver->ContextChanged(); |
210 iFocusDate.SetTimeUtcL( Time::NullTTime() ); |
173 } |
211 iFocusTime = TTimeIntervalMinutes( -1 ); |
174 |
212 iInstanceId = aInstanceId; |
175 // ----------------------------------------------------------------------------- |
213 iViewId = aViewId; |
176 // CalenContextImpl::SetFocusDateAndTimeAndInstanceL |
214 |
|
215 iObserver->ContextChanged(); |
|
216 |
|
217 TRACE_EXIT_POINT; |
|
218 } |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // CCalenContextImpl::SetFocusDateAndTimeAndInstanceL |
|
222 // Sets the currently focused time and instance |
177 // Sets the currently focused time and instance |
223 // (other items were commented in a header). |
178 // (other items were commented in a header). |
224 // ----------------------------------------------------------------------------- |
179 // ----------------------------------------------------------------------------- |
225 // |
180 // |
226 void CCalenContextImpl::SetFocusDateAndTimeAndInstanceL( const TCalTime& aFocusDateTime, |
181 void CalenContextImpl::setFocusDateAndTimeAndInstance( const QDateTime& focusDateTime, |
227 const TCalenInstanceId& aInstanceId, |
182 const TCalenInstanceId& instanceId ) |
228 const TVwsViewId& aViewId ) |
183 { |
229 { |
184 mFocusDate = focusDateTime; |
230 TRACE_ENTRY_POINT; |
185 mFocusTime = focusDateTime.time().minute() + 1; |
|
186 if( mFocusTime < 0 ) |
|
187 mFocusTime = 0; |
|
188 mInstanceId = instanceId; |
231 |
189 |
232 // 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. |
233 // 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 |
234 // anything on this context. |
192 // anything on this context. |
235 ASSERT( iObserver ); |
193 if(mObserver) |
236 |
194 mObserver->ContextChanged(); |
237 #ifdef _DEBUG |
195 } |
238 TDateTime dt = aFocusDateTime.TimeLocalL().DateTime(); |
196 |
239 #endif |
197 // ----------------------------------------------------------------------------- |
240 |
198 // CalenContextImpl::FocusDateAndTimeL |
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 |
|
255 // Returns the focus time |
199 // Returns the focus time |
256 // (other items were commented in a header). |
200 // (other items were commented in a header). |
257 // ----------------------------------------------------------------------------- |
201 // ----------------------------------------------------------------------------- |
258 // |
202 // |
259 TCalTime CCalenContextImpl::FocusDateAndTimeL() const |
203 QDateTime CalenContextImpl::focusDateAndTime() const |
260 { |
204 { |
261 TRACE_ENTRY_POINT; |
205 QDateTime ret; |
262 |
206 |
263 TCalTime ret; |
207 if( mFocusDate.isValid() ) |
264 |
|
265 if( iFocusDate.TimeUtcL() != Time::NullTTime() ) |
|
266 { |
208 { |
267 if ( iFocusTime.Int() >= 0 ) |
209 ret = mFocusDate; |
268 { |
|
269 ret.SetTimeLocalL( iFocusDate.TimeLocalL() + iFocusTime ); |
|
270 } |
|
271 else |
|
272 { |
|
273 ret.SetTimeLocalL( iFocusDate.TimeLocalL() + DefaultTimeForViews() ); |
|
274 } |
|
275 } |
210 } |
276 else |
211 else |
277 { |
212 { |
278 ret.SetTimeLocalL( iInstanceId.iInstanceTime ); |
213 ret = mInstanceId.mInstanceTime; |
279 } |
214 } |
280 |
215 |
281 TRACE_EXIT_POINT; |
|
282 return ret; |
216 return ret; |
283 } |
217 } |
284 |
218 |
285 // ----------------------------------------------------------------------------- |
219 // ----------------------------------------------------------------------------- |
286 // CCalenContextImpl::FocusTime |
220 // CalenContextImpl::FocusTime |
287 // Returns the focus time |
221 // Returns the focus time |
288 // (other items were commented in a header). |
222 // (other items were commented in a header). |
289 // ----------------------------------------------------------------------------- |
223 // ----------------------------------------------------------------------------- |
290 // |
224 // |
291 TTimeIntervalMinutes CCalenContextImpl::FocusTime() const |
225 int CalenContextImpl::focusTime() const |
292 { |
226 { |
293 TRACE_ENTRY_POINT; |
227 TRACE_ENTRY_POINT; |
294 TRACE_EXIT_POINT; |
228 TRACE_EXIT_POINT; |
295 return iFocusTime; |
229 return mFocusTime; |
296 } |
230 } |
297 |
231 |
298 // ----------------------------------------------------------------------------- |
232 // ----------------------------------------------------------------------------- |
299 // CCalenContextImpl::InstanceId |
233 // CalenContextImpl::InstanceId |
300 // Returns the instance id |
234 // Returns the instance id |
301 // (other items were commented in a header). |
235 // (other items were commented in a header). |
302 // ----------------------------------------------------------------------------- |
236 // ----------------------------------------------------------------------------- |
303 // |
237 // |
304 TCalenInstanceId CCalenContextImpl::InstanceId() const |
238 TCalenInstanceId CalenContextImpl::instanceId() const |
305 { |
239 { |
306 TRACE_ENTRY_POINT; |
240 TRACE_ENTRY_POINT; |
307 TRACE_EXIT_POINT; |
241 TRACE_EXIT_POINT; |
308 return iInstanceId; |
242 return mInstanceId; |
309 } |
243 } |
310 |
244 |
311 // ----------------------------------------------------------------------------- |
245 // ----------------------------------------------------------------------------- |
312 // CCalenContextImpl::ViewId |
246 // CalenContextImpl::SetMutlipleContextIds |
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 |
|
326 // Set multiple context ids |
247 // Set multiple context ids |
327 // (other items were commented in a header). |
248 // (other items were commented in a header). |
328 // ----------------------------------------------------------------------------- |
249 // ----------------------------------------------------------------------------- |
329 // |
250 // |
330 void CCalenContextImpl::SetMutlipleContextIds( |
251 void CalenContextImpl::setMutlipleContextIds( |
331 RArray<TCalenInstanceId>& aMutlipleContextIds) |
252 QList<TCalenInstanceId>& mutlipleContextIds) |
|
253 { |
|
254 |
|
255 mMutlipleContextIds.clear(); |
|
256 mMutlipleContextIds = mutlipleContextIds; |
|
257 |
|
258 } |
|
259 |
|
260 // ----------------------------------------------------------------------------- |
|
261 // CalenContextImpl::RemoveMultipleContextId |
|
262 // Remove multiple context id |
|
263 // (other items were commented in a header). |
|
264 // ----------------------------------------------------------------------------- |
|
265 // |
|
266 void CalenContextImpl::removeMultipleContextId(TCalenInstanceId instanceId) |
332 { |
267 { |
333 TRACE_ENTRY_POINT; |
268 |
334 |
269 for(int index = 0;index < mMutlipleContextIds.count();index++) |
335 iMutlipleContextIds.Reset(); |
|
336 iMutlipleContextIds = aMutlipleContextIds; |
|
337 |
|
338 TRACE_EXIT_POINT; |
|
339 } |
|
340 |
|
341 // ----------------------------------------------------------------------------- |
|
342 // CCalenContextImpl::RemoveMultipleContextId |
|
343 // Remove multiple context id |
|
344 // (other items were commented in a header). |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 void CCalenContextImpl::RemoveMultipleContextId(TCalenInstanceId aInstanceId) |
|
348 { |
|
349 TRACE_ENTRY_POINT; |
|
350 |
|
351 for(TInt index = 0;index < iMutlipleContextIds.Count();index++) |
|
352 { |
270 { |
353 if(aInstanceId == iMutlipleContextIds[index]) |
271 if(instanceId == mMutlipleContextIds[index]) |
354 { |
272 { |
355 iMutlipleContextIds.Remove(index); |
273 mMutlipleContextIds.removeAt(index); |
356 } |
274 } |
357 } |
275 } |
358 |
276 |
359 TRACE_EXIT_POINT; |
277 } |
360 } |
278 |
361 |
279 // ----------------------------------------------------------------------------- |
362 // ----------------------------------------------------------------------------- |
280 // CalenContextImpl::ResetMultipleContextIds |
363 // CCalenContextImpl::ResetMultipleContextIds |
|
364 // Resets all the multiple context ids |
281 // Resets all the multiple context ids |
365 // (other items were commented in a header). |
282 // (other items were commented in a header). |
366 // ----------------------------------------------------------------------------- |
283 // ----------------------------------------------------------------------------- |
367 // |
284 // |
368 void CCalenContextImpl::ResetMultipleContextIds(TInt /*aDbId*/) |
285 void CalenContextImpl::resetMultipleContextIds(TInt /*aDbId*/) |
369 { |
286 { |
370 TRACE_ENTRY_POINT; |
287 |
371 |
288 if(mMutlipleContextIds.count()) |
372 //if(iMutlipleContextIds.Count()) |
|
373 { |
289 { |
374 iMutlipleContextIds.Reset(); |
290 mMutlipleContextIds.clear(); |
375 iMutlipleContextIds.Close(); |
|
376 } |
291 } |
377 |
292 |
378 TRACE_EXIT_POINT; |
293 } |
|
294 |
|
295 // ----------------------------------------------------------------------------- |
|
296 // CalenContextImpl::GetMutlipleContextIds |
|
297 // Getter for multiple context ids |
|
298 // (other items were commented in a header). |
|
299 // ----------------------------------------------------------------------------- |
|
300 // |
|
301 QList<TCalenInstanceId>& CalenContextImpl::getMutlipleContextIds(TInt /*aDbId*/) |
|
302 { |
|
303 return mMutlipleContextIds; |
379 } |
304 } |
380 |
305 |
381 // ----------------------------------------------------------------------------- |
306 // ----------------------------------------------------------------------------- |
382 // CCalenContextImpl::GetMutlipleContextIds |
307 // CalenContextImpl::MutlipleContextIdsCount |
383 // Getter for multiple context ids |
308 // Returns mutliple context's count |
384 // (other items were commented in a header). |
309 // (other items were commented in a header). |
385 // ----------------------------------------------------------------------------- |
310 // ----------------------------------------------------------------------------- |
386 // |
311 // |
387 RArray<TCalenInstanceId>& CCalenContextImpl::GetMutlipleContextIds(TInt /*aDbId*/) |
312 int CalenContextImpl::mutlipleContextIdsCount() |
388 { |
313 { |
389 TRACE_ENTRY_POINT; |
314 return mMutlipleContextIds.count(); |
390 TRACE_EXIT_POINT; |
|
391 |
|
392 return iMutlipleContextIds; |
|
393 } |
315 } |
394 |
|
395 // ----------------------------------------------------------------------------- |
|
396 // CCalenContextImpl::MutlipleContextIdsCount |
|
397 // Returns mutliple context's count |
|
398 // (other items were commented in a header). |
|
399 // ----------------------------------------------------------------------------- |
|
400 // |
|
401 TInt CCalenContextImpl::MutlipleContextIdsCount() |
|
402 { |
|
403 TRACE_ENTRY_POINT; |
|
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 } |
|
586 // End of file |
316 // End of file |