2 * Copyright (c) 2010 Sun Microsystems, Inc. and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "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".
14 * Description: Client API to connect to Caldav server
15 * Wrapper around RCalDavServer
18 #ifndef CCALDAVSESSION_H
19 #define CCALDAVSESSION_H
25 class CCalDavSessionImpl;
28 * @class CCalenCustomisation
29 * @brief Client API to connect to the CalDAV server.
31 NONSHARABLE_CLASS( CCalDavSession ) : public CBase
34 /** Allocates and constructs a session to the Calendar server.
35 * @return Pointer to the newly created session.
37 IMPORT_C static CCalDavSession* NewL();
38 /** Allocates and constructs a session to the Calendar server.
39 @return Pointer to the newly created session.
41 IMPORT_C static CCalDavSession* NewLC();
44 * standard destructor, close session with CalDavServer
46 IMPORT_C ~CCalDavSession();
49 Enable access to a remote CalDAV server. At least url,
50 username and password need to be set first.
52 @param aCalendar calendar to enable, must be internal filename in the form c:calendar
54 IMPORT_C TInt Enable(const TDesC &aCalendar);
56 Disable access to a remote CalDAV server.
58 @param aCalendar calendar to disable, must be internal filename in the form c:calendar
60 IMPORT_C TInt Disable(const TDesC &aCalendar);
63 On demand syncing of an enabled connection of one calendar file
65 @param aCalendar calendar to enable, must be internal filename in the form c:calendar
67 IMPORT_C TInt SyncL(const TDesC &aCalendar);
69 On demand syncing of all enabled connections
71 IMPORT_C TInt SyncAllL();
74 Retrieve connection url
76 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
77 @param aUrl url for the connection
79 IMPORT_C TInt Url(const TDesC &aCalendar, TDes8 &aUrl);
83 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
84 @param aUrl url for the url
86 IMPORT_C TInt SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl);
89 Retrieve connection username
91 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
92 @param aUsername username for the connection
95 IMPORT_C TInt Username(const TDesC &aCalendar, TDes8 &aUsername);
97 Set connection username
99 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
100 @param aUsername username for the connection
102 IMPORT_C TInt SetUsername(const TDesC &aCalendar, const TDesC8 &aUsername);
105 Retrieve connection password
107 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
108 @param aPassword password for the connection
111 IMPORT_C TInt Password(const TDesC &aCalendar, TDes8 &aPassword);
113 Set connection password
115 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
116 @param aPassword password for the connection
118 IMPORT_C TInt SetPassword(const TDesC &aCalendar, const TDesC8 &aPassword);
120 Retrieve synchonization interval
122 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
123 @param aSyncInterval sync interval for the connection
126 IMPORT_C TInt SyncInterval(const TDesC &aCalendar,
127 TTimeIntervalMinutes& aSyncInterval);
129 Set synchonization interval
131 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
132 @param aSyncInterval sync interval for the connection, value of zero minutes meaning
133 continuous connection
135 IMPORT_C TInt SetSyncInterval(const TDesC &aCalendar,
136 TTimeIntervalMinutes aSyncInterval);
139 Retrieve time range into past for synchronization
141 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
142 @param aDays number of days into the past for the connection
144 IMPORT_C TInt PastDays(const TDesC &aCalendar, TTimeIntervalDays &aDays);
146 Set time range into past for synchronization
148 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
149 @param aDays number of days into the past for the connection
151 IMPORT_C TInt SetPastDays(const TDesC &aCalendar, TTimeIntervalDays aDays);
154 Retrieve immediate push of client changes
156 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
157 @param aImmediateSync push client changes immediatly
159 IMPORT_C TInt ImmediateSync(const TDesC &aCalendar, TBool &aImmediateSyc);
161 Set immediate push of client changes
163 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
164 @param aImmediateSync push client changes immediatly
166 IMPORT_C TInt SetImmediateSync(const TDesC &aCalendar, TBool aImmediateSyc);
169 During a synchronisation conflict, either the server or client needs to win, default is the server
171 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
172 @param aKeepServerEntry server or client wins during synchronisation
174 IMPORT_C TInt KeepServerEntry(const TDesC &aCalendar,
175 TBool &aKeepServerEntry);
177 During a synchronisation conflict, either the server or client needs to win, which can be set here
179 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
180 @param aKeepServerEntry server or client wins during synchronisation
182 IMPORT_C TInt SetKeepServerEntry(const TDesC &aCalendar,
183 TBool aKeepServerEntry);
186 Retrieve connection status
188 @param aCalendar calendar for sync, must be internal filename in the form c:calendar
189 @param aEnabledSync connection status
191 IMPORT_C TInt EnabledSync(const TDesC &aCalendar, TBool &aEnabledSync);
198 CCalDavSessionImpl* iImpl;
202 #endif // CCALDAVSESSION_H