1.1 --- a/epoc32/include/conarc.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,305 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#if !defined(__CONARC_H__)
1.20 -#define __CONARC_H__
1.21 -
1.22 -#if !defined(__E32BASE_H__)
1.23 -#include <e32base.h>
1.24 -#endif
1.25 -#if !defined(__APMSTD_H__)
1.26 -#include <apmstd.h>
1.27 -#endif
1.28 -
1.29 -//
1.30 -// base interface for converters
1.31 -//
1.32 -
1.33 -/**
1.34 -@publishedAll
1.35 -@released
1.36 -*/
1.37 -const TInt KUidConverterToBase64=0x10000721;
1.38 -/**
1.39 -@publishedAll
1.40 -@released
1.41 -*/
1.42 -const TInt KUidConverterFromBase64=0x100011C5;
1.43 -/**
1.44 -@publishedAll
1.45 -@released
1.46 -*/
1.47 -const TInt KUidPlainTextToQuotedPrintableConverter=0x10001826;
1.48 -/**
1.49 -@publishedAll
1.50 -@released
1.51 -*/
1.52 -const TInt KUidQuotedPrintableToPlainTextConverter=0x10001825;
1.53 -/**
1.54 -@publishedAll
1.55 -@released
1.56 -*/
1.57 -const TInt KUidETextToPlainTextConverter=
1.58 -#if defined(ETEXT_CONVERTER_UIDS_CORRECTED)
1.59 - 0x100040c8;
1.60 -#else
1.61 - 0x100040c7;
1.62 -#endif
1.63 -
1.64 -/**
1.65 -@publishedAll
1.66 -@released
1.67 -*/
1.68 -const TInt KUidPlainTextToETextConverter=
1.69 -#if defined(ETEXT_CONVERTER_UIDS_CORRECTED)
1.70 - 0x100040c7;
1.71 -#else
1.72 - 0x100040c8;
1.73 -#endif
1.74 -
1.75 -/**
1.76 -@publishedAll
1.77 -@released
1.78 -*/
1.79 -#ifdef _UNICODE
1.80 -#define KUidConverterDll KUidConverterDll16
1.81 -#else
1.82 -#define KUidConverterDll KUidConverterDll8
1.83 -#endif
1.84 -
1.85 -/**
1.86 -@internalComponent
1.87 -@deprecated
1.88 -*/
1.89 -const TInt KUidConverterDllValue8=0x10000C61;
1.90 -
1.91 -/**
1.92 -@internalComponent
1.93 -@deprecated
1.94 -*/
1.95 -const TUid KUidConverterDll8={KUidConverterDllValue8};
1.96 -
1.97 -/**
1.98 -@internalComponent
1.99 -*/
1.100 -const TInt KUidConverterInfoFileValue=0x10000C62;
1.101 -
1.102 -/**
1.103 -@publishedAll
1.104 -@released
1.105 -*/
1.106 -const TUid KUidConverterInfoFile={KUidConverterInfoFileValue};
1.107 -
1.108 -/**
1.109 -@internalComponent
1.110 -*/
1.111 -const TInt KUidConverterInfoStreamValue=0x10000CD0;
1.112 -
1.113 -/**
1.114 -@internalComponent
1.115 -*/
1.116 -const TUid KUidConverterInfoStream={KUidConverterInfoStreamValue};
1.117 -
1.118 -/**
1.119 -The UID2 of converter-type DLLs.
1.120 -@publishedAll
1.121 -@released
1.122 -*/
1.123 -const TUid KUidConverterDll16={0x10003A30};
1.124 -
1.125 -/**
1.126 -The extension of converter information files.
1.127 -@publishedAll
1.128 -@released
1.129 -*/
1.130 -_LIT(KConverterInfoFileExtension,".CNF");
1.131 -/**
1.132 -The extension of converter DLLs.
1.133 -@publishedAll
1.134 -@released
1.135 -*/
1.136 -_LIT(KConverterDllExtension,".CNV");
1.137 -
1.138 -
1.139 -class MConverterUiObserver
1.140 -/**
1.141 -Interface implemented by the client of a conversion operation to observe conversion
1.142 -progress.
1.143 -
1.144 -@see CConverterBase2
1.145 -@publishedAll
1.146 -@released
1.147 -*/
1.148 - {
1.149 -public:
1.150 - /** Describes the result of a conversion operation. */
1.151 - enum TResult
1.152 - {
1.153 - /** Conversion succeeded. */
1.154 - ESuccess,
1.155 - /** Conversion partially succeeded. */
1.156 - EPartialSuccess,
1.157 - /** Conversion failed. */
1.158 - EFailure
1.159 - };
1.160 - /** Describes the actions that the converter should take. */
1.161 - enum TAction
1.162 - {
1.163 - /** Keep already converted data. */
1.164 - ERetain,
1.165 - /** Delete converted data. */
1.166 - ERemove,
1.167 - /** Reconvert data. */
1.168 - ERepeat
1.169 - };
1.170 -public:
1.171 - /** Gets the maximum number of steps that the conversion operation can take.
1.172 -
1.173 - The conversion may complete in less than this number of steps (for example
1.174 - if an error occurs or the action is cancelled).
1.175 -
1.176 - Each step is a call to CConverterBase2::DoConvert(), although during synchronous
1.177 - conversions this is transparent to the client code.
1.178 -
1.179 - @param aMax Maximum number of conversion steps.
1.180 - @param aObject Index that identifies an embedded object when one is being converted. */
1.181 - virtual void MaxSteps(TInt aMax, TInt aObject)=0;
1.182 - /** Alerts the client to an error in conversion.
1.183 -
1.184 - @param aResult A TResult value indicating the conversion state.
1.185 - @param aObject Index that identifies an embedded object when one is being converted.
1.186 - @return A TAction value that indicates what action the converter should take. */
1.187 - virtual TInt Result(TInt aResult, TInt aObject)=0;
1.188 - /** Queries the client for a password in order to access the data.
1.189 -
1.190 - @param aClue Data with a meaning that is specific to each converter: it could for
1.191 - example indicate where the password is stored.
1.192 - @return The password entered. */
1.193 - virtual HBufC* QueryPasswordL(const TDesC& aClue)=0;
1.194 - IMPORT_C virtual void Reserved1_Conv_Obs();
1.195 - };
1.196 -
1.197 -
1.198 -class CConverterBase : public CBase
1.199 -/** For Ecom Style Converters i.e.,for v9.1 and above CConverterBase2 should be used.
1.200 -
1.201 -Polymorphic interface for converters from one data format to another.
1.202 -
1.203 -Clients use this interface to access data converters. The implementator of
1.204 -a data converter derives a class from this in which to implement the appropriate
1.205 -conversion functionality.
1.206 -
1.207 -The interface offers conversions between files, and between objects that support
1.208 -the stream interfaces, e.g. stream stores.
1.209 -
1.210 -There are two flavours of conversion methods:
1.211 -
1.212 -the synchronous interfaces, ConvertL() and ConvertObjectL(), which perform
1.213 -the specified conversion and then return
1.214 -
1.215 -the asynchronous interfaces, ConvertAL() and ConvertObjectAL(), which initialise
1.216 -the converter object, and allow the client code to call DoConvertL() a number
1.217 -of times until the conversion is complete or abandoned.
1.218 -
1.219 -@see CConverterBase2
1.220 -@publishedAll
1.221 -@released */
1.222 - {
1.223 -public:
1.224 - /** Bitmask values that describe the capabilities of the converter. */
1.225 - enum TCapability
1.226 - {
1.227 - /** The converter can convert files. */
1.228 - EConvertsFiles=0x01,
1.229 - /** The converter can convert stream objects. */
1.230 - EConvertsObjects=0x02,
1.231 - /** The converter can extract embedded objects. */
1.232 - EConvertsExtract=0x04
1.233 - };
1.234 -public:
1.235 - IMPORT_C virtual void ConvertL(const TFileName& aSourceFile, const TFileName& aTargetFile, MConverterUiObserver* aObserver=NULL); // These default to calling the async versions in a loop
1.236 - IMPORT_C virtual void ConvertObjectL(RReadStream& aReadStream, RWriteStream& aWriteStream, MConverterUiObserver* aObserver=NULL);
1.237 - IMPORT_C virtual void ConvertAL(const TFileName& aSourceFile, const TFileName& aTargetFile, MConverterUiObserver* aObserver=NULL); // these default to leaving with KErrNotSupported
1.238 - IMPORT_C virtual void ConvertObjectAL(RReadStream& aReadStream, RWriteStream& aWriteStream, MConverterUiObserver* aObserver=NULL); // these default to leaving with KErrNotSupported
1.239 - IMPORT_C virtual TBool DoConvertL(); // these default to leaving with KErrNotSupported
1.240 - /** Gets the converter's UID.
1.241 -
1.242 - @return Converter's UID */
1.243 - virtual TUid Uid() =0;
1.244 - IMPORT_C virtual TInt Capabilities(); // defaults to "everything"
1.245 - IMPORT_C virtual void CancelConvert(); // for any cleanup
1.246 - IMPORT_C virtual CConverterBase* EmbeddedObjectL(TDataType& aType);
1.247 - IMPORT_C virtual TBool GetEmbeddedFileName(TFileName& aFileName);
1.248 - IMPORT_C virtual void ExtendedInterfaceL(TUid aInterfaceUid, CBase*& aInterface);
1.249 - };
1.250 -
1.251 -
1.252 -class CConverterLibrary : public CBase
1.253 -/** A converter DLL's factory for individual CConverterBase-derived objects.
1.254 -
1.255 -The implementor of a converter DLL should implement this class.
1.256 -
1.257 -@publishedAll
1.258 -@deprecated */
1.259 - {
1.260 -public:
1.261 - /** Creates and returns an instance of the converter with the specified UID.
1.262 -
1.263 - This class should not allocate any resources that are not returned to the
1.264 - caller.
1.265 -
1.266 - @param aUid UID of the converter to create
1.267 - @return The specified converter. If the converter does not implement a converter
1.268 - associated with the UID, then it should return NULL. */
1.269 - virtual CConverterBase* Converter(TUid aUid)=0; // passes ownership
1.270 - };
1.271 -
1.272 -class CConverterBase2 : public CConverterBase
1.273 -/** Base Class for Ecom Style Converters
1.274 -The methods in CConverterBase2 are inherited from CConverterBase
1.275 -
1.276 -There are two flavours of conversion methods:
1.277 -
1.278 -the synchronous interfaces, ConvertL() and ConvertObjectL(), which perform
1.279 -the specified conversion and then return
1.280 -
1.281 -the asynchronous interfaces, ConvertAL() and ConvertObjectAL(), which initialise
1.282 -the converter object, and allow the client code to call DoConvertL() a number
1.283 -of times until the conversion is complete or abandoned.
1.284 -
1.285 -@publishedAll
1.286 -@released */
1.287 - {
1.288 -public:
1.289 - static CConverterBase2* CreateConverterL(TUid aImplUid);
1.290 - IMPORT_C virtual ~CConverterBase2();
1.291 - IMPORT_C virtual void ConvertL(const TFileName& aSourceFile, const TFileName& aTargetFile, MConverterUiObserver* aObserver=NULL); // These default to calling the async versions in a loop
1.292 - IMPORT_C virtual void ConvertObjectL(RReadStream& aReadStream, RWriteStream& aWriteStream, MConverterUiObserver* aObserver=NULL);
1.293 - IMPORT_C virtual void ConvertAL(const TFileName& aSourceFile, const TFileName& aTargetFile, MConverterUiObserver* aObserver=NULL); // these default to leaving with KErrNotSupported
1.294 - IMPORT_C virtual void ConvertObjectAL(RReadStream& aReadStream, RWriteStream& aWriteStream, MConverterUiObserver* aObserver=NULL); // these default to leaving with KErrNotSupported
1.295 - IMPORT_C virtual TBool DoConvertL(); // these default to leaving with KErrNotSupported
1.296 - virtual TUid Uid()=0;
1.297 - IMPORT_C virtual TInt Capabilities(); // defaults to "everything"
1.298 - IMPORT_C virtual void CancelConvert(); // for any cleanup
1.299 - IMPORT_C virtual CConverterBase* EmbeddedObjectL(TDataType& aType);
1.300 - IMPORT_C virtual TBool GetEmbeddedFileName(TFileName& aFileName);
1.301 - IMPORT_C virtual void ExtendedInterfaceL(TUid aInterfaceUid, CBase*& aInterface);
1.302 - IMPORT_C virtual void Reserved_1();
1.303 - IMPORT_C virtual void Reserved_2();
1.304 -private:
1.305 - TUid iDestructionKey;
1.306 - TInt iSpare;
1.307 - };
1.308 -#endif