calendarengines/caldav/inc/caldavenginemgr.h
branchRCL_3
changeset 31 97232defd20e
equal deleted inserted replaced
30:bd7edf625bdd 31:97232defd20e
       
     1 /*
       
     2 * Copyright (c) 2010 Sun Microsystems, Inc. and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributor:
       
    10 * Maximilian Odendahl
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: provides a manager to keep track of all available engines
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CCALDAVENGINEMGR_H
       
    19 #define CCALDAVENGINEMGR_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 #include <calprogresscallback.h>
       
    26 
       
    27 class CCalDavEngine;
       
    28 /**
       
    29  *  CCalDavEngineMgr
       
    30  * 
       
    31  */
       
    32 class CCalDavEngineMgr : public CBase, MCalProgressCallBack
       
    33 	{
       
    34 public:
       
    35 
       
    36 	~CCalDavEngineMgr();
       
    37 
       
    38 	static CCalDavEngineMgr* NewL();
       
    39 	static CCalDavEngineMgr* NewLC();
       
    40 	
       
    41 	void Progress(TInt aPercentageCompleted);
       
    42 	void Completed(TInt aError);
       
    43 	TBool NotifyProgress();
       
    44 
       
    45 	TInt SyncL(const TDesC &aCalendar);
       
    46 	TInt SyncAllL();
       
    47 
       
    48 	TInt EnableL(const TDesC &aCalendar);
       
    49 	TInt DisableL(const TDesC &aCalendar);
       
    50 
       
    51 	TBool EnabledSyncL(const TDesC &aCalendar);
       
    52 
       
    53 	TPtrC8 UrlL(const TDesC &aCalendar);
       
    54 	void SetUrlL(const TDesC &aCalendar, const TDesC8 &aUrl);
       
    55 
       
    56 	TPtrC8 UsernameL(const TDesC &aCalendar);
       
    57 	void SetUsernameL(const TDesC &aCalendar, const TDesC8 &aUsername);
       
    58 
       
    59 	TPtrC8 PasswordL(const TDesC &aCalendar);
       
    60 	void SetPasswordL(const TDesC &aCalendar, const TDesC8 &aPassword);
       
    61 
       
    62 	// TODO do also if enable was not called yet? if yes, create CalDavEngine and store settings
       
    63 	TTimeIntervalMinutes SyncIntervalL(const TDesC &aCalendar);
       
    64 	void SetSyncIntervalL(const TDesC &aCalendar,
       
    65 			TTimeIntervalMinutes aSyncInterval);
       
    66 
       
    67 	TTimeIntervalDays PastDaysL(const TDesC &aCalendar);
       
    68 	void SetPastDaysL(const TDesC &aCalendar, TTimeIntervalDays aDays);
       
    69 
       
    70 	TBool ImmediateSyncL(const TDesC &aCalendar);
       
    71 	void SetImmediateSyncL(const TDesC &aCalendar, TBool aImmediateSyc);
       
    72 
       
    73 	TBool KeepServerEntryL(const TDesC &aCalendar);
       
    74 	void SetKeepServerEntryL(const TDesC &aCalendar, TBool aKeepServerEntry);
       
    75 
       
    76 private:
       
    77 
       
    78 	CCalDavEngineMgr();
       
    79 	void ConstructL();
       
    80 
       
    81 	TInt FindEngineL(const TDesC &aName, TBool aCreate = EFalse);
       
    82 	RPointerArray<CCalDavEngine> iEngines;
       
    83 
       
    84 	};
       
    85 
       
    86 #endif // CCALDAVENGINEMGR_H