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