|
1 #ifndef AGNVERSIT2EXPORTER_H |
|
2 #define AGNVERSIT2EXPORTER_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: Implements the export functionality of CAgnVersit2 |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // Agenda includes. |
|
22 #include <calentry.h> // for CCalEntry::TReplicationStatus |
|
23 #include <caluser.h> // for CCalAttendee::TCalRole |
|
24 |
|
25 // Forward class declarations. |
|
26 class CAgnVersit2StringProvider; |
|
27 class CICal; |
|
28 class CICalComponent; |
|
29 class CICalProperty; |
|
30 class CTzRules; |
|
31 class MAgnExportObserver; |
|
32 class RWriteStream; |
|
33 |
|
34 |
|
35 /** |
|
36 Implementation class for CAgnVersit2::ExportL. |
|
37 @internalTechnology |
|
38 */ |
|
39 class CAgnVersit2Exporter : public CBase |
|
40 { |
|
41 public: // Construction/destruction. |
|
42 static CAgnVersit2Exporter* NewL(CAgnVersit2StringProvider& aStringProvider); |
|
43 static CAgnVersit2Exporter* NewLC(CAgnVersit2StringProvider& aStringProvider); |
|
44 |
|
45 ~CAgnVersit2Exporter(); |
|
46 |
|
47 public: // Methods. |
|
48 void ExportL(const CCalEntry& aEntry,RWriteStream& aWriteStream, TUint aExportFlags,MAgnExportObserver& aObserver); |
|
49 void ExportL(RPointerArray<CCalEntry>& aEntries,RWriteStream& aWriteStream, TUint aExportFlags,MAgnExportObserver& aObserver); |
|
50 |
|
51 |
|
52 private: // Construction. |
|
53 CAgnVersit2Exporter(CAgnVersit2StringProvider& aStringProvider); |
|
54 |
|
55 void ConstructL(); |
|
56 |
|
57 private: // Methods. |
|
58 CICal* AddICalLC(const CCalEntry& aEntry) const; |
|
59 |
|
60 // Add Component methods. |
|
61 void AddAnnivL(CICalComponent& aAnniv, const CCalEntry& aEntry) const; |
|
62 void AddAlarmL(CICalComponent& aComponent, const CCalEntry& aEntry) const; |
|
63 void AddApptL(CICalComponent& aAppt, const CCalEntry& aEntry) const; |
|
64 void AddComponentL(CICal& aICal, const CCalEntry& aEntry) const; |
|
65 void AddEventL(CICalComponent& aEvent, const CCalEntry& aEntry) const; |
|
66 void AddReminderL(CICalComponent& aReminder, const CCalEntry& aEntry) const; |
|
67 void AddTimezoneL(CICal& aICal, const CCalEntry& aEntry); |
|
68 void AddTodoL(CICalComponent& aTodo, const CCalEntry& aEntry) const; |
|
69 |
|
70 // Add Property methods. |
|
71 void AddAttendeePropertiesL(CICalComponent& aComponent, const CCalEntry& aEntry) const; |
|
72 void AddCategoriesPropertyL(CICalComponent& aComponent, const CCalEntry& aEntry)const ; |
|
73 void AddClassPropertyL(CICalComponent& aComponent, const CCalEntry& aEntry) const; |
|
74 void AddExceptionDatePropertyL(CICalComponent& aComponent, const CCalEntry& aEntry) const; |
|
75 void AddIntegerPropertyL(CICalComponent& aComponent, TInt aInt, const TDesC& aProperty) const; |
|
76 void AddOrganizerPropertyL(CICalComponent& aComponent, const CCalEntry& aEntry) const; |
|
77 void AddTextPropertyL(CICalComponent& aComponent, const TDesC& aText, const TDesC& aProperty) const; |
|
78 void AddRDatePropertyL(CICalComponent& aComponent, const CCalEntry& aEntry) const; |
|
79 void AddRRulePropertyL(CICalComponent& aComponent, const CCalEntry& aEntry)const; |
|
80 CICalProperty& AddDateTimePropertyL(CICalComponent& aComponent, const TCalTime& aTime, const TDesC& aProperty) const; |
|
81 CICalProperty& AddFloatingDateTimePropertyL(CICalComponent& aComponent, const TTime& aFloatingTime, const TDesC& aProperty) const; |
|
82 CICalProperty& AddUtcDateTimePropertyL(CICalComponent& aComponent, const TTime& aUtcTime, const TDesC& aProperty) const; |
|
83 |
|
84 // Helper methods. |
|
85 static const TDesC& ClassStringL(const CCalEntry::TReplicationStatus aStatus); |
|
86 const TDesC& CategoryStringL(const CCalCategory& aCategory) const; |
|
87 static const TDesC& RoleFromEnum(CCalAttendee::TCalRole aRole); |
|
88 static const TDesC& StatusFromEnum(CCalAttendee::TCalStatus aStatus); |
|
89 static const TDesC& DayFromInt(TUint8 aDayInt); |
|
90 static const TDesC& DayFromTDay(TDay aDay); |
|
91 static TInt WeekNumFromDayOfMonth(TInt aDayOfMonth); |
|
92 |
|
93 private: // Members. |
|
94 MAgnExportObserver* iObserver; |
|
95 CAgnVersit2StringProvider& iStringProvider; |
|
96 RPointerArray<HBufC> iTzNameArray; |
|
97 RPointerArray<CTzRules> iTimeZoneArray; |
|
98 TUint iExportProperties; |
|
99 TInt iTimezoneIndex; |
|
100 }; |
|
101 |
|
102 #endif // AGNVERSIT2EXPORTER_H |
|
103 |
|
104 // End of file. |