williamr@2
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __CCALDATAEXCHANGE_H__
|
williamr@2
|
17 |
#define __CCALDATAEXCHANGE_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <calentry.h>
|
williamr@2
|
20 |
|
williamr@2
|
21 |
class CCalDataExchangeImpl;
|
williamr@2
|
22 |
class CCalSession;
|
williamr@2
|
23 |
class RWriteStream;
|
williamr@2
|
24 |
|
williamr@2
|
25 |
/** The default number of entries to import or export between callbacks.
|
williamr@2
|
26 |
@publishedAll
|
williamr@2
|
27 |
@released
|
williamr@2
|
28 |
*/
|
williamr@2
|
29 |
const TInt KDefaultNumberOfEntriesToHandle = 10;
|
williamr@2
|
30 |
|
williamr@2
|
31 |
/** A call back class to show the progress of long-running operations.
|
williamr@2
|
32 |
|
williamr@2
|
33 |
When a long-running operation is carried out, this class is used to signal its progress,
|
williamr@2
|
34 |
and when the function is complete.
|
williamr@2
|
35 |
|
williamr@2
|
36 |
@publishedAll
|
williamr@2
|
37 |
@released
|
williamr@2
|
38 |
*/
|
williamr@2
|
39 |
class MCalDataExchangeCallBack
|
williamr@2
|
40 |
{
|
williamr@2
|
41 |
public:
|
williamr@2
|
42 |
/** Progress callback.
|
williamr@2
|
43 |
|
williamr@2
|
44 |
This calls the observing class with the percentage complete of the current operation.
|
williamr@2
|
45 |
This also propagates any error to the observing class.
|
williamr@2
|
46 |
|
williamr@2
|
47 |
@param aPercentageCompleted The percentage complete. */
|
williamr@2
|
48 |
virtual void Progress(TInt aPercentageCompleted) = 0;
|
williamr@2
|
49 |
|
williamr@2
|
50 |
/** Progress callback.
|
williamr@2
|
51 |
|
williamr@2
|
52 |
This calls the observing class when the current operation is finished. */
|
williamr@2
|
53 |
virtual void Completed() = 0;
|
williamr@2
|
54 |
|
williamr@2
|
55 |
/* Retrieve the number of entries to handle at once.
|
williamr@2
|
56 |
@return The number of entries to handle at once.
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
virtual TInt NumberOfEntriesToHandleAtOnce() { return KDefaultNumberOfEntriesToHandle; };
|
williamr@2
|
59 |
};
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
This class provides functionality for importing and exporting vCal entries.
|
williamr@2
|
63 |
@publishedAll
|
williamr@2
|
64 |
@released
|
williamr@2
|
65 |
*/
|
williamr@2
|
66 |
NONSHARABLE_CLASS(CCalDataExchange) : public CBase
|
williamr@2
|
67 |
{
|
williamr@2
|
68 |
public:
|
williamr@2
|
69 |
IMPORT_C static CCalDataExchange* NewL(CCalSession& aSession);
|
williamr@2
|
70 |
IMPORT_C ~CCalDataExchange();
|
williamr@2
|
71 |
|
williamr@2
|
72 |
IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray);
|
williamr@2
|
73 |
IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags);
|
williamr@2
|
74 |
IMPORT_C void ExportL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray);
|
williamr@2
|
75 |
|
williamr@2
|
76 |
IMPORT_C void ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags, TInt aNumEntries);
|
williamr@2
|
77 |
|
williamr@2
|
78 |
IMPORT_C void ImportAsyncL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver, TInt aFlags);
|
williamr@2
|
79 |
IMPORT_C void ExportAsyncL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver);
|
williamr@2
|
80 |
|
williamr@2
|
81 |
private:
|
williamr@2
|
82 |
CCalDataExchange();
|
williamr@2
|
83 |
void ConstructL(CCalSession& aSession);
|
williamr@2
|
84 |
|
williamr@2
|
85 |
private:
|
williamr@2
|
86 |
CCalDataExchangeImpl* iImpl;
|
williamr@2
|
87 |
};
|
williamr@2
|
88 |
|
williamr@2
|
89 |
#endif // __CCALDATAEXCHANGE_H__
|