|
1 #ifndef ICALVALUE_H |
|
2 #define ICALVALUE_H/* |
|
3 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: Holds the definition of CICalValue. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // System includes. |
|
22 #include <e32base.h> // CBase |
|
23 |
|
24 // Forward declarations. |
|
25 class CICalRuleSegment; |
|
26 |
|
27 /** |
|
28 Class representing a property-, property parameter- or rule segement value. |
|
29 @publishedPartner |
|
30 */ |
|
31 class CICalValue : public CBase |
|
32 { |
|
33 public: // Enumerations. |
|
34 enum TTimeZoneType |
|
35 { |
|
36 /** Local "floating" time.*/ |
|
37 EFloatingTime, |
|
38 /** UTC time.*/ |
|
39 EUtcTime, |
|
40 /** User specified time zone.*/ |
|
41 ESpecifiedTimeZone |
|
42 }; |
|
43 |
|
44 public: // Construction/destruction. |
|
45 IMPORT_C static CICalValue* NewL(); |
|
46 IMPORT_C static CICalValue* NewLC(); |
|
47 ~CICalValue(); |
|
48 |
|
49 public: // Methods. |
|
50 IMPORT_C HBufC8* BinaryLC() const; |
|
51 IMPORT_C void SetBinaryL(const TDesC8& aBuffer); |
|
52 IMPORT_C TBool BooleanL() const; |
|
53 IMPORT_C void SetBooleanL(TBool aBool); |
|
54 IMPORT_C void GetDateL(TTime& aDate) const; |
|
55 IMPORT_C void SetDateL(const TTime& aDate); |
|
56 IMPORT_C void GetTimeL(TTime& aTime, TTimeZoneType& aTzType) const; |
|
57 IMPORT_C void SetTimeL(const TTime& aTime, TTimeZoneType aTzType); |
|
58 IMPORT_C void GetDateTimeL(TTime& aDateTime, TTimeZoneType& aTzType, TInt aFirstCharacterNum = 0) const; |
|
59 IMPORT_C void SetDateTimeL(const TTime& aDateTime, TTimeZoneType aTzType); |
|
60 IMPORT_C TTimeIntervalSeconds DurationL() const; |
|
61 IMPORT_C void SetDurationL(TTimeIntervalSeconds aDuration); |
|
62 IMPORT_C void GetFloatL(TReal& aFloat) const; |
|
63 IMPORT_C void SetFloatL(const TReal& aFloat); |
|
64 IMPORT_C TInt IntegerL() const; |
|
65 IMPORT_C void SetIntegerL(TInt aInt); |
|
66 |
|
67 IMPORT_C void GetPeriodL( |
|
68 TTime& aStartTime, |
|
69 TTimeZoneType& aStartTzType, |
|
70 TTime& aEndTime, |
|
71 TTimeZoneType& aEndTzType) const; |
|
72 |
|
73 IMPORT_C void SetPeriodL( |
|
74 const TTime& aStartTime, |
|
75 TTimeZoneType aStartTzType, |
|
76 const TTime& aEndTime, |
|
77 TTimeZoneType aEndTzType); |
|
78 |
|
79 IMPORT_C void GetDayL(TDay& aDay, TInt& aPos) const; |
|
80 IMPORT_C void SetDayL(TDay aDay, TInt aPos = 0); |
|
81 IMPORT_C TMonth MonthL() const; |
|
82 IMPORT_C void SetMonthL(TMonth aMonth); |
|
83 IMPORT_C void GetRecurrenceRuleL(RPointerArray<CICalRuleSegment>& aRuleSegmentArray) const; |
|
84 IMPORT_C void SetRecurrenceRuleL(const TDesC& aRuleValue); |
|
85 IMPORT_C const TDesC& TextL() const; |
|
86 IMPORT_C void SetTextL(const TDesC& aText); |
|
87 IMPORT_C TTimeIntervalSeconds UtcOffsetL() const; |
|
88 IMPORT_C void SetUtcOffsetL(TTimeIntervalSeconds aOffset); |
|
89 |
|
90 private: // Construction. |
|
91 CICalValue(); |
|
92 void ConstructL(); |
|
93 |
|
94 private: // Methods. |
|
95 void CheckNullValueL() const; |
|
96 void PrepareValuePointer(); |
|
97 TInt ReadIntL(const TDesC& aDes) const; |
|
98 void AppendDateToValueL(const TTime& aDate); |
|
99 void GetDateFromValueL(TTime& aDate, TInt aFirstCharacterNum = 0) const; |
|
100 void AppendTimeToValueL(const TTime& aTime); |
|
101 void GetTimeFromValueL(TTime& aTime, TTimeZoneType& aTzType, TInt aFirstCharacterNum = 0) const; |
|
102 void GetTimeIntervalFromValueL(TTimeIntervalSeconds& aTime, TInt aFirstCharacterNum = 0) const; |
|
103 TBool GetDurDateL(TInt& aIntervalSecs, TInt& aCurrentCharNumber) const; |
|
104 TBool GetDurTimeL(TInt& aIntervalSecs, TInt& aCurrentCharNumber) const; |
|
105 TBool GetDurHourL(TInt& aIntervalSecs, TInt& aCurrentCharNumber) const; |
|
106 TBool GetDurMinuteL(TInt& aIntervalSecs, TInt& aCurrentCharNumber) const; |
|
107 TBool GetDurSecondL(TInt& aIntervalSecs, TInt& aCurrentCharNumber) const; |
|
108 TBool GetDurWeekL(TInt& aIntervalSecs, TInt& aCurrentCharNumber) const; |
|
109 |
|
110 private: // Attributes. |
|
111 HBufC* iValue; |
|
112 }; |
|
113 |
|
114 #endif // ICALVALUE_H |
|
115 |
|
116 // End of File |