pimappservices/calendar/inc/calversit.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 // Copyright (c) 2006-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 #ifndef __CALVERSIT_H__ 
       
    17 #define __CALVERSIT_H__
       
    18 
       
    19 #include <vutil.h>
       
    20 
       
    21 class CCalEntry;
       
    22 class MCalDataExchangeCallBack;
       
    23 class RReadStream;
       
    24 class RWriteStream;
       
    25 
       
    26 class MAgnVersit
       
    27 /** Provides an interface to decouple the static dependency of CAgnEntryModel on 
       
    28 Versit.
       
    29 
       
    30 This interface is implemented by the internal class TAgnVCalConverter, in a DLL 
       
    31 called agnversit.dll. Rather than statically linking against versit.dll, the 
       
    32 agenda engine dynamically loads agnversit.dll, to remove its dependency on Versit. 
       
    33 All CAgnEntryModel's vCalendar-specific functions call the corresponding functions, 
       
    34 below. 
       
    35 @internalAll
       
    36 @released
       
    37 */
       
    38 	{
       
    39 public:
       
    40 	/** Imports a vCalendar consisting of one or more vCalendar entities.
       
    41 	
       
    42 	The vCalendar is read from the read stream specified and its entities are 
       
    43 	converted into agenda entries and returned in the array aEntryArray.
       
    44 	
       
    45 	@param aFlags CAgnEntryModel::ELocalTime causes all date/times to be converted 
       
    46 	to machine-local; CAgnEntryModel::EDefault leaves them unadjusted.
       
    47 	@param aReadStream The read stream which contains the vCalendar.
       
    48 	@param aEntryArray On return, a list of the agenda entries which were imported 
       
    49 	from the vCalendar. The list contains the vEvents followed by the vTodos.
       
    50 	@param aEntryModel Pointer to the agenda entry model instance that is calling 
       
    51 	this function. */
       
    52 	virtual void ImportVCalL(TInt aFlags, RReadStream& aReadStream, RPointerArray<CCalEntry>& aEntryArray)=0;
       
    53 	/** Exports one or more agenda entries as vCalendar entities to the write stream 
       
    54 	specified. 
       
    55 	
       
    56 	The entries are exported either as vTodos, if they are to-dos, otherwise as 
       
    57 	vEvents.
       
    58 	
       
    59 	@param aFlags CAgnEntryModel::ELocalTime causes all date/times to be left 
       
    60 	as machine-local; CAgnEntryModel::EDefault causes them to be converted into 
       
    61 	UTC.
       
    62 	@param aWriteStream The stream to which the agenda entries should be externalised 
       
    63 	as vCalendar entities.
       
    64 	@param aEntryArray Pointer to the array of agenda entries to export.
       
    65 	@param aCharSet The character encoding type.
       
    66 	@param aEntryModel Pointer to the agenda entry model instance that is calling 
       
    67 	this function. */
       
    68 	virtual	void ExportVCalL(RWriteStream& aWriteStream, const RPointerArray<CCalEntry>& aEntryArray, const Versit::TVersitCharSet aCharSet)=0;
       
    69 	/** Parses a vCalendar stream and updates the appropriate entries.
       
    70 	
       
    71 	/** Asynchronously imports a vCalendar consisting of one or more vCalendar entities.
       
    72 	
       
    73 	The vCalendar is read from the read stream specified and its entities are 
       
    74 	converted into agenda entries and returned in the array aEntryArray.
       
    75 	@released
       
    76 	@param aFlags CAgnEntryModel::ELocalTime causes all date/times to be converted 
       
    77 	to machine-local; CAgnEntryModel::EDefault leaves them unadjusted.
       
    78 	@param aReadStream The read stream which contains the vCalendar.
       
    79 	@param aEntryArray On return, a list of the agenda entries which were imported 
       
    80 	from the vCalendar. The list contains the vEvents followed by the vTodos.
       
    81 	@param aEntryModel Pointer to the agenda entry model instance that is calling 
       
    82 	this function. 
       
    83 	@param aObserver Callback to indicate the progress of the import and when it has completed. */
       
    84 	virtual void ImportVCalAsyncL(TInt aFlags, RReadStream& aReadStream, RPointerArray<CCalEntry>& aEntryArray, 
       
    85 				 MCalDataExchangeCallBack& aObserver) = 0;
       
    86 					
       
    87 	/** Asynchronously exports one or more agenda entries as vCalendar entities to the write stream 
       
    88 	specified. 
       
    89 	
       
    90 	The entries are exported either as vTodos, if they are to-dos, otherwise as 
       
    91 	vEvents.
       
    92 	@released
       
    93 	@param aFlags CAgnEntryModel::ELocalTime causes all date/times to be left 
       
    94 	as machine-local; CAgnEntryModel::EDefault causes them to be converted into 
       
    95 	UTC.
       
    96 	@param aWriteStream The stream to which the agenda entries should be externalised 
       
    97 	as vCalendar entities.
       
    98 	@param aEntryArray Pointer to the array of agenda entries to export.
       
    99 	@param aCharSet The character encoding type.
       
   100 	@param aEntryModel Pointer to the agenda entry model instance that is calling 
       
   101 	this function. 
       
   102 	@param aObserver Callback to indicate the progress of the import and when it has completed.  */
       
   103 	virtual void ExportVCalAsyncL(RWriteStream& aWriteStream, RPointerArray<CCalEntry>& aCalEntryArray, 
       
   104 				MCalDataExchangeCallBack& aObserver, const Versit::TVersitCharSet aCharSet) = 0;
       
   105 
       
   106 	};
       
   107 	
       
   108 class CAgnVersit: public CBase, public MAgnVersit
       
   109 /** Provides an interface for ECom plugins
       
   110 @internalAll
       
   111 @released
       
   112 */
       
   113 	{
       
   114 public:
       
   115 	static CAgnVersit* NewL();
       
   116 	/** Releases Ecom resources
       
   117 	*/
       
   118 	IMPORT_C virtual ~CAgnVersit();
       
   119 private:
       
   120 	TUid iDtor_ID_Key;
       
   121 	};
       
   122 
       
   123 #endif // __CCALDATAEXCHANGE_H__