1.1 --- a/epoc32/include/caldataexchange.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/caldataexchange.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,89 @@
1.4 -caldataexchange.h
1.5 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __CCALDATAEXCHANGE_H__
1.21 +#define __CCALDATAEXCHANGE_H__
1.22 +
1.23 +#include <calentry.h>
1.24 +
1.25 +class CCalDataExchangeImpl;
1.26 +class CCalSession;
1.27 +class RWriteStream;
1.28 +
1.29 +/** The default number of entries to import or export between callbacks.
1.30 +@publishedAll
1.31 +@released
1.32 +*/
1.33 +const TInt KDefaultNumberOfEntriesToHandle = 10;
1.34 +
1.35 +/** A call back class to show the progress of long-running operations.
1.36 +
1.37 +When a long-running operation is carried out, this class is used to signal its progress,
1.38 +and when the function is complete.
1.39 +
1.40 +@publishedAll
1.41 +@released
1.42 +*/
1.43 +class MCalDataExchangeCallBack
1.44 + {
1.45 +public:
1.46 + /** Progress callback.
1.47 +
1.48 + This calls the observing class with the percentage complete of the current operation.
1.49 + This also propagates any error to the observing class.
1.50 +
1.51 + @param aPercentageCompleted The percentage complete. */
1.52 + virtual void Progress(TInt aPercentageCompleted) = 0;
1.53 +
1.54 + /** Progress callback.
1.55 +
1.56 + This calls the observing class when the current operation is finished. */
1.57 + virtual void Completed() = 0;
1.58 +
1.59 + /* Retrieve the number of entries to handle at once.
1.60 + @return The number of entries to handle at once.
1.61 + */
1.62 + virtual TInt NumberOfEntriesToHandleAtOnce() { return KDefaultNumberOfEntriesToHandle; };
1.63 + };
1.64 +
1.65 +/**
1.66 +This class provides functionality for importing and exporting vCal entries.
1.67 +@publishedAll
1.68 +@released
1.69 +*/
1.70 +NONSHARABLE_CLASS(CCalDataExchange) : public CBase
1.71 + {
1.72 +public:
1.73 + IMPORT_C static CCalDataExchange* NewL(CCalSession& aSession);
1.74 + IMPORT_C ~CCalDataExchange();
1.75 +
1.76 + IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray);
1.77 + IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags);
1.78 + IMPORT_C void ExportL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray);
1.79 +
1.80 + IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags, TInt aNumEntries);
1.81 +
1.82 + IMPORT_C void ImportAsyncL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver, TInt aFlags);
1.83 + IMPORT_C void ExportAsyncL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver);
1.84 +
1.85 +private:
1.86 + CCalDataExchange();
1.87 + void ConstructL(CCalSession& aSession);
1.88 +
1.89 +private:
1.90 + CCalDataExchangeImpl* iImpl;
1.91 + };
1.92 +
1.93 +#endif // __CCALDATAEXCHANGE_H__