epoc32/include/caldataexchange.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 caldataexchange.h
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CCALDATAEXCHANGE_H__ 
       
    17 #define __CCALDATAEXCHANGE_H__
       
    18 
       
    19 #include <calentry.h>
       
    20 
       
    21 class CCalDataExchangeImpl;
       
    22 class CCalSession;
       
    23 class RWriteStream;
       
    24 
       
    25 /** The default number of entries to import or export between callbacks.
       
    26 @publishedAll
       
    27 @released
       
    28 */
       
    29 const TInt KDefaultNumberOfEntriesToHandle = 10;
       
    30 
       
    31 /** A call back class to show the progress of long-running operations.
       
    32 
       
    33 When a long-running operation is carried out, this class is used to signal its progress, 
       
    34 and when the function is complete.
       
    35 
       
    36 @publishedAll
       
    37 @released
       
    38 */
       
    39 class MCalDataExchangeCallBack
       
    40 	{
       
    41 public:
       
    42 	/** Progress callback. 
       
    43 
       
    44 	This calls the observing class with the percentage complete of the current operation.
       
    45 	This also propagates any error to the observing class.
       
    46 
       
    47 	@param aPercentageCompleted The percentage complete. */
       
    48 	virtual void Progress(TInt aPercentageCompleted) = 0;
       
    49 
       
    50 	/** Progress callback.
       
    51 
       
    52 	This calls the observing class when the current operation is finished. */
       
    53 	virtual void Completed() = 0;
       
    54 	
       
    55 	/* Retrieve the number of entries to handle at once. 
       
    56 	@return The number of entries to handle at once.
       
    57 	*/
       
    58 	virtual TInt NumberOfEntriesToHandleAtOnce() { return KDefaultNumberOfEntriesToHandle; };
       
    59 	};
       
    60 
       
    61 /** 
       
    62 This class provides functionality for importing and exporting vCal entries.
       
    63 @publishedAll
       
    64 @released
       
    65 */
       
    66 NONSHARABLE_CLASS(CCalDataExchange) : public CBase
       
    67 	{
       
    68 public:
       
    69 	IMPORT_C static CCalDataExchange* NewL(CCalSession& aSession);
       
    70 	IMPORT_C ~CCalDataExchange();
       
    71 	
       
    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);	
       
    75 	
       
    76 	IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags, TInt aNumEntries);
       
    77 
       
    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);
       
    80 	
       
    81 private:
       
    82 	CCalDataExchange();
       
    83 	void ConstructL(CCalSession& aSession);
       
    84 	
       
    85 private:
       
    86 	CCalDataExchangeImpl* iImpl;
       
    87 	};
       
    88 
       
    89 #endif // __CCALDATAEXCHANGE_H__