|
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 #ifndef __CALINSTANCEVIEW_H__ |
|
17 #define __CALINSTANCEVIEW_H__ |
|
18 |
|
19 #include <calentry.h> |
|
20 #include <calentryview.h> |
|
21 #include <calinstance.h> |
|
22 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
23 #include <calinstanceiterator.h> //this is publishedPartner so should not be included here in the SF version. |
|
24 #endif |
|
25 |
|
26 class CCalFindInstanceSettings; |
|
27 class CCalInstance; |
|
28 class CCalInstanceIterator; |
|
29 class CCalInstanceViewImpl; |
|
30 class CCalSession; |
|
31 class MCalProgressCallBack; |
|
32 class TCalTime; |
|
33 class CCalLiteEntry; |
|
34 class TAgnInstanceId; |
|
35 #ifdef SYMBIAN_SKIPPED_CALENDAR_ALARMS |
|
36 struct TASShdAlarmedInstanceParams; |
|
37 #endif |
|
38 |
|
39 #ifdef SYMBIAN_CALENDAR_ENHANCEDSEARCHANDSORT |
|
40 class CCalSortCriteria; |
|
41 class CCalSortCriterion; |
|
42 class RWriteStream; |
|
43 class CAgnSortCriteria; |
|
44 class TAgnSortCriterion; |
|
45 #endif |
|
46 |
|
47 /** View class for accessing instances of calendar entries. |
|
48 |
|
49 Once a session to a calendar file has been created, a view to the session |
|
50 can be created. |
|
51 |
|
52 An instance is a calendar entry, a repeated instance of a calendar entry, |
|
53 or an RDate added to an entry. |
|
54 |
|
55 This view can be used to search for instances and also to delete instances. |
|
56 |
|
57 @publishedAll |
|
58 @released |
|
59 */ |
|
60 NONSHARABLE_CLASS(CCalInstanceView) : public CBase |
|
61 { |
|
62 public: |
|
63 |
|
64 /** Parameter struct for storing search data. |
|
65 This contains a descriptor to store search text and an enum to describe the text search behaviour. |
|
66 |
|
67 @publishedAll |
|
68 @released |
|
69 */ |
|
70 class TCalSearchParams |
|
71 { |
|
72 public: |
|
73 IMPORT_C TCalSearchParams(const TDesC& aText, CalCommon::TCalSearchBehaviour aBehaviour); |
|
74 IMPORT_C const TDesC& Text() const; |
|
75 IMPORT_C CalCommon::TCalSearchBehaviour Behaviour() const; |
|
76 |
|
77 private: |
|
78 TPtrC iSearchText; |
|
79 CalCommon::TCalSearchBehaviour iSearchBehaviour; |
|
80 }; |
|
81 |
|
82 IMPORT_C static CCalInstanceView* NewL(CCalSession& aSession, MCalProgressCallBack& aProgressCallBack); |
|
83 IMPORT_C static CCalInstanceView* NewL(CCalSession& aSession); |
|
84 IMPORT_C static CCalInstanceView* NewL(RPointerArray<CCalSession>& aSessions); |
|
85 IMPORT_C static CCalInstanceView* NewL(RPointerArray<CCalSession>& aSessions, MCalProgressCallBack& aProgressCallBack); |
|
86 IMPORT_C ~CCalInstanceView(); |
|
87 |
|
88 IMPORT_C void FindInstanceL(RPointerArray<CCalInstance>& aInstanceList, |
|
89 CalCommon::TCalViewFilter aCalViewFilter, |
|
90 const CalCommon::TCalTimeRange& aTimeRange) const; |
|
91 |
|
92 IMPORT_C void FindInstanceL(RPointerArray<CCalInstance>& aMatchedInstanceList, |
|
93 CalCommon::TCalViewFilter aCalViewFilter, |
|
94 const CalCommon::TCalTimeRange& aTimeRange, |
|
95 const TCalSearchParams& aSearchParams) const; |
|
96 |
|
97 IMPORT_C CCalInstanceIterator* FindInstanceL(const CCalFindInstanceSettings& aSettings) const; |
|
98 |
|
99 IMPORT_C CCalInstanceIterator* FindInstanceL(const CCalFindInstanceSettings& aSettings, TCalLocalUid aLocalId, const TCalTime& aInstanceTime) const; |
|
100 IMPORT_C CCalInstanceIterator* FindInstanceByUidL(const TDesC8& aUid, const TCalTime& aInstanceTime) const; |
|
101 |
|
102 IMPORT_C CCalInstanceIterator* FindInstanceL(const CCalFindInstanceSettings& aSettings, TCalInstanceId& aInstanceId) const; |
|
103 IMPORT_C CCalInstanceIterator* FindInstanceByUidL(TCalCollectionId aCollectionId, const TDesC8& aUid, const TCalTime& aInstanceTime) const; |
|
104 |
|
105 IMPORT_C CCalInstance* FindInstanceL(TCalLocalUid aLocalId, const TCalTime& aInstanceTime) const; |
|
106 IMPORT_C CCalInstance* FindInstanceL(TCalInstanceId& aInstanceId) const; |
|
107 |
|
108 #ifdef SYMBIAN_SKIPPED_CALENDAR_ALARMS |
|
109 IMPORT_C void FindAlarmedInstanceL(RPointerArray<CCalInstance>& aAlarmedInstanceList, |
|
110 TASShdAlarmedInstanceParams aAlarmedInstanceParams) const; |
|
111 #endif |
|
112 |
|
113 IMPORT_C void DeleteL(CCalInstance* aInstance, CalCommon::TRecurrenceRange aWhichInstances); |
|
114 |
|
115 IMPORT_C TCalTime NextInstanceL(CalCommon::TCalViewFilter aCalViewFilter, const TCalTime& aStartDate) const; |
|
116 IMPORT_C TCalTime PreviousInstanceL(CalCommon::TCalViewFilter aCalViewFilter, const TCalTime& aStartDate) const; |
|
117 |
|
118 private: |
|
119 CCalInstanceView(); |
|
120 void ConstructL(CCalSession& aSession, MCalProgressCallBack* aProgressCallBack); |
|
121 void ConstructL(RPointerArray<CCalSession>& aSessions, MCalProgressCallBack* aProgressCallBack); |
|
122 |
|
123 private: |
|
124 CCalInstanceViewImpl* iImpl; |
|
125 }; |
|
126 |
|
127 |
|
128 /** Class for specifying the search criteria for use in CCalInstanceView::FindInstanceL. |
|
129 |
|
130 @publishedAll |
|
131 @released |
|
132 */ |
|
133 NONSHARABLE_CLASS(CCalFindInstanceSettings) : public CBase |
|
134 { |
|
135 public: |
|
136 IMPORT_C static CCalFindInstanceSettings* NewL(CalCommon::TCalViewFilter aFilter, const CalCommon::TCalTimeRange& aTimeRange); |
|
137 IMPORT_C ~CCalFindInstanceSettings(); |
|
138 |
|
139 IMPORT_C void SetFilter(CalCommon::TCalViewFilter aFilter); |
|
140 IMPORT_C void SetTimeRange(const CalCommon::TCalTimeRange& aTimeRange); |
|
141 IMPORT_C void SetTextSearchL(const CCalInstanceView::TCalSearchParams& aSearchParams); |
|
142 |
|
143 CalCommon::TCalSearchBehaviour Behaviour() const; |
|
144 CalCommon::TCalViewFilter Filter() const; |
|
145 const CalCommon::TCalTimeRange& TimeRange() const; |
|
146 const TDesC& Text() const; |
|
147 |
|
148 #ifdef SYMBIAN_CALENDAR_ENHANCEDSEARCHANDSORT |
|
149 IMPORT_C void SetPriorityRange(const CalCommon::TCalPriorityRange& aPriorityRange); |
|
150 |
|
151 IMPORT_C CCalSortCriteria& SortCriteria(); |
|
152 IMPORT_C const CCalSortCriteria& SortCriteria() const; |
|
153 #endif |
|
154 |
|
155 const CalCommon::TCalPriorityRange& PriorityRange() const; |
|
156 |
|
157 private: |
|
158 CCalFindInstanceSettings(CalCommon::TCalViewFilter aFilter, const CalCommon::TCalTimeRange& aTimeRange); |
|
159 void ConstructL(); |
|
160 |
|
161 private: |
|
162 CalCommon::TCalTimeRange iTimeRange; |
|
163 CalCommon::TCalViewFilter iFilter; |
|
164 HBufC* iSearchText; |
|
165 CalCommon::TCalSearchBehaviour iSearchBehaviour; |
|
166 CalCommon::TCalPriorityRange iPriorityRange; |
|
167 #ifdef SYMBIAN_CALENDAR_ENHANCEDSEARCHANDSORT |
|
168 CCalSortCriteria* iSortCriteria; |
|
169 #endif |
|
170 }; |
|
171 |
|
172 #ifdef SYMBIAN_CALENDAR_ENHANCEDSEARCHANDSORT |
|
173 /** Class for specifying the sort criteria for use in CCalInstanceView::FindInstanceL. |
|
174 |
|
175 @publishedAll |
|
176 @prototype |
|
177 */ |
|
178 NONSHARABLE_CLASS(CCalSortCriteria) : public CBase |
|
179 { |
|
180 public: |
|
181 IMPORT_C static CCalSortCriteria* NewL(); |
|
182 IMPORT_C ~CCalSortCriteria(); |
|
183 |
|
184 IMPORT_C void AppendCriterionL(CalCommon::TCalSortAttribute aAttr, CalCommon::TCalSortDirection aDir); |
|
185 IMPORT_C TInt Count() const; |
|
186 IMPORT_C const CCalSortCriterion& AtL(TInt aIndex) const; |
|
187 IMPORT_C void SetEntryTypeOrderL(const RArray<CCalEntry::TType>& aTypeOrder); |
|
188 IMPORT_C const RArray<CCalEntry::TType>& EntryTypeOrder() const; |
|
189 |
|
190 const CAgnSortCriteria& SortCriteria() const; |
|
191 |
|
192 private: |
|
193 CCalSortCriteria(); |
|
194 void ConstructL(); |
|
195 |
|
196 private: |
|
197 CAgnSortCriteria* iSortCriteria; |
|
198 RPointerArray<CCalSortCriterion> iSortCriterionList; |
|
199 }; |
|
200 |
|
201 NONSHARABLE_CLASS(CCalSortCriterion) : public CBase |
|
202 { |
|
203 public: |
|
204 static CCalSortCriterion* NewL(const TAgnSortCriterion& aSortCriterion); |
|
205 ~CCalSortCriterion(); |
|
206 |
|
207 IMPORT_C CalCommon::TCalSortAttribute SortAttribute() const; |
|
208 IMPORT_C CalCommon::TCalSortDirection SortDirection() const; |
|
209 |
|
210 private: |
|
211 CCalSortCriterion(const TAgnSortCriterion& aSortCriterion); |
|
212 |
|
213 private: |
|
214 const TAgnSortCriterion& iSortCriterion; |
|
215 }; |
|
216 #endif |
|
217 |
|
218 #endif // __CALINSTANCEVIEW_H__ |