|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "calentryimpl.h" |
|
17 #include "agmentry.h" |
|
18 #include <e32math.h> |
|
19 |
|
20 /** Allocates and constructs a new entry of the specified type, Global UID |
|
21 and sequence number. |
|
22 |
|
23 The entry's data is all initialised to default values, e.g. |
|
24 the start and end dates are reset to null. |
|
25 |
|
26 The entry takes ownership of the Uid descriptor. |
|
27 |
|
28 Note that this function will not work unless a CCalSession has been created |
|
29 by calling CCalSession::NewL(). |
|
30 |
|
31 @param aType One of: EAppt, ETodo, EEvent, EReminder, EAnniv to create |
|
32 an appointment, a todo, an event, a reminder or an anniversary entry. |
|
33 @param aUid The Global UID of the entry. This field is mandatory. NewL takes ownership of the global UID. |
|
34 @param aMethod The Method value describing the entry. Default value is EGSMethodNone. |
|
35 @param aSeqNum The sequence number of the entry. Default value is 0. |
|
36 @return Pointer to the new entry. |
|
37 @capability None |
|
38 @publishedAll |
|
39 @released |
|
40 */ |
|
41 EXPORT_C CCalEntry* CCalEntry::NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum) |
|
42 { |
|
43 CCalEntry* entry = new (ELeave) CCalEntry(); |
|
44 CleanupStack::PushL(entry); |
|
45 entry->ConstructL(aType, aUid, aMethod, aSeqNum); |
|
46 CleanupStack::Pop(entry); |
|
47 return entry; |
|
48 } |
|
49 |
|
50 /** Allocates and constructs a new entry of the specified type, Global UID, |
|
51 sequence number and recurrence ID. |
|
52 |
|
53 The entry takes ownership of the Uid descriptor. |
|
54 |
|
55 @param aType One of: EAppt, ETodo, EEvent, EReminder, EAnniv to create |
|
56 an appointment, a todo, an event, a reminder or an anniversary entry. |
|
57 @param aUid The Global UID of the entry. This field is mandatory. NewL takes ownership of the global UID. |
|
58 @param aMethod The Method value describing the entry. |
|
59 @param aSeqNum The sequence number of the entry. |
|
60 @param aRecurrenceId The recurrence ID of the entry. |
|
61 @param aRange The recurrence ID range of the entry. |
|
62 @return Pointer to the new entry. |
|
63 @leave KErrArgument If the UID passed is invalid |
|
64 @panic CalInterimAPI 8 If the entry type passed is invalid |
|
65 @capability None |
|
66 @publishedAll |
|
67 @released |
|
68 */ |
|
69 EXPORT_C CCalEntry* CCalEntry::NewL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum, |
|
70 const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange) |
|
71 { |
|
72 CCalEntry* entry = new (ELeave) CCalEntry(); |
|
73 CleanupStack::PushL(entry); |
|
74 entry->ConstructL(aType, aUid, aMethod, aSeqNum, aRecurrenceId, aRange); |
|
75 CleanupStack::Pop(entry); |
|
76 return entry; |
|
77 } |
|
78 |
|
79 // Takes ownership of the implementation class |
|
80 CCalEntry* CCalEntry::NewL(CCalEntryImpl* aImpl) |
|
81 { |
|
82 CCalEntry* entry = new (ELeave) CCalEntry(); |
|
83 CleanupStack::PushL(entry); |
|
84 entry->ConstructL(aImpl); |
|
85 CleanupStack::Pop(entry); |
|
86 return entry; |
|
87 } |
|
88 |
|
89 void CCalEntry::ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum) |
|
90 { |
|
91 iImpl = CCalEntryImpl::NewL(aType, aUid, aMethod, aSeqNum); |
|
92 } |
|
93 |
|
94 void CCalEntry::ConstructL(TType aType, HBufC8* aUid, TMethod aMethod, TUint aSeqNum, const TCalTime& aRecurrenceId, CalCommon::TRecurrenceRange aRange) |
|
95 { |
|
96 iImpl = CCalEntryImpl::NewL(aType, aUid, aMethod, aSeqNum, aRecurrenceId, aRange); |
|
97 } |
|
98 |
|
99 void CCalEntry::ConstructL(CCalEntryImpl* aImpl) |
|
100 { |
|
101 iImpl = aImpl; |
|
102 } |
|
103 |
|
104 CCalEntryImpl* CCalEntry::Impl() const |
|
105 { |
|
106 return iImpl; |
|
107 } |
|
108 |
|
109 /** The destructor frees all resources owned by the entry, prior to its destruction. |
|
110 |
|
111 @publishedAll |
|
112 @released |
|
113 @capability None |
|
114 */ |
|
115 EXPORT_C CCalEntry::~CCalEntry() |
|
116 { |
|
117 delete iImpl; |
|
118 } |
|
119 |
|
120 /** Compares another entry for equality with this one. |
|
121 |
|
122 @param aEntry Pointer to an entry. |
|
123 @return ETrue if aEntry is the same as this entry, EFalse if not. |
|
124 @publishedAll |
|
125 @released |
|
126 @capability None |
|
127 */ |
|
128 EXPORT_C TBool CCalEntry::CompareL(const CCalEntry& aEntry) const |
|
129 { |
|
130 return iImpl->CompareL(aEntry); |
|
131 } |
|
132 |
|
133 /** Copies the contents of another entry to this one. |
|
134 All entry fields will be overwritten, including the UID and the local UID. This is identical to calling CopyFromL(aOther, ECopyAll). |
|
135 |
|
136 Please note that this function cannot be called under the following conditions: |
|
137 - if a file attachment has been added to this entry by its file handle, AND |
|
138 - if that entry has not been stored in the calendar store yet. |
|
139 |
|
140 @param aOther Reference to source entry. |
|
141 @panic CalInterimAPI 7 If the entry type is invalid |
|
142 @publishedAll |
|
143 @released |
|
144 @capability None |
|
145 */ |
|
146 |
|
147 EXPORT_C void CCalEntry::CopyFromL(const CCalEntry& aOther) |
|
148 { |
|
149 iImpl->CopyFromL(*aOther.iImpl, ECopyAll); |
|
150 } |
|
151 |
|
152 |
|
153 /** Copies the contents of another entry to this one. |
|
154 The entry fields that are copied can be specified using the TCopyType parameter. |
|
155 |
|
156 @param aOther Reference to source entry. |
|
157 @param aCopyType Which entry details are to be copied. |
|
158 ECopyAll if original entry and new entry should be identical. This is identical to calling CopyFromL(aOther). |
|
159 EDontCopyId if UID and local UID should not be copied, this should be used when creating a modifying entry. |
|
160 @panic CalInterimAPI 7 If the entry type is invalid |
|
161 @publishedAll |
|
162 @released |
|
163 @capability None |
|
164 */ |
|
165 |
|
166 EXPORT_C void CCalEntry::CopyFromL(const CCalEntry& aOther, TCopyType aCopyType) |
|
167 { |
|
168 iImpl->CopyFromL(*aOther.iImpl, aCopyType); |
|
169 } |
|
170 |
|
171 /** Set the alarm for the entry. |
|
172 |
|
173 This doesn't take ownership of the parameter. |
|
174 This function will leave with KErrNotSupported if the alarm is not on same day. |
|
175 @param aAlarm Pointer to the alarm, or NULL if the alarm is to be cleared. |
|
176 @leave KErrNotSupported if the alarm offset is less than KCalAlarmMinValidOffset. |
|
177 @publishedAll |
|
178 @released |
|
179 @capability None |
|
180 */ |
|
181 EXPORT_C void CCalEntry::SetAlarmL(CCalAlarm* aAlarm) |
|
182 { |
|
183 iImpl->SetAlarmL(aAlarm); |
|
184 } |
|
185 |
|
186 /** Creates an alarm class containing data for this entry's alarm. |
|
187 |
|
188 @return Pointer to a new alarm object, or NULL if this entry doesn't have one. Returns ownership. |
|
189 @publishedAll |
|
190 @released |
|
191 @capability None |
|
192 */ |
|
193 EXPORT_C CCalAlarm* CCalEntry::AlarmL() const |
|
194 { |
|
195 return iImpl->AlarmL(); |
|
196 } |
|
197 |
|
198 /** Sets the entry's repeat definition. |
|
199 |
|
200 The repeat definition includes daily, weekly, monthly and yearly repeat |
|
201 details, and start and end details. |
|
202 |
|
203 If the start time of the entry is different from the start time of the |
|
204 repeat rule, the entry's start time will be used. |
|
205 Also, the start time of the entry may be adjusted if it does not match an |
|
206 instance of the repeat rule. |
|
207 |
|
208 This does not take ownership of the parameter. |
|
209 @leave KErrNotSupported If the repeat rule passed is not one that is currently supported |
|
210 @leave KErrArgument if this is a todo entry and its end date has not been set or this is a non-todo entry and its start date has not been set. |
|
211 @leave KErrArgument if the until date of the repeat definition is non-NULL and is earlier than the start date. |
|
212 @param aRpt The new repeat definition. |
|
213 @publishedAll |
|
214 @released |
|
215 @capability None |
|
216 */ |
|
217 EXPORT_C void CCalEntry::SetRRuleL(const TCalRRule& aRpt) |
|
218 { |
|
219 return iImpl->SetRRuleL(aRpt); |
|
220 } |
|
221 |
|
222 /** Get the entry's repeat rule. |
|
223 |
|
224 In the returned TCalRRule, both the Count and the Until values can be accessed. However, in |
|
225 the case of a repeat rule which repeats forever, the Count will always be returned as 0. |
|
226 |
|
227 @param aRule On return contains the entry's repeat rule data, if present. |
|
228 @return ETrue if the entry has a repeat rule, EFalse if not. |
|
229 @publishedAll |
|
230 @released |
|
231 @capability None |
|
232 */ |
|
233 EXPORT_C TBool CCalEntry::GetRRuleL(TCalRRule& aRule) const |
|
234 { |
|
235 return Impl()->GetRRuleL(aRule); |
|
236 } |
|
237 |
|
238 /** Clears the repeat details including exceptions and unsets the entry's 'is repeating' |
|
239 property. |
|
240 @capability None |
|
241 @publishedAll |
|
242 @released |
|
243 @capability None |
|
244 */ |
|
245 EXPORT_C void CCalEntry::ClearRepeatingPropertiesL() |
|
246 { |
|
247 iImpl->ClearRepeatingPropertiesL(); |
|
248 } |
|
249 |
|
250 /** |
|
251 Gets the last modified date/time for this entry. |
|
252 |
|
253 The last modified date of an entry is updated when: |
|
254 |
|
255 - an entry is created using CCalEntry::NewL() |
|
256 - an entry is updated in the calendar store using CCalEntryView::UpdateL() |
|
257 - an existing entry is updated in the calendar store using CCalEntryView::StoreL() |
|
258 - the client calls CCalEntry::SetLastModifiedDateL() on the entry |
|
259 - the time zone rules (if any) associated with the entry are updated |
|
260 |
|
261 @return The time at which the entry was last modified. |
|
262 |
|
263 @publishedAll |
|
264 @released |
|
265 */ |
|
266 EXPORT_C TCalTime CCalEntry::LastModifiedDateL() const |
|
267 { |
|
268 return iImpl->LastModifiedDateL(); |
|
269 } |
|
270 |
|
271 /** Gets the entry's DTSTAMP. |
|
272 @return The DTSTAMP of the entry. |
|
273 @publishedAll |
|
274 @released |
|
275 */ |
|
276 EXPORT_C TCalTime CCalEntry::DTStampL() const |
|
277 { |
|
278 return iImpl->DTStampL(); |
|
279 } |
|
280 |
|
281 /** Sets the contents of the entry's location field. |
|
282 |
|
283 @param aLocation Descriptor containing a location, e.g. for a meeting. |
|
284 @publishedAll |
|
285 @released |
|
286 @capability None |
|
287 */ |
|
288 EXPORT_C void CCalEntry::SetLocationL(const TDesC& aLocation) |
|
289 { |
|
290 iImpl->SetLocationL(aLocation); |
|
291 } |
|
292 |
|
293 /** Gets the contents of the entry's location field. |
|
294 |
|
295 @return The location field. |
|
296 @publishedAll |
|
297 @released |
|
298 @capability None |
|
299 */ |
|
300 EXPORT_C const TDesC& CCalEntry::LocationL() const |
|
301 { |
|
302 return iImpl->LocationL(); |
|
303 } |
|
304 |
|
305 /** Gets a list of the entry's categories. |
|
306 |
|
307 @return An array of categories. |
|
308 @publishedAll |
|
309 @released |
|
310 @capability None |
|
311 */ |
|
312 EXPORT_C const RPointerArray<CCalCategory>& CCalEntry::CategoryListL() |
|
313 { |
|
314 return iImpl->CategoryListL(); |
|
315 } |
|
316 |
|
317 /** Appends a category to the entry's list of categories. |
|
318 |
|
319 The entry takes ownership of the category specified. |
|
320 |
|
321 @param aCategory The category to be added. This function takes ownership of the CCalCategory immediately so it should not be |
|
322 put on the cleanup stack before calling this function. |
|
323 @leave KErrArgument if aCategory is NULL. |
|
324 @publishedAll |
|
325 @released |
|
326 @capability None |
|
327 */ |
|
328 EXPORT_C void CCalEntry::AddCategoryL(CCalCategory* aCategory) |
|
329 { |
|
330 iImpl->AddCategoryL(aCategory); |
|
331 } |
|
332 |
|
333 /** Deletes a category from the entry's list of categories. |
|
334 |
|
335 @param aIndex The category to be deleted. |
|
336 @leave KErrArgument If the index is out of range. Check CCalEntry::CategoryListL first to find out the range of allowed indexes. |
|
337 @publishedAll |
|
338 @released |
|
339 @capability None |
|
340 */ |
|
341 EXPORT_C void CCalEntry::DeleteCategoryL(TInt aIndex) |
|
342 { |
|
343 iImpl->DeleteCategoryL(aIndex); |
|
344 } |
|
345 |
|
346 /** Sets the priority for the entry. |
|
347 |
|
348 The default value is zero. |
|
349 |
|
350 @param aPriority Priority value between 0 and 255. The behaviour is undefined if the priority is greater than 255. |
|
351 @leave KErrArgument if the priority value is not between 0 and 255. |
|
352 @publishedAll |
|
353 @released |
|
354 @capability None |
|
355 */ |
|
356 EXPORT_C void CCalEntry::SetPriorityL(TUint aPriority) |
|
357 { |
|
358 __ASSERT_ALWAYS(aPriority <= 255, User::Leave(KErrArgument)); |
|
359 iImpl->SetPriorityL(aPriority); |
|
360 } |
|
361 |
|
362 /** Gets the priority of the entry. |
|
363 |
|
364 @return Priority value between 0 and 255. |
|
365 @publishedAll |
|
366 @released |
|
367 @capability None |
|
368 */ |
|
369 EXPORT_C TUint CCalEntry::PriorityL() const |
|
370 { |
|
371 return iImpl->PriorityL(); |
|
372 } |
|
373 |
|
374 /** Gets the start date/time for an entry. |
|
375 |
|
376 @return The entry's start date/time. |
|
377 @publishedAll |
|
378 @released |
|
379 @capability None |
|
380 */ |
|
381 EXPORT_C TCalTime CCalEntry::StartTimeL() const |
|
382 { |
|
383 return iImpl->StartTimeL(); |
|
384 } |
|
385 |
|
386 /** Gets the entry's end date/time. |
|
387 |
|
388 @return The entry's end date/time. |
|
389 @publishedAll |
|
390 @released |
|
391 @capability None |
|
392 */ |
|
393 EXPORT_C TCalTime CCalEntry::EndTimeL() const |
|
394 { |
|
395 return iImpl->EndTimeL(); |
|
396 } |
|
397 |
|
398 /** Sets the start and end date/times for an entry. |
|
399 |
|
400 For an appointment, event or anniversary, the start time must be earlier than or equal to the end time. |
|
401 For a reminder, the end time will be ignored. |
|
402 For a todo entry, the end time is the 'due date'. If the end time is Time::NullTTime in a todo, then |
|
403 the todo is undated - in this case both start and end date are set to Time::NullTTime. |
|
404 Only todos can be undated. |
|
405 |
|
406 @param aStartDateTime The entry's new start date/time. |
|
407 @param aEndDateTime The entry's new end date/time. |
|
408 @leave KErrArgument If the start and end times are invalid. |
|
409 @publishedAll |
|
410 @released |
|
411 @capability None |
|
412 */ |
|
413 EXPORT_C void CCalEntry::SetStartAndEndTimeL(const TCalTime& aStartDateTime, const TCalTime& aEndDateTime) |
|
414 { |
|
415 iImpl->SetStartAndEndTimeL(aStartDateTime, aEndDateTime); |
|
416 } |
|
417 |
|
418 |
|
419 /** Gets a to-do entry's completed date. |
|
420 |
|
421 This is the date on which the required action was carried out. |
|
422 If the entry has not been crossed out, or if this is not a to-do entry, then |
|
423 this function returns a null value. |
|
424 |
|
425 @return The to-do entry's crossed out date. |
|
426 |
|
427 @publishedAll |
|
428 @released |
|
429 @capability None |
|
430 */ |
|
431 EXPORT_C TCalTime CCalEntry::CompletedTimeL() const |
|
432 { |
|
433 return iImpl->CompletedTimeL(); |
|
434 } |
|
435 |
|
436 /** Sets the crossed out date for a to-do entry. |
|
437 This is the date on which the required action was carried out. |
|
438 |
|
439 If this function is called on an entry which is not a to-do, it will leave |
|
440 with KErrNotSupported. |
|
441 |
|
442 @param aCompleted ETrue if the to-do entry is complete - the entry's status is |
|
443 set to ETodoCompleted; EFalse if the to-do entry is not complete - the entry's status is |
|
444 set to ETodoNeedsAction |
|
445 @param aDate The to-do entry's crossed out date. The time mode should not be |
|
446 floating, it will leave with KErrArgument if it is. |
|
447 |
|
448 @publishedAll |
|
449 @released |
|
450 @capability None |
|
451 */ |
|
452 EXPORT_C void CCalEntry::SetCompletedL(TBool aCompleted, const TCalTime& aDate) |
|
453 { |
|
454 // It doesn't make sense for the completed time to be floating. |
|
455 if (aDate.TimeMode() == TCalTime::EFloating) |
|
456 { |
|
457 User::Leave( KErrArgument ); |
|
458 } |
|
459 |
|
460 iImpl->SetCompletedL(aCompleted, aDate); |
|
461 } |
|
462 |
|
463 /** Sets the summary text for this entry. |
|
464 |
|
465 @param aSummary The summary text. |
|
466 @leave KErrNotFound If a handle to the entry's summary could not be obtained |
|
467 @publishedAll |
|
468 @released |
|
469 @capability None |
|
470 */ |
|
471 EXPORT_C void CCalEntry::SetSummaryL(const TDesC& aSummary) |
|
472 { |
|
473 iImpl->SetSummaryL(aSummary); |
|
474 } |
|
475 |
|
476 /** Gets the summary for the entry. |
|
477 |
|
478 @return Descriptor pointer to the summary text. |
|
479 @leave KErrNotFound If a handle to the entry's summary could not be obtained |
|
480 @publishedAll |
|
481 @released |
|
482 @capability None |
|
483 */ |
|
484 EXPORT_C const TDesC& CCalEntry::SummaryL() const |
|
485 { |
|
486 return iImpl->SummaryL(); |
|
487 } |
|
488 |
|
489 /** Sets the description text for this entry. |
|
490 |
|
491 @param aDescription The summary text. |
|
492 |
|
493 @publishedAll |
|
494 @released |
|
495 @capability None |
|
496 */ |
|
497 EXPORT_C void CCalEntry::SetDescriptionL(const TDesC& aDescription) |
|
498 { |
|
499 iImpl->SetDescriptionL(aDescription); |
|
500 } |
|
501 |
|
502 /** Gets the description text for the entry. |
|
503 |
|
504 @return Descriptor pointer to the description text. |
|
505 |
|
506 @publishedAll |
|
507 @released |
|
508 */ |
|
509 EXPORT_C const TDesC& CCalEntry::DescriptionL() const |
|
510 { |
|
511 return iImpl->DescriptionL(); |
|
512 } |
|
513 |
|
514 /** Gets the type of entry. |
|
515 |
|
516 @return The entry type. One of: EAppt, ETodo, EEvent, EReminder, EAnniv. |
|
517 |
|
518 @publishedAll |
|
519 @released |
|
520 @capability None |
|
521 */ |
|
522 EXPORT_C CCalEntry::TType CCalEntry::EntryTypeL() const |
|
523 { |
|
524 return iImpl->EntryTypeL(); |
|
525 } |
|
526 |
|
527 /** Sets the entry status. |
|
528 |
|
529 For a to-do entry, this is one of: ECancelled, ETodoNeedsAction, |
|
530 ETodoCompleted, ETodoInProgress. |
|
531 |
|
532 For any other entry types, this is one of: ECancelled, ETentative, |
|
533 EConfirmed. |
|
534 |
|
535 Passing a value in which does not match the entry type will result |
|
536 in a panic. |
|
537 |
|
538 @param aStatus The status. |
|
539 @leave KErrArgument If the status passed in is invalid |
|
540 @publishedAll |
|
541 @released |
|
542 @capability None |
|
543 */ |
|
544 EXPORT_C void CCalEntry::SetStatusL(TStatus aStatus) |
|
545 { |
|
546 iImpl->SetStatusL(aStatus); |
|
547 } |
|
548 |
|
549 |
|
550 /** Sets the entry replication status. |
|
551 @param aReplicationStatus the replication status. |
|
552 |
|
553 @publishedAll |
|
554 @released |
|
555 @capability None |
|
556 */ |
|
557 EXPORT_C void CCalEntry::SetReplicationStatusL(TReplicationStatus aReplicationStatus) |
|
558 { |
|
559 iImpl->SetReplicationStatusL(aReplicationStatus); |
|
560 } |
|
561 |
|
562 /** Gets the entry replication status. |
|
563 |
|
564 This is defined by TReplicationStatus. Default is TReplicationStatus::EOpen |
|
565 |
|
566 @return The replication status. |
|
567 |
|
568 @publishedAll |
|
569 @released |
|
570 @capability None |
|
571 */ |
|
572 EXPORT_C CCalEntry::TReplicationStatus CCalEntry::ReplicationStatusL() const |
|
573 { |
|
574 return iImpl->ReplicationStatusL(); |
|
575 } |
|
576 |
|
577 /** Gets the entry status. |
|
578 |
|
579 For a to-do entry, this is one of: ECancelled, ETodoNeedsAction, |
|
580 ETodoCompleted, ETodoInProgress. |
|
581 |
|
582 For any other entry types, this is one of: ECancelled, ETentative, |
|
583 EConfirmed. |
|
584 |
|
585 @return The status. |
|
586 @panic CalInterimAPI 4 The status of the entry is invalid |
|
587 @publishedAll |
|
588 @released |
|
589 @capability None |
|
590 */ |
|
591 EXPORT_C CCalEntry::TStatus CCalEntry::StatusL() const |
|
592 { |
|
593 return iImpl->StatusL(); |
|
594 } |
|
595 |
|
596 |
|
597 /** Sets the entry's method property for group scheduling. |
|
598 |
|
599 @param aMethod The method, this is one of: EMethodNone, EMethodPublish, |
|
600 EMethodRequest, EMethodReply, EMethodAdd, EMethodCancel, EMethodRefresh, |
|
601 EMethodCounter, EMethodDeclineCounter. |
|
602 |
|
603 @publishedAll |
|
604 @released |
|
605 @capability None |
|
606 */ |
|
607 EXPORT_C void CCalEntry::SetMethodL(TMethod aMethod) |
|
608 { |
|
609 if(aMethod<EMethodNone || aMethod>EMethodDeclineCounter) |
|
610 { |
|
611 User::Leave(KErrArgument); |
|
612 } |
|
613 iImpl->SetMethodL(aMethod); |
|
614 } |
|
615 |
|
616 /** Sets the entry's sequence number for group scheduling. |
|
617 |
|
618 @param aSeqNum The sequence number. |
|
619 |
|
620 @publishedAll |
|
621 @released |
|
622 @capability None |
|
623 */ |
|
624 EXPORT_C void CCalEntry::SetSequenceNumberL(TInt aSeqNum) |
|
625 { |
|
626 iImpl->SetSequenceNumberL(aSeqNum); |
|
627 } |
|
628 |
|
629 /** Sets the entry's last modified date to the current time. |
|
630 |
|
631 @publishedAll |
|
632 @released |
|
633 @capability None |
|
634 */ |
|
635 EXPORT_C void CCalEntry::SetLastModifiedDateL() |
|
636 { |
|
637 iImpl->SetLastModifiedDateL(); |
|
638 } |
|
639 |
|
640 /** Sets the entry's last modified date to the time provided. |
|
641 |
|
642 @publishedAll |
|
643 @released |
|
644 @param aModifiedTime The time used to set the last modified date. |
|
645 @capability None |
|
646 */ |
|
647 EXPORT_C void CCalEntry::SetLastModifiedDateL(const TCalTime& aModifiedTime) |
|
648 { |
|
649 iImpl->SetLastModifiedDateL(aModifiedTime); |
|
650 } |
|
651 |
|
652 /** Sets the entry's DTSTAMP to the time specified. |
|
653 |
|
654 This method may be called by clients to record the date/time that the entry |
|
655 was prepared for sending to a recipient as a scheduling object, as specified |
|
656 in RFC 2445, the Internet Calendaring and Scheduling Core Object Specification |
|
657 iCalendar). |
|
658 This value will be Time::NullTTime by default unless the client sets it otherwise. |
|
659 |
|
660 @param aDTStampTime The time that the DTSTAMP will be set to |
|
661 @publishedAll |
|
662 @released |
|
663 @capability None |
|
664 */ |
|
665 EXPORT_C void CCalEntry::SetDTStampL(const TCalTime& aDTStampTime) |
|
666 { |
|
667 iImpl->SetDTStampL(aDTStampTime); |
|
668 } |
|
669 |
|
670 /** Returns the entry's method property for group scheduling. |
|
671 |
|
672 @return The method, this is one of: EMethodNone, EMethodPublish, |
|
673 EMethodRequest, EMethodReply, EMethodAdd, EMethodCancel, EMethodRefresh, |
|
674 EMethodCounter, EMethodDeclineCounter. |
|
675 |
|
676 @publishedAll |
|
677 @released |
|
678 @capability None |
|
679 */ |
|
680 EXPORT_C CCalEntry::TMethod CCalEntry::MethodL() const |
|
681 { |
|
682 return iImpl->MethodL(); |
|
683 } |
|
684 |
|
685 /** Returns the entry's recurrence ID for group scheduling. |
|
686 |
|
687 @return The recurrence ID. |
|
688 |
|
689 @publishedAll |
|
690 @released |
|
691 @capability None |
|
692 */ |
|
693 EXPORT_C TCalTime CCalEntry::RecurrenceIdL() const |
|
694 { |
|
695 return iImpl->RecurrenceIdL(); |
|
696 } |
|
697 |
|
698 /** Returns the recurrence range for the entry's recurrence ID. |
|
699 |
|
700 @return The recurrence range. |
|
701 |
|
702 @publishedAll |
|
703 @released |
|
704 @capability None |
|
705 */ |
|
706 EXPORT_C CalCommon::TRecurrenceRange CCalEntry::RecurrenceRangeL() const |
|
707 { |
|
708 return iImpl->RecurrenceRangeL(); |
|
709 } |
|
710 |
|
711 /** Returns the entry's sequence number for group scheduling. |
|
712 |
|
713 @return The sequence number. |
|
714 |
|
715 @publishedAll |
|
716 @released |
|
717 @capability None |
|
718 */ |
|
719 EXPORT_C TInt CCalEntry::SequenceNumberL() const |
|
720 { |
|
721 return iImpl->SequenceNumberL(); |
|
722 } |
|
723 |
|
724 /** Returns the entry's Global UID for group scheduling. |
|
725 |
|
726 @return The Global UID. |
|
727 |
|
728 @publishedAll |
|
729 @released |
|
730 @capability None |
|
731 */ |
|
732 EXPORT_C const TDesC8& CCalEntry::UidL() const |
|
733 { |
|
734 return iImpl->UidL(); |
|
735 } |
|
736 |
|
737 /** Gets the timezone rules for this entry's repeat rule. |
|
738 |
|
739 @return A copy of the entry's timezone rules. |
|
740 |
|
741 @publishedAll |
|
742 @released |
|
743 @capability None |
|
744 */ |
|
745 EXPORT_C CTzRules* CCalEntry::TzRulesL() const |
|
746 { |
|
747 return iImpl->GetTzRulesL(); |
|
748 } |
|
749 |
|
750 /** Sets the timezone rules for this entry's repeat rule. |
|
751 |
|
752 @param aTzRules The entry's timezone rules. This function does not take ownership. |
|
753 @leave KErrNotFound If there is not a repeat definition in the entry |
|
754 @leave KErrArgument If the entry uses floating time mode |
|
755 @publishedAll |
|
756 @released |
|
757 @capability None |
|
758 */ |
|
759 EXPORT_C void CCalEntry::SetTzRulesL(const CTzRules& aTzRules) |
|
760 { |
|
761 iImpl->SetTzRulesL(aTzRules); |
|
762 } |
|
763 |
|
764 /** Creates the timezone rules for this entry's repeat rule from the local time zone settings. |
|
765 @leave KErrNotFound If there is not a repeat definition in the entry |
|
766 @leave KErrArgument If the entry uses floating time mode |
|
767 @publishedAll |
|
768 @released |
|
769 @capability None |
|
770 */ |
|
771 EXPORT_C void CCalEntry::SetTzRulesL() |
|
772 { |
|
773 iImpl->SetTzRulesL(); |
|
774 } |
|
775 |
|
776 /** Replaces this group scheduling entry's list of RDATEs. |
|
777 |
|
778 @param aRDates List of RDATEs to replace current RDATEs. |
|
779 |
|
780 @publishedAll |
|
781 @released |
|
782 @capability None |
|
783 @leave KErrArgument If the time mode of the RDATEs don't match the time mode of the entry |
|
784 */ |
|
785 EXPORT_C void CCalEntry::SetRDatesL(const RArray<TCalTime>& aRDates) |
|
786 { |
|
787 iImpl->SetRDatesL(aRDates); |
|
788 } |
|
789 |
|
790 /** Gets a list of all RDATEs in this group scheduling entry. |
|
791 |
|
792 @param aRDates On return, an array of RDATEs for this entry. |
|
793 |
|
794 @publishedAll |
|
795 @released |
|
796 @capability None |
|
797 */ |
|
798 EXPORT_C void CCalEntry::GetRDatesL(RArray<TCalTime>& aRDates) const |
|
799 { |
|
800 iImpl->GetRDatesL(aRDates); |
|
801 } |
|
802 |
|
803 /** Adds the given exception dates to this group scheduling entry. |
|
804 |
|
805 @param aExDates The exception dates to be added. |
|
806 |
|
807 @publishedAll |
|
808 @released |
|
809 @capability None |
|
810 @leave KErrArgument If the time mode of the exception dates don't match the time mode of the entry |
|
811 */ |
|
812 EXPORT_C void CCalEntry::SetExceptionDatesL(const RArray<TCalTime>& aExDates) |
|
813 { |
|
814 iImpl->SetExceptionDatesL(aExDates); |
|
815 } |
|
816 |
|
817 /** Gets a list of all exception dates on this group scheduling entry. |
|
818 |
|
819 @param aExDateList On return, an array of exception dates for this entry. |
|
820 |
|
821 @publishedAll |
|
822 @released |
|
823 @capability None |
|
824 */ |
|
825 EXPORT_C void CCalEntry::GetExceptionDatesL(RArray<TCalTime>& aExDateList) const |
|
826 { |
|
827 iImpl->GetExceptionDatesL(aExDateList); |
|
828 } |
|
829 |
|
830 /** Gets the attendees for this entry. |
|
831 |
|
832 @return An array of attendees. Note that this array should only be used to fetch attendee details. |
|
833 Any modifications to this array will not be reflected in the entry's actual attendee list. |
|
834 |
|
835 @publishedAll |
|
836 @released |
|
837 @capability None |
|
838 */ |
|
839 EXPORT_C RPointerArray<CCalAttendee>& CCalEntry::AttendeesL() const |
|
840 { |
|
841 return iImpl->AttendeesL(); |
|
842 } |
|
843 |
|
844 /** Adds an attendee for this entry. |
|
845 |
|
846 @param aAttendee The attendee to be added. This takes ownership of the CCalAttendee immediately so it should |
|
847 not be pushed onto the cleanup stack before calling this function. |
|
848 @leave KErrArgument If the pointer is NULL. |
|
849 @publishedAll |
|
850 @released |
|
851 @capability None |
|
852 */ |
|
853 EXPORT_C void CCalEntry::AddAttendeeL(CCalAttendee* aAttendee) |
|
854 { |
|
855 iImpl->AddAttendeeL(aAttendee); |
|
856 } |
|
857 |
|
858 /** Deletes an attendee from this entry. |
|
859 |
|
860 @param aIndex The index of the attendee (found in FetchAttendeesL) to be removed. |
|
861 @leave KErrArgument If the Index passed in is out of bounds |
|
862 @publishedAll |
|
863 @released |
|
864 @capability None |
|
865 */ |
|
866 EXPORT_C void CCalEntry::DeleteAttendeeL(TInt aIndex) |
|
867 { |
|
868 iImpl->DeleteAttendeeL(aIndex); |
|
869 } |
|
870 |
|
871 /** Sets the organizer for this entry. |
|
872 |
|
873 @param aUser The organizer. This takes ownership of the CCalUser immediately so it should |
|
874 not be pushed onto the cleanup stack before calling this function. |
|
875 @leave KErrArgument If the pointer is NULL. |
|
876 @publishedAll |
|
877 @released |
|
878 @capability None |
|
879 */ |
|
880 EXPORT_C void CCalEntry::SetOrganizerL(CCalUser* aUser) |
|
881 { |
|
882 iImpl->SetOrganizerL(aUser); |
|
883 } |
|
884 |
|
885 /** Sets the phone owner for this entry. |
|
886 |
|
887 @param aOwner The phone owner (entry takes ownership). |
|
888 @leave KErrArgument If the pointer is NULL. |
|
889 @publishedAll |
|
890 @released |
|
891 @capability None |
|
892 */ |
|
893 EXPORT_C void CCalEntry::SetPhoneOwnerL(const CCalUser* aOwner) |
|
894 { |
|
895 iImpl->SetPhoneOwnerL(aOwner); |
|
896 } |
|
897 |
|
898 /** Gets the organizer for this entry. |
|
899 This function creates a new CCalUser object containing the organizer data. |
|
900 |
|
901 @return The organizer if present, NULL if not (Caller takes ownership). |
|
902 |
|
903 @publishedAll |
|
904 @released |
|
905 @capability None |
|
906 */ |
|
907 EXPORT_C CCalUser* CCalEntry::OrganizerL() const |
|
908 { |
|
909 return iImpl->OrganizerL(); |
|
910 } |
|
911 |
|
912 /** Sets the calendar local id for this entry. |
|
913 This should be only used to set the same unique id on a new entry which is the replacement of |
|
914 an existing one in the Calendar store. |
|
915 @publishedAll |
|
916 @released |
|
917 @param aLocalId The calendar local id for this entry. |
|
918 @capability None |
|
919 */ |
|
920 EXPORT_C void CCalEntry::SetLocalUidL(TCalLocalUid aLocalId) |
|
921 { |
|
922 iImpl->SetLocalUidL(aLocalId); |
|
923 } |
|
924 |
|
925 /** Gets the calendar local id of this entry. |
|
926 Note that this is the unique (for each Calendar file) Id of the entry allocated by |
|
927 the Calendar server internally and will remain unchanged for lifetime of the entry. |
|
928 @return The calendar local id. |
|
929 @publishedAll |
|
930 @released |
|
931 @capability None |
|
932 */ |
|
933 EXPORT_C TCalLocalUid CCalEntry::LocalUidL() const |
|
934 { |
|
935 return iImpl->LocalUidL(); |
|
936 } |
|
937 |
|
938 /** Gets the phone owner for this entry. |
|
939 This function creates a new CCalUser object containing the phone owner data. |
|
940 |
|
941 @return The phone owner if present, NULL if not (Caller takes ownership). |
|
942 |
|
943 @publishedAll |
|
944 @released |
|
945 @capability None |
|
946 */ |
|
947 EXPORT_C CCalUser* CCalEntry::PhoneOwnerL() const |
|
948 { |
|
949 return iImpl->PhoneOwnerL(); |
|
950 } |
|
951 |
|
952 /** Gets the busy status for this entry. |
|
953 The default value for this property is busy. |
|
954 @see ETranspBusy |
|
955 @return The busy status, as defined in CCalEntry::TTransp enumeration. |
|
956 @pre None |
|
957 @post None |
|
958 @publishedPartner |
|
959 @released |
|
960 @capability None |
|
961 */ |
|
962 EXPORT_C CCalEntry::TTransp CCalEntry::TimeTransparencyL() const |
|
963 { |
|
964 return iImpl->BusyStatusL(); |
|
965 } |
|
966 |
|
967 /** Sets the busy status for this entry. |
|
968 @param aBusyStatus The busy status, as defined in CCalEntry::TTransp enumeration. |
|
969 |
|
970 @pre None |
|
971 @post The entry's busy status will be set to the given value. |
|
972 @leave KErrArgument if aBusyStatus is a value less than 0. |
|
973 Otherwise one of the system wide error codes. |
|
974 |
|
975 @publishedPartner |
|
976 @released |
|
977 @capability None |
|
978 */ |
|
979 EXPORT_C void CCalEntry::SetTimeTransparencyL(CCalEntry::TTransp aBusyStatus) |
|
980 { |
|
981 iImpl->SetBusyStatusL(aBusyStatus); |
|
982 } |
|
983 |
|
984 /** Gets the geographic location for this entry, known as the GEO property in vCalendar and iCalendar (RFC 2445). |
|
985 @return A new CCalGeoValue object containing the geographic location. Ownership is returned. |
|
986 |
|
987 @pre None. |
|
988 @post A geographical location object (CCalGeoValue) has been created containing the entry's GEO values if they are present. |
|
989 If they are not present, nothing happens and NULL is returned. |
|
990 @publishedPartner |
|
991 @released |
|
992 @capability None |
|
993 */ |
|
994 EXPORT_C CCalGeoValue* CCalEntry::GeoValueL() const |
|
995 { |
|
996 return iImpl->GeoValueL(); |
|
997 } |
|
998 |
|
999 /** Sets the geographic location for this entry, known as the GEO property in vCalendar and iCalendar (RFC 2445). |
|
1000 @param aGeoValue The geographic location. |
|
1001 Note that if the latitude and longitude are not set, then the GEO property will be reset on this entry. |
|
1002 @pre A geographical location object (CCalGeoValue) has been created. |
|
1003 @post The entry's GEO property is set to the given value. |
|
1004 @publishedPartner |
|
1005 @released |
|
1006 @capability None |
|
1007 */ |
|
1008 EXPORT_C void CCalEntry::SetGeoValueL(const CCalGeoValue& aGeoValue) |
|
1009 { |
|
1010 iImpl->SetGeoValueL(aGeoValue); |
|
1011 } |
|
1012 |
|
1013 /** Clears the geographic location for this entry, known as the GEO property in vCalendar and iCalendar (RFC 2445). |
|
1014 @pre None. |
|
1015 @post The entry's GEO property is cleared. |
|
1016 @publishedPartner |
|
1017 @released |
|
1018 @capability None |
|
1019 */ |
|
1020 EXPORT_C void CCalEntry::ClearGeoValueL() |
|
1021 { |
|
1022 iImpl->ClearGeoValueL(); |
|
1023 } |
|
1024 |
|
1025 /** Adds an attachment to this entry. |
|
1026 If the attachment contains a file handle, that file will be moved to the calendar store when the entry is stored. |
|
1027 @param aAttachment The attachment to add. CCalEntry takes ownership of the attachment. |
|
1028 @pre None |
|
1029 @post The attachment has been added to the entry's list of attachments. |
|
1030 @publishedPartner |
|
1031 @released |
|
1032 @capability None |
|
1033 */ |
|
1034 EXPORT_C void CCalEntry::AddAttachmentL(CCalAttachment& aAttachment) |
|
1035 { |
|
1036 iImpl->AddAttachmentL(&aAttachment); |
|
1037 } |
|
1038 |
|
1039 /** Removes an attachment from an entry. |
|
1040 If the entry does not contain this attachment, nothing happens and the entry's attachment count will stay the same. |
|
1041 @param aAttachment The attachment to remove. |
|
1042 |
|
1043 @pre None |
|
1044 @post The attachment has been removed from the entry's list of attachments if it was present. |
|
1045 @publishedPartner |
|
1046 @released |
|
1047 @capability None |
|
1048 */ |
|
1049 EXPORT_C void CCalEntry::DeleteAttachmentL(const CCalAttachment& aAttachment) |
|
1050 { |
|
1051 iImpl->DeleteAttachmentL(aAttachment); |
|
1052 } |
|
1053 |
|
1054 /** Returns an attachment on the entry. |
|
1055 @param aIndex The index of the attachment to be returned. |
|
1056 @return The attachment. Ownership is not returned. NULL is returned if aIndex is negative |
|
1057 or greater than the number of attachments on this entry. |
|
1058 |
|
1059 @pre None |
|
1060 @post None |
|
1061 @publishedPartner |
|
1062 @released |
|
1063 @capability None |
|
1064 */ |
|
1065 EXPORT_C CCalAttachment* CCalEntry::AttachmentL(TInt aIndex) const |
|
1066 { |
|
1067 return iImpl->AttachmentL(aIndex); |
|
1068 } |
|
1069 |
|
1070 /** Returns the number of attachments on the entry. |
|
1071 @return The number of attachments. |
|
1072 |
|
1073 @pre None |
|
1074 @post None |
|
1075 @publishedPartner |
|
1076 @released |
|
1077 @capability None |
|
1078 */ |
|
1079 EXPORT_C TInt CCalEntry::AttachmentCountL() const |
|
1080 { |
|
1081 return iImpl->AttachmentCountL(); |
|
1082 } |
|
1083 |
|
1084 /** Find the next instance of this entry identified by its local UID after the specified time. |
|
1085 If the entry is not repeating and aTime is before the entry start time, then this function returns |
|
1086 the entry start time. (Or end time for Todos) |
|
1087 If the entry has a repeat rule or sporadic dates, this function returns the next instance. |
|
1088 Instances with exceptions will not be returned. |
|
1089 Instances of other entries with the same GUID will not be returned - this means modifying instance will |
|
1090 not be returned. |
|
1091 If aTime is an instance, then the next instance after that is returned. |
|
1092 If no instance exists after aTime, then TCalTime will contain Time::NullTTime(). |
|
1093 |
|
1094 @return The time of the next instance of this entry. This is Time::NullTTime() if no instance is found. |
|
1095 @pre None |
|
1096 @post None |
|
1097 @publishedPartner |
|
1098 @released |
|
1099 @capability None |
|
1100 */ |
|
1101 EXPORT_C TCalTime CCalEntry::NextInstanceForLocalUIDL(const TCalTime& aTime) const |
|
1102 { |
|
1103 return iImpl->NextInstanceForLocalUIDL(aTime); |
|
1104 } |
|
1105 |
|
1106 /** Find the previous instance of this entry identified by its local UID before the specified time. |
|
1107 If the entry is not repeating and aTime is after the entry start time, then this function returns |
|
1108 the entry start time. (Or end time for Todos) |
|
1109 If the entry has a repeat rule or sporadic dates, this function returns the previous instance. |
|
1110 Instances with exceptions will not be returned. |
|
1111 Instances of other entries with the same GUID will not be returned - this means modifying instance will |
|
1112 not be returned. |
|
1113 If aTime is an instance, then the previous instance is returned. |
|
1114 If no instance exists before aTime, then TCalTime will contain Time::NullTTime(). |
|
1115 |
|
1116 @return The time of the previous instance of this entry. This is Time::NullTTime() if no instance is found. |
|
1117 @pre None |
|
1118 @post None |
|
1119 @publishedPartner |
|
1120 @released |
|
1121 @capability None |
|
1122 */ |
|
1123 EXPORT_C TCalTime CCalEntry::PreviousInstanceForLocalUIDL(const TCalTime& aTime) const |
|
1124 { |
|
1125 return iImpl->PreviousInstanceForLocalUIDL(aTime); |
|
1126 } |
|
1127 |
|
1128 /** Find the until time of an entry repeat rule using the given number of repeat instances. |
|
1129 |
|
1130 @return The until time of this entry calculated from the number of repeat instances expected. This will return Time::NullTTime() if it cannot calculate it. |
|
1131 @pre None |
|
1132 @post None |
|
1133 @internalTechnology |
|
1134 @capability None |
|
1135 */ |
|
1136 EXPORT_C TCalTime CCalEntry::FindRptUntilTimeL(TInt aCount) |
|
1137 { |
|
1138 return iImpl->FindRptUntilTimeL(aCount); |
|
1139 } |
|
1140 |
|
1141 TUint8 CCalEntry::ShortFileIdL() |
|
1142 { |
|
1143 return iImpl->ShortFileIdL(); |
|
1144 } |
|
1145 |
|
1146 // CCalEntryId // |
|
1147 |
|
1148 |
|
1149 /** Allocates and constructs IDs for new entry of the specified type. |
|
1150 |
|
1151 @param aFlatData Pointer to the alarm data |
|
1152 @return Pointer to the new entry ID. |
|
1153 @leave KErrArgument if aFlatData is a NULL pointer. |
|
1154 @capability None |
|
1155 @publishedAll |
|
1156 @released |
|
1157 */ |
|
1158 EXPORT_C CCalEntryId* CCalEntryId::NewL(TDesC8* aFlatData) |
|
1159 { |
|
1160 CCalEntryId* self = new(ELeave) CCalEntryId(); |
|
1161 CleanupStack::PushL(self); |
|
1162 self->iImpl = CCalEntryIdImpl::NewL(aFlatData); |
|
1163 CleanupStack::Pop(); |
|
1164 return self; |
|
1165 } |
|
1166 /** |
|
1167 Constructor |
|
1168 @internalTechnology |
|
1169 */ |
|
1170 CCalEntryId::CCalEntryId() |
|
1171 { |
|
1172 } |
|
1173 /** |
|
1174 Destructor |
|
1175 @internalTechnology |
|
1176 */ |
|
1177 EXPORT_C CCalEntryId::~CCalEntryId() |
|
1178 { |
|
1179 delete iImpl; |
|
1180 } |
|
1181 /** Fetches the entry's ID |
|
1182 |
|
1183 @publishedAll |
|
1184 @released |
|
1185 @capability None |
|
1186 @return Id of the entry |
|
1187 */ |
|
1188 EXPORT_C TPtrC8 CCalEntryId::IdL() |
|
1189 { |
|
1190 return iImpl->IdL(); |
|
1191 } |
|
1192 |
|
1193 /** Stores the name of the file |
|
1194 |
|
1195 @publishedAll |
|
1196 @released |
|
1197 @capability None |
|
1198 @return Pointer to the name of the file |
|
1199 */ |
|
1200 EXPORT_C TPtrC CCalEntryId::StoreFileNameL() |
|
1201 { |
|
1202 return iImpl->StoreFileNameL(); |
|
1203 } |
|
1204 |
|
1205 /** Fetches the recurrence ID of the entry |
|
1206 |
|
1207 @publishedAll |
|
1208 @released |
|
1209 @capability None |
|
1210 @return Pointer to the recurrence ID |
|
1211 */ |
|
1212 EXPORT_C TCalTime CCalEntryId::RecurrenceIdL() |
|
1213 { |
|
1214 return iImpl->RecurrenceIdL(); |
|
1215 } |
|
1216 |
|
1217 /** Fetches the instance time of the entry |
|
1218 |
|
1219 @publishedAll |
|
1220 @released |
|
1221 @capability None |
|
1222 @return Pointer to the instance time of the entry |
|
1223 */ |
|
1224 EXPORT_C TCalTime CCalEntryId::InstanceTimeL() const |
|
1225 { |
|
1226 return iImpl->InstanceTimeL(); |
|
1227 } |
|
1228 |
|
1229 /** Fetches the local ID of the entry |
|
1230 |
|
1231 @publishedAll |
|
1232 @released |
|
1233 @capability None |
|
1234 @return Pointer to the local ID of the entry |
|
1235 */ |
|
1236 EXPORT_C TCalLocalUid CCalEntryId::LocalUidL() const |
|
1237 { |
|
1238 return iImpl->LocalUidL(); |
|
1239 } |
|
1240 |
|
1241 // CCalGeoValue // |
|
1242 |
|
1243 /** Creates a new object to store geographic location. |
|
1244 @return A pointer to the new object. |
|
1245 @pre None |
|
1246 @post A new geographic location object is constructed |
|
1247 @publishedPartner |
|
1248 @released |
|
1249 @capability None |
|
1250 */ |
|
1251 EXPORT_C CCalGeoValue* CCalGeoValue::NewL() |
|
1252 { |
|
1253 CCalGeoValue* self = new (ELeave) CCalGeoValue(); |
|
1254 return self; |
|
1255 } |
|
1256 |
|
1257 /** Constructor. |
|
1258 @pre None. |
|
1259 @post First phase of construction |
|
1260 @publishedPartner |
|
1261 @released |
|
1262 @capability None |
|
1263 */ |
|
1264 CCalGeoValue::CCalGeoValue():iLatitude(KGEODefaultValue),iLongitude(KGEODefaultValue) |
|
1265 { |
|
1266 } |
|
1267 |
|
1268 /** Destructor. |
|
1269 @pre Construction of a geographic location object |
|
1270 @post The object is destroyed |
|
1271 @publishedPartner |
|
1272 @released |
|
1273 @capability None |
|
1274 */ |
|
1275 EXPORT_C CCalGeoValue::~CCalGeoValue() |
|
1276 { |
|
1277 } |
|
1278 |
|
1279 /** Sets the latitude and longitude positions for the geographical location. |
|
1280 @param aLatitude The latitude in degrees. Minutes are represented as a decimal fraction, these will be rounded to 6 |
|
1281 decimal places. Latitude may be from -90 to 90. A positive latitude indicates a position north of the equator. |
|
1282 A negative latitude is south of it. |
|
1283 @param aLongitude The longitude in degrees. Minutes are represented as a decimal fraction, these will be rounded to 6 |
|
1284 decimal places. Longitude may be from -180 to 180. A positive longitude indicates a position east of the prime meridian. |
|
1285 A negative longitude is west of it. |
|
1286 @leave KErrArgument if the latitude or longitude are out of range |
|
1287 @pre None |
|
1288 @post The latitude and longitude of this object have been updated. |
|
1289 @publishedPartner |
|
1290 @released |
|
1291 @capability None |
|
1292 */ |
|
1293 EXPORT_C void CCalGeoValue::SetLatLongL(const TReal& aLatitude, const TReal& aLongitude) |
|
1294 { |
|
1295 // Bounds checking |
|
1296 __ASSERT_ALWAYS( |
|
1297 ((aLatitude >= KCalGEOMinLatitude && aLatitude <= KCalGEOMaxLatitude) || aLatitude == KGEODefaultValue) |
|
1298 && ((aLongitude >= KCalGEOMinLongitude && aLongitude <= KCalGEOMaxLongitude) || aLongitude == KGEODefaultValue), |
|
1299 User::Leave(KErrArgument)); |
|
1300 |
|
1301 // Truncate to KGEOMaxDecimalPoint decimal places |
|
1302 TReal truncatedLatitude; |
|
1303 TReal truncatedLongitude; |
|
1304 Math::Round(truncatedLatitude,aLatitude,KCalGEOMaxDecimalPlaces); |
|
1305 Math::Round(truncatedLongitude,aLongitude,KCalGEOMaxDecimalPlaces); |
|
1306 |
|
1307 iLatitude = truncatedLatitude; |
|
1308 iLongitude = truncatedLongitude; |
|
1309 } |
|
1310 |
|
1311 /** Gets the latitude and longitude positions for the geographical location. |
|
1312 @param aLatitude On return, this contains the value of the latitude in degrees. Minutes are represented as a decimal fraction. |
|
1313 Latitude may be from -90 to 90. A positive latitude indicates a position north of the equator. |
|
1314 @param aLongitude On return, this contains the value of the longitude in degrees. Minutes are represented as a decimal fraction. |
|
1315 Longitude may be from -180 to 180. A positive longitude indicates a position east of the prime meridian. |
|
1316 @return EFalse if the latitude and longitude have not been set on this object. ETrue if they have been set and are both valid. |
|
1317 @pre None |
|
1318 @post None |
|
1319 @publishedPartner |
|
1320 @released |
|
1321 @capability None |
|
1322 */ |
|
1323 EXPORT_C TBool CCalGeoValue::GetLatLong(TReal& aLatitude, TReal& aLongitude) const |
|
1324 { |
|
1325 if(iLongitude != KGEODefaultValue && iLongitude != KGEODefaultValue) |
|
1326 { |
|
1327 aLatitude = iLatitude; |
|
1328 aLongitude = iLongitude; |
|
1329 return ETrue; |
|
1330 } |
|
1331 return EFalse; |
|
1332 } |