|
||
class CConverterBase : public CBase;
For Ecom Style Converters i.e.,for v9.1 and above CConverterBase2
should be used.
Polymorphic interface for converters from one data format to another.
Clients use this interface to access data converters. The implementator of a data converter derives a class from this in which to implement the appropriate conversion functionality.
The interface offers conversions between files, and between objects that support the stream interfaces, e.g. stream stores.
There are two flavours of conversion methods:
the synchronous interfaces, CConverterBase::ConvertL(const TFileName &,const TFileName &,MConverterUiObserver *)
and CConverterBase::ConvertObjectL(RReadStream &,RWriteStream &,MConverterUiObserver *)
, which perform the specified conversion and then return
the asynchronous interfaces, CConverterBase::ConvertAL(const TFileName &,const TFileName &,MConverterUiObserver *)
and CConverterBase::ConvertObjectAL(RReadStream &,RWriteStream &,MConverterUiObserver *)
, which initialise the converter object, and allow the client code to call CConverterBase::DoConvertL()
a number of times until the conversion is complete or abandoned.
CBase
-
Base class for all classes to be instantiated on the heap.
CConverterBase
- For Ecom Style Converters i.e.,for v9.1 and above CConverterBase2 should be used...
Defined in CConverterBase
:
CancelConvert()
Cleans up a conversion that has been prepared or is in progress.Capabilities()
Gets the converter's capabilities.ConvertAL(const TFileName &,const TFileName &,MConverterUiObserver *)
Prepares for conversion in multiple steps of a file.ConvertL(const TFileName &,const TFileName &,MConverterUiObserver *)
Converts a file in a single step.ConvertObjectAL(RReadStream &,RWriteStream &,MConverterUiObserver *)
Prepares for conversion in multiple steps of a stream object.ConvertObjectL(RReadStream &,RWriteStream &,MConverterUiObserver *)
Converts a stream object in a single step.DoConvertL()
Performs a step in converting the data.EConvertsExtract
The converter can extract embedded objects. EConvertsFiles
The converter can convert files. EConvertsObjects
The converter can convert stream objects. EmbeddedObjectL(TDataType &)
Gets a converter for an embedded object of the specified type.ExtendedInterfaceL(TUid,CBase *&)
Allows licensees to extend the Converter Architecture API.GetEmbeddedFileName(TFileName &)
Gets a filename embedded in the object.TCapability
Bitmask values that describe the capabilities of the converter. Uid()
Gets the converter's UID.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...CConverterBase2
Base Class for Ecom Style Converters The methods in CConverterBase2 are inherite...IMPORT_C virtual void ConvertL(const TFileName &aSourceFile, const TFileName &aTargetFile, MConverterUiObserver *aObserver=0);
Converts a file in a single step.
The caller can supply a MConverterUiObserver
to be informed of progress in the conversion.
The default implementation calls CConverterBase::ConvertAL(const TFileName &,const TFileName &,MConverterUiObserver *)
to prepare the object to perform the conversion, and then calls CConverterBase::DoConvertL()
in a loop until conversion is complete.
|
|
IMPORT_C virtual void ConvertObjectL(RReadStream &aReadStream, RWriteStream &aWriteStream, MConverterUiObserver *aObserver=0);
Converts a stream object in a single step.
The caller can supply a MConverterUiObserver
to be informed of progress in the conversion.
The default implementation calls CConverterBase::ConvertObjectAL(RReadStream &,RWriteStream &,MConverterUiObserver *)
to prepare the object to perform the conversion, and then calls CConverterBase::DoConvertL()
in a loop until conversion is complete.
|
IMPORT_C virtual void ConvertAL(const TFileName &aSourceFile, const TFileName &aTargetFile, MConverterUiObserver *aObserver=0);
Prepares for conversion in multiple steps of a file.
Clients must call this function before calling CConverterBase::DoConvertL()
one or more times to do the conversion. The function can call back the MaxSteps() function of the supplied MConverterUiObserver
to tell the client the maximum number of calls to CConverterBase::DoConvertL()
that will be required.
The rest of this description describes how to implement this function.
The function should initialise the object before performing a conversion, but should not do the conversion itself. Such initialisation should include:
storing the MConverterUiObserver
pointer (if supplied), so the client can later be notified of conversion progress
validating the integrity of the input data
optionally, creating the appropriate application engine, either for input or output, to enable access to the data
determining the number of steps (i.e. calls to CConverterBase::DoConvertL()
) required to perform the conversion and pass this to the client by calling MConverterUiObserver::MaxSteps(TInt,TInt)
The default implementation leaves with KErrNotSupported.
|
|
IMPORT_C virtual void ConvertObjectAL(RReadStream &aReadStream, RWriteStream &aWriteStream, MConverterUiObserver *aObserver=0);
Prepares for conversion in multiple steps of a stream object.
Clients must call this function before calling CConverterBase::DoConvertL()
one or more times to do the conversion. The function can call back the MaxSteps() function of the supplied MConverterUiObserver
to tell the client the maximum number of calls to CConverterBase::DoConvertL()
that will be required.
For a description of how to implement this function, see CConverterBase::ConvertAL(const TFileName &,const TFileName &,MConverterUiObserver *)
.
|
|
IMPORT_C virtual TBool DoConvertL();
Performs a step in converting the data.
The function advances a step in converting the data each time that it is called. When conversion is complete, the function returns EFalse.
|
IMPORT_C virtual TInt Capabilities();
Gets the converter's capabilities.
The default is to return a bitmask of all the TCapability flags.
|
IMPORT_C virtual void CancelConvert();
Cleans up a conversion that has been prepared or is in progress.
It should free any resources and reset the converter object to an initial state.
The default is to do nothing.
IMPORT_C virtual CConverterBase* EmbeddedObjectL(TDataType &aType);
Gets a converter for an embedded object of the specified type.
The default is to return NULL.
|
|
IMPORT_C virtual TBool GetEmbeddedFileName(TFileName &aFileName);
Gets a filename embedded in the object.
|
|
IMPORT_C virtual void ExtendedInterfaceL(TUid aInterfaceUid, CBase *&aInterface);
Allows licensees to extend the Converter Architecture API.
This function replaces the private Reserved_1() function, so the change is binary compatible with v7.0.
If overridden by the converter, it allows third party code to request the extended interface object by UID. If not overridden, the default implementation does nothing.
|
TCapability
Bitmask values that describe the capabilities of the converter.
|