williamr@4: /* williamr@4: * Copyright (c) 2010 Sun Microsystems, Inc. and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributor: williamr@4: * Maximilian Odendahl williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: Client API to connect to Caldav server williamr@4: * Wrapper around RCalDavServer williamr@4: */ williamr@4: williamr@4: #ifndef CCALDAVSESSION_H williamr@4: #define CCALDAVSESSION_H williamr@4: williamr@4: // INCLUDES williamr@4: #include williamr@4: #include williamr@4: williamr@4: class CCalDavSessionImpl; williamr@4: williamr@4: /** williamr@4: * @class CCalenCustomisation williamr@4: * @brief Client API to connect to the CalDAV server. williamr@4: */ williamr@4: NONSHARABLE_CLASS( CCalDavSession ) : public CBase williamr@4: { williamr@4: public: williamr@4: /** Allocates and constructs a session to the Calendar server. williamr@4: * @return Pointer to the newly created session. williamr@4: */ williamr@4: IMPORT_C static CCalDavSession* NewL(); williamr@4: /** Allocates and constructs a session to the Calendar server. williamr@4: @return Pointer to the newly created session. williamr@4: */ williamr@4: IMPORT_C static CCalDavSession* NewLC(); williamr@4: williamr@4: /** williamr@4: * standard destructor, close session with CalDavServer williamr@4: */ williamr@4: IMPORT_C ~CCalDavSession(); williamr@4: williamr@4: /** williamr@4: Enable access to a remote CalDAV server. At least url, williamr@4: username and password need to be set first. williamr@4: williamr@4: @param aCalendar calendar to enable, must be internal filename in the form c:calendar williamr@4: */ williamr@4: IMPORT_C TInt Enable(const TDesC &aCalendar); williamr@4: /** williamr@4: Disable access to a remote CalDAV server. williamr@4: williamr@4: @param aCalendar calendar to disable, must be internal filename in the form c:calendar williamr@4: */ williamr@4: IMPORT_C TInt Disable(const TDesC &aCalendar); williamr@4: williamr@4: /** williamr@4: On demand syncing of an enabled connection of one calendar file williamr@4: williamr@4: @param aCalendar calendar to enable, must be internal filename in the form c:calendar williamr@4: */ williamr@4: IMPORT_C TInt SyncL(const TDesC &aCalendar); williamr@4: /** williamr@4: On demand syncing of all enabled connections williamr@4: */ williamr@4: IMPORT_C TInt SyncAllL(); williamr@4: williamr@4: /** williamr@4: Retrieve connection url williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aUrl url for the connection williamr@4: */ williamr@4: IMPORT_C TInt Url(const TDesC &aCalendar, TDes8 &aUrl); williamr@4: /** williamr@4: Set connection url williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aUrl url for the url williamr@4: */ williamr@4: IMPORT_C TInt SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl); williamr@4: williamr@4: /** williamr@4: Retrieve connection username williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aUsername username for the connection williamr@4: */ williamr@4: williamr@4: IMPORT_C TInt Username(const TDesC &aCalendar, TDes8 &aUsername); williamr@4: /** williamr@4: Set connection username williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aUsername username for the connection williamr@4: */ williamr@4: IMPORT_C TInt SetUsername(const TDesC &aCalendar, const TDesC8 &aUsername); williamr@4: williamr@4: /** williamr@4: Retrieve connection password williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aPassword password for the connection williamr@4: */ williamr@4: williamr@4: IMPORT_C TInt Password(const TDesC &aCalendar, TDes8 &aPassword); williamr@4: /** williamr@4: Set connection password williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aPassword password for the connection williamr@4: */ williamr@4: IMPORT_C TInt SetPassword(const TDesC &aCalendar, const TDesC8 &aPassword); williamr@4: /** williamr@4: Retrieve synchonization interval williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aSyncInterval sync interval for the connection williamr@4: */ williamr@4: williamr@4: IMPORT_C TInt SyncInterval(const TDesC &aCalendar, williamr@4: TTimeIntervalMinutes& aSyncInterval); williamr@4: /** williamr@4: Set synchonization interval williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aSyncInterval sync interval for the connection, value of zero minutes meaning williamr@4: continuous connection williamr@4: */ williamr@4: IMPORT_C TInt SetSyncInterval(const TDesC &aCalendar, williamr@4: TTimeIntervalMinutes aSyncInterval); williamr@4: williamr@4: /** williamr@4: Retrieve time range into past for synchronization williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aDays number of days into the past for the connection williamr@4: */ williamr@4: IMPORT_C TInt PastDays(const TDesC &aCalendar, TTimeIntervalDays &aDays); williamr@4: /** williamr@4: Set time range into past for synchronization williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aDays number of days into the past for the connection williamr@4: */ williamr@4: IMPORT_C TInt SetPastDays(const TDesC &aCalendar, TTimeIntervalDays aDays); williamr@4: williamr@4: /** williamr@4: Retrieve immediate push of client changes williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aImmediateSync push client changes immediatly williamr@4: */ williamr@4: IMPORT_C TInt ImmediateSync(const TDesC &aCalendar, TBool &aImmediateSyc); williamr@4: /** williamr@4: Set immediate push of client changes williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aImmediateSync push client changes immediatly williamr@4: */ williamr@4: IMPORT_C TInt SetImmediateSync(const TDesC &aCalendar, TBool aImmediateSyc); williamr@4: williamr@4: /** williamr@4: During a synchronisation conflict, either the server or client needs to win, default is the server williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aKeepServerEntry server or client wins during synchronisation williamr@4: */ williamr@4: IMPORT_C TInt KeepServerEntry(const TDesC &aCalendar, williamr@4: TBool &aKeepServerEntry); williamr@4: /** williamr@4: During a synchronisation conflict, either the server or client needs to win, which can be set here williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aKeepServerEntry server or client wins during synchronisation williamr@4: */ williamr@4: IMPORT_C TInt SetKeepServerEntry(const TDesC &aCalendar, williamr@4: TBool aKeepServerEntry); williamr@4: williamr@4: /** williamr@4: Retrieve connection status williamr@4: williamr@4: @param aCalendar calendar for sync, must be internal filename in the form c:calendar williamr@4: @param aEnabledSync connection status williamr@4: */ williamr@4: IMPORT_C TInt EnabledSync(const TDesC &aCalendar, TBool &aEnabledSync); williamr@4: williamr@4: private: williamr@4: williamr@4: CCalDavSession(); williamr@4: void ConstructL(); williamr@4: williamr@4: CCalDavSessionImpl* iImpl; williamr@4: williamr@4: }; williamr@4: williamr@4: #endif // CCALDAVSESSION_H