1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CCALDATAEXCHANGE_H__
17 #define __CCALDATAEXCHANGE_H__
21 class CCalDataExchangeImpl;
25 /** The default number of entries to import or export between callbacks.
29 const TInt KDefaultNumberOfEntriesToHandle = 10;
31 /** A call back class to show the progress of long-running operations.
33 When a long-running operation is carried out, this class is used to signal its progress,
34 and when the function is complete.
39 class MCalDataExchangeCallBack
42 /** Progress callback.
44 This calls the observing class with the percentage complete of the current operation.
45 This also propagates any error to the observing class.
47 @param aPercentageCompleted The percentage complete. */
48 virtual void Progress(TInt aPercentageCompleted) = 0;
50 /** Progress callback.
52 This calls the observing class when the current operation is finished. */
53 virtual void Completed() = 0;
55 /* Retrieve the number of entries to handle at once.
56 @return The number of entries to handle at once.
58 virtual TInt NumberOfEntriesToHandleAtOnce() { return KDefaultNumberOfEntriesToHandle; };
62 This class provides functionality for importing and exporting vCal entries.
66 NONSHARABLE_CLASS(CCalDataExchange) : public CBase
69 IMPORT_C static CCalDataExchange* NewL(CCalSession& aSession);
70 IMPORT_C ~CCalDataExchange();
72 IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray);
73 IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags);
74 IMPORT_C void ExportL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray);
76 IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags, TInt aNumEntries);
78 IMPORT_C void ImportAsyncL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver, TInt aFlags);
79 IMPORT_C void ExportAsyncL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver);
83 void ConstructL(CCalSession& aSession);
86 CCalDataExchangeImpl* iImpl;
89 #endif // __CCALDATAEXCHANGE_H__