pimappservices/calendar/client/src/caldataexchange.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <caldataexchange.h>
       
    17 #include "caldataexchangeimpl.h"
       
    18 
       
    19 /** Destructor
       
    20 @publishedAll
       
    21 @released
       
    22 @capability None
       
    23 */
       
    24 EXPORT_C CCalDataExchange::~CCalDataExchange()
       
    25 	{
       
    26 	delete iImpl;
       
    27 	}
       
    28 
       
    29 CCalDataExchange::CCalDataExchange()
       
    30 	{
       
    31 	}
       
    32 	
       
    33 void CCalDataExchange::ConstructL(CCalSession& aSession)
       
    34 	{
       
    35 	iImpl = new (ELeave) CCalDataExchangeImpl(aSession);
       
    36 	}
       
    37 	
       
    38 /** Allocates and constructs a CCalDataExchange object.
       
    39 @publishedAll
       
    40 @released
       
    41 @capability None
       
    42 @param aSession The handle to the calender session.
       
    43 @return A pointer to the new synchronisation object.
       
    44 */		
       
    45 EXPORT_C CCalDataExchange* CCalDataExchange::NewL(CCalSession& aSession)	
       
    46 	{
       
    47 	CCalDataExchange* self = new (ELeave) CCalDataExchange();
       
    48 	CleanupStack::PushL(self);
       
    49 	self->ConstructL(aSession);
       
    50 	CleanupStack::Pop(self);
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 
       
    55 /** Imports data of aDataFormat type and returns an array of CCalEntries corresponding to this data
       
    56 
       
    57 Currently only VCal 1.0 (with extensions) is supported.
       
    58 The vCalendar is read from the read stream specified and its entities are converted 
       
    59 into CCalEntries and passed back in the array parameter aCalEntryArray.
       
    60 @publishedAll
       
    61 @released
       
    62 @capability WriteUserData
       
    63 @param aDataFormat Specifies the format of the data to be imported.  Currently this must be KUidVCalendar (see CalDataFormat.h)
       
    64 @param aReadStream The read stream which contains the (vCalendar) data.
       
    65 @param aCalEntryArray On return, a list of the calender entries which were imported. 
       
    66 The list contains the vEvents followed by the vTodos
       
    67 and are specific to the data format
       
    68 */
       
    69 EXPORT_C void CCalDataExchange::ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray)
       
    70 	{
       
    71 	iImpl->ImportL(aDataFormat, aReadStream, aCalEntryArray);
       
    72 	}  
       
    73 	
       
    74 /** Imports data of aDataFormat type and returns an array of CCalEntries corresponding to this data
       
    75 
       
    76 Currently only VCal 1.0 (with extensions) is supported.
       
    77 The vCalendar is read from the read stream specified and its entities are converted 
       
    78 into CCalEntries and passed back in the array parameter aCalEntryArray.
       
    79 @publishedAll
       
    80 @released
       
    81 @capability WriteUserData
       
    82 @param aDataFormat Specifies the format of the data to be imported.  Currently this must be KUidVCalendar (see CalDataFormat.h)
       
    83 @param aReadStream The read stream which contains the (vCalendar) data.
       
    84 @param aCalEntryArray On return, a list of the calender entries which were imported. 
       
    85 The list contains the vEvents followed by the vTodos
       
    86 and are specific to the data format
       
    87 @param aFlags controls the behaviour of the parser during the import process.
       
    88 */
       
    89 EXPORT_C void CCalDataExchange::ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags)
       
    90 	{
       
    91 	iImpl->ImportL(aDataFormat, aReadStream, aCalEntryArray, aFlags);
       
    92 	}   
       
    93 	
       
    94 /** Imports data of aDataFormat type and returns an array of a selected number of CCalEntries corresponding to this data.
       
    95 
       
    96 Currently only VCal 1.0 (with extensions) is supported.
       
    97 The vCalendar is read from the read stream specified and its entities are converted 
       
    98 into CCalEntries and passed back in the array parameter aCalEntryArray.
       
    99 @publishedAll
       
   100 @released
       
   101 @capability WriteUserData
       
   102 @param aDataFormat Specifies the format of the data to be imported.  Currently this must be KUidVCalendar (see CalDataFormat.h)
       
   103 @param aReadStream The read stream which contains the (vCalendar) data.
       
   104 @param aCalEntryArray On return, a list of the calender entries which were imported. 
       
   105 The list contains the vEvents followed by the vTodos
       
   106 and are specific to the data format
       
   107 @param aFlags controls the behaviour of the parser during the import process.
       
   108 @param aNumEntries Specifies how many entries are to be imported at once.
       
   109 */
       
   110 EXPORT_C void CCalDataExchange::ImportL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, TInt aFlags, TInt aNumEntries)
       
   111 	{
       
   112 	iImpl->ImportL(aDataFormat, aReadStream, aCalEntryArray, aFlags, aNumEntries);
       
   113 	}
       
   114 	
       
   115 /** Exports data of aDataFormat type from an array of CCalEntries corresponding to this data
       
   116 
       
   117 Currently only VCal 1.0 (with extensions) is supported.
       
   118 The entry is exported either as a vTodo (if it is a to-do), or as a vEvent. The exported 
       
   119 property values are converted from Unicode into the character set indicated by the last 
       
   120 parameter (UTF-8 by default).
       
   121 @publishedAll
       
   122 @released
       
   123 @capability ReadUserData
       
   124 @param aDataFormat Specifies the format of the data to be exported.  Currently this must be KUidVCalendar (see CalDataFormat.h)
       
   125 @param aWriteStream The stream to which the calender entries should be externalised.
       
   126 @param aCalEntryArray The array of calender entries to export. 
       
   127 */	
       
   128 EXPORT_C void CCalDataExchange::ExportL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray)
       
   129 	{
       
   130 	iImpl->ExportL(aDataFormat, aWriteStream, aCalEntryArray);
       
   131 	}
       
   132 	
       
   133 /** Asynchronously imports data of aDataFormat type and returns an array of CCalEntries corresponding to this data
       
   134 
       
   135 Currently only VCal 1.0 (with extensions) is supported.
       
   136 The vCalendar is read from the read stream specified and its entities are converted 
       
   137 into CCalEntries and passed back in the array parameter aCalEntryArray.
       
   138 @publishedAll
       
   139 @released
       
   140 @capability WriteUserData
       
   141 @param aDataFormat Specifies the format of the data to be imported.  Currently this must be KUidVCalendar (see CalDataFormat.h)
       
   142 @param aReadStream The read stream which contains the (vCalendar) data.
       
   143 @param aCalEntryArray On return, a list of the calender entries which were imported. 
       
   144 The list contains the vEvents followed by the vTodos
       
   145 and are specific to the data format
       
   146 @param aObserver Callback class to indicate the progress of the import and when it has completed.
       
   147 @param aFlags controls the behaviour of the parser during the import process.
       
   148 */
       
   149 EXPORT_C void CCalDataExchange::ImportAsyncL(TUid aDataFormat, RReadStream& aReadStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver, TInt aFlags)
       
   150 	{	
       
   151 	iImpl->ImportAsyncL(aDataFormat, aReadStream, aCalEntryArray, aObserver, aFlags);
       
   152 	}
       
   153 
       
   154 /** Asynchronously exports data of aDataFormat type from an array of CCalEntries corresponding to this data
       
   155 
       
   156 Currently only VCal 1.0 (with extensions) is supported.
       
   157 The entry is exported either as a vTodo (if it is a to-do), or as a vEvent. The exported 
       
   158 property values are converted from Unicode into the character set indicated by the last 
       
   159 parameter (UTF-8 by default).
       
   160 @publishedAll
       
   161 @released
       
   162 @capability ReadUserData
       
   163 @param aDataFormat Specifies the format of the data to be exported.  Currently this must be KUidVCalendar (see CalDataFormat.h)
       
   164 @param aWriteStream The stream to which the calender entries should be externalised.
       
   165 @param aCalEntryArray The array of calender entries to export. 
       
   166 @param aObserver Callback class to indicate the progress of the import and when it has completed.
       
   167 */	
       
   168 EXPORT_C void CCalDataExchange::ExportAsyncL(TUid aDataFormat, RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray, MCalDataExchangeCallBack& aObserver)
       
   169 	{
       
   170 	iImpl->ExportAsyncL(aDataFormat, aWriteStream, aCalEntryArray, aObserver);
       
   171 	}
       
   172