author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 27 Aug 2009 07:43:07 +0300 | |
changeset 22 | fc9cf246af83 |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#ifndef __CALENDARSERVICE_H |
|
21 |
#define __CALENDARSERVICE_H |
|
22 |
||
23 |
class CAsyncRequestObserver; |
|
24 |
class CEntryAttributes; |
|
25 |
class CCalendarSessionInfo; |
|
26 |
||
27 |
/** |
|
28 |
* Calendar Service class. Perfoms various operations on calendar / calendar entries. |
|
29 |
*/ |
|
30 |
class CCalendarService : public CBase |
|
31 |
{ |
|
32 |
public: |
|
33 |
||
34 |
/** |
|
35 |
* Two Phase Constructor |
|
36 |
*/ |
|
37 |
IMPORT_C static CCalendarService* NewL(); |
|
38 |
||
39 |
/** |
|
40 |
* Destructor |
|
41 |
*/ |
|
42 |
virtual ~CCalendarService(); |
|
43 |
||
44 |
private: |
|
45 |
||
46 |
/** |
|
47 |
* Constructor |
|
48 |
*/ |
|
49 |
CCalendarService(); |
|
50 |
||
51 |
/** |
|
52 |
* Constructor |
|
53 |
*/ |
|
54 |
void ConstructL(); |
|
55 |
||
56 |
/** |
|
57 |
* Adds asynchronous request object |
|
58 |
* @param aTransactionId Transcation Id os Async object |
|
59 |
* @param aAsyncObj Async object |
|
60 |
*/ |
|
61 |
void AddAsyncObjL( const TInt32 aTransactionId, CCalendarASyncRequest* aAsyncObj ); |
|
62 |
||
63 |
/** |
|
64 |
* Returns session info for the given calendar |
|
65 |
* @param aCalendar Calendar Name |
|
66 |
* @return CCalendarSessionInfo* Session info object |
|
67 |
*/ |
|
68 |
CCalendarSessionInfo* CalendarSessionInfoL( const TDesC& aCalendar ); |
|
69 |
||
70 |
/** |
|
71 |
* Removes Session info object |
|
72 |
* @param aCalendar Calendar session to be removed |
|
73 |
* @return void |
|
74 |
*/ |
|
75 |
void RemoveSessionInfo( const TDesC& aCalendar ); |
|
76 |
||
77 |
public: |
|
78 |
||
79 |
/** |
|
80 |
* Returns list of available calendars in device. |
|
81 |
* @param aDefault Flag for getting default calendar only |
|
82 |
* @param aCalendarList Calendar List |
|
83 |
*/ |
|
84 |
IMPORT_C void GetListL( CDesCArray*& aCalendarList, const TBool aDefault = EFalse ); |
|
85 |
||
86 |
/** |
|
87 |
* Returns list of calendar entries from given calendar with the given Global UID. |
|
88 |
* @param aCalendarName Calendar Name |
|
89 |
* @param aGuid Global UID |
|
90 |
* @param aEntryList output param gives Calendar Entry List |
|
91 |
*/ |
|
92 |
IMPORT_C void GetListL( const TDesC& aCalendarName, const TDesC8& aGuid, RPointerArray<CCalEntry>& aEntryList); |
|
93 |
||
94 |
/** |
|
95 |
* Returns list of calendar entries from given calendar with the given Local UID. |
|
96 |
* @param aCalendarName Calendar Name |
|
97 |
* @param aLocalUid Local UID |
|
98 |
* @param aEntryList output param gives Calendar Entry List |
|
99 |
*/ |
|
100 |
IMPORT_C void GetListL( const TDesC& aCalendarName, const TCalLocalUid aLocalUid, RPointerArray<CCalEntry>& aEntryList); |
|
101 |
||
102 |
/** |
|
103 |
* Returns list of calendar instance from given calendar with the given Filter. |
|
104 |
* @param aCalendarName Calendar Name |
|
105 |
* @param aFilter Filter, Ownership is passed |
|
106 |
* @param aInstanceList output param gives Calendar Instance List |
|
107 |
*/ |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
108 |
IMPORT_C void GetListL( const TDesC& aCalendarName, CCalendarFilter* aFilter, RPointerArray<CCalInstance>& aInstanceList); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
109 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
110 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
111 |
* Returns list of calendar instance from given calendar with the given Filter. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
112 |
* @param aCalendarName Calendar Name |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
113 |
* @param aFilter Filter, Ownership is passed |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
114 |
* @param aCallBack For ASyncronous usage of this Object this paramater is mandatory to be set |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
115 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
116 |
IMPORT_C void GetListL( const TDesC& aCalendarName, CCalendarFilter* aFilter, MCalCallbackBase* aCallBack); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
117 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
118 |
* Returns list of calendar entries from given calendar with the given Global UID. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
119 |
* @param aCalendarName Calendar Name |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
120 |
* @param aGuid Global UID |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
121 |
* @param aCallBack For ASyncronous usage of this Object this paramater is mandatory to be set |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
122 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
123 |
IMPORT_C void GetListL( const TDesC& aCalendarName, const TDesC8& aGuid, MCalCallbackBase* aCallBack); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
124 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
125 |
* Returns list of calendar entries from given calendar with the given Global UID. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
126 |
* @param aCalendarName Calendar Name |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
127 |
* @param aGuid Global UID |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
128 |
* @param aCallBack For ASyncronous usage of this Object this paramater is mandatory to be set |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
129 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
130 |
IMPORT_C void GetListL( const TDesC& aCalendarName, const TCalLocalUid aLocalUid, MCalCallbackBase* aCallBack); |
19 | 131 |
|
132 |
/** |
|
133 |
* Add new calendar in device. |
|
134 |
* @param aCalendarName Calendar Name |
|
135 |
*/ |
|
136 |
IMPORT_C void AddL( const TDesC& aCalendarName ); |
|
137 |
||
138 |
/** |
|
139 |
* Add new entry to given calendar. |
|
140 |
* @param aCalendarName Calendar Name |
|
141 |
* @param aCalendarData Entry data, Ownership is passed |
|
142 |
* @param aUidAdded Uid for newly added entry |
|
143 |
*/ |
|
144 |
IMPORT_C void AddL( const TDesC& aCalendarName, CEntryAttributes* aCalendarData, TUIDSet*& aUidAdded ); |
|
145 |
||
146 |
/** |
|
147 |
* Remove calendar from the device. Deletion of defaut calendar is not supported |
|
148 |
* @param aCalendarName Calendar Name |
|
149 |
*/ |
|
150 |
IMPORT_C void DeleteL( const TDesC& aCalendarName ); |
|
151 |
||
152 |
/** |
|
153 |
* Remove entries from the given calendar based on input filter |
|
154 |
* @param aCalendarName Calendar Name |
|
155 |
* @param aFilter Filter, Ownership is passed |
|
156 |
* @param aCallback CallBack for asynchronous requests, Ownership is passed |
|
157 |
*/ |
|
158 |
IMPORT_C void DeleteL( const TDesC& aCalendarName, CCalendarFilter* aFilter, MCalCallbackBase* aCallback = NULL ); |
|
159 |
||
160 |
||
161 |
/** |
|
162 |
* ASynchronous Version of Import: Imports the contents specified in the InputBuffer complaining to aFormat to aCalendarName |
|
163 |
* @param aCalendarName Calendar Name |
|
164 |
* @param aFormat used to set the iFormat it can be either ICAL or VCAL, two popular Calendar formats |
|
165 |
* @param aInputBuffer contains the data to be imported to the specified calendar |
|
166 |
* @param aCallBack For ASyncronous usage of this Object this paramater is mandatory to be set |
|
167 |
* |
|
168 |
* @return void |
|
169 |
*/ |
|
170 |
IMPORT_C void ImportL( const TDesC& aCalendarName, const TDesC8& aFormat, const TDesC8& aInputBuffer, MCalCallbackBase* aCallBack ); |
|
171 |
||
172 |
/** |
|
173 |
* ASynchronous Version of Import: Imports the contents specified in the InputBuffer complaining to aFormat to aCalendarName |
|
174 |
* @param aCalendarName Calendar Name |
|
175 |
* @param aFormat used to set the iFormat it can be either ICAL or VCAL, two popular Calendar formats |
|
176 |
* @param aImportFile File from where entries needs to be imported |
|
177 |
* @param aCallBack For ASyncronous usage of this Object this paramater is mandatory to be set |
|
178 |
* |
|
179 |
* @return void |
|
180 |
*/ |
|
181 |
IMPORT_C void ImportL( const TDesC& aCalendarName, const TDesC8& aFormat, const TDesC& aImportFile, MCalCallbackBase* aCallBack ); |
|
182 |
||
183 |
/** |
|
184 |
* Synchronous Version of Import: Imports the contents specified in the InputBuffer complaining to aFormat to aCalendarName |
|
185 |
* @param aCalendarName Calendar Name |
|
186 |
* @param aFormat used to set the iFormat it can be either ICAL or VCAL, two popular Calendar formats |
|
187 |
* @param aInputBuffer contains the data to be imported to the specified calendar |
|
188 |
* @param aCUIDSet contains the GUids and LUids of the imported entries from inputbuffer |
|
189 |
* |
|
190 |
* @return void |
|
191 |
*/ |
|
192 |
IMPORT_C void ImportL( const TDesC& aCalendarName, const TDesC8& aFormat, const TDesC8& aInputBuffer, RPointerArray<TUIDSet>& aUIDSet ); |
|
193 |
||
194 |
/** |
|
195 |
* Synchronous Version of Import: Imports the contents specified in the InputBuffer complaining to aFormat to aCalendarName |
|
196 |
* @param aCalendarName Calendar Name |
|
197 |
* @param aFormat used to set the iFormat it can be either ICAL or VCAL, two popular Calendar formats |
|
198 |
* @param aImportFile File from where entries needs to be imported |
|
199 |
* @param aCUIDSet contains the GUids and LUids of the imported entries from inputbuffer |
|
200 |
* |
|
201 |
* @return void |
|
202 |
*/ |
|
203 |
IMPORT_C void ImportL( const TDesC& aCalendarName, const TDesC8& aFormat, const TDesC& aImportFile, RPointerArray<TUIDSet>& aUIDSet ); |
|
204 |
||
205 |
/** |
|
206 |
* Synchronous Version of Export which Exports the data from aCalendarName in aFormat to aOutputBuffer |
|
207 |
* @param aCalendarName Calendar Name |
|
208 |
* @param aFormat used to set the iFormat it can be either ICAL or VCAL, two popular Calendar formats |
|
209 |
* @param aParams used to specify the GUIDS or LUIDS in it or nulll signify all entries to be exported |
|
210 |
* @param aOutputBuffer This Buffer contains the Output (Exported from the calender) |
|
211 |
* |
|
212 |
* @return void |
|
213 |
*/ |
|
214 |
IMPORT_C void ExportL( const TDesC& aCalendarName, const TDesC8& aFormat, CCalendarExportParams* aParams, HBufC8*& aOutputBuffer ); |
|
215 |
||
216 |
/** |
|
217 |
* ASynchronous Version of Export which Exports the data from aCalendarName in aFormat to HBufC8*(which is sent througn callback mehcnism) |
|
218 |
* @param aCalendarName Calendar Name |
|
219 |
* @param aFormat used to set the iFormat it can be either ICAL or VCAL, two popular Calendar formats |
|
220 |
* @param aParams used to specify the GUIDS or LUIDS in it or nulll signify all entries to be exported |
|
221 |
* @param aCallBack For ASyncronous usage of this Object this paramater is mandatory to be set |
|
222 |
* |
|
223 |
* @return void |
|
224 |
*/ |
|
225 |
IMPORT_C void ExportL( const TDesC& aCalendarName, const TDesC8& aFormat, CCalendarExportParams* aParams, MCalCallbackBase* aCallBack ); |
|
226 |
||
227 |
/** |
|
228 |
* Start Notification for changes in given calendar |
|
229 |
* @param aCalendarName Calendar Name |
|
230 |
* @param aFilter Filter, Ownership is passed |
|
231 |
* @param aCallback CallBack for asynchronous requests, Ownership is passed |
|
232 |
*/ |
|
233 |
IMPORT_C void StartChangeNotifyL( const TDesC& aCalendarName, CCalendarFilter* aFilter, MCalCallbackBase* aCallback ); |
|
234 |
||
235 |
/** |
|
236 |
* Cancels asynchronous request |
|
237 |
* @param aTransactionId asynchronous transaction id |
|
238 |
* @param aResult error code |
|
239 |
*/ |
|
240 |
IMPORT_C TInt Cancel( TInt32 aTransectionID ); |
|
241 |
||
242 |
||
243 |
private: |
|
244 |
||
245 |
/** |
|
246 |
* Represents a channel of communication between a client thread |
|
247 |
* and the Calendar Server thread. |
|
248 |
*/ |
|
249 |
RPointerArray< CCalendarSessionInfo > iArraySessionInfo; |
|
250 |
||
251 |
/** |
|
252 |
* Asynchronous request observer |
|
253 |
*/ |
|
254 |
CAsyncRequestObserver* iAsyncReqObserver; |
|
255 |
}; |
|
256 |
||
257 |
||
258 |
#endif __CALENDARSERVICE_H |