InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IConversionMgr Class Referenceabstract

#include <IConversionMgr.h>

Inheritance diagram for IConversionMgr:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICONVERSIONMGR }
 
enum  ConversionStatus { kUnknownConvert, kDontConvert, kMustConvert, kCantConvert }
 

Public Member Functions

virtual ConversionStatus GetStatus (IContentMgr *contentMgr)=0
 
virtual void GetRemovedPlugins (K2Vector< PluginID > &list)=0
 
virtual void GetIgnoredPlugins (K2Vector< PluginID > &list)=0
 
virtual void ConvertDocument (IDataBase *dbToConvert)=0
 
virtual void Open (IContentMgr *contentMgr)=0
 
virtual void Close ()=0
 
virtual ClassID ConvertClass (ClassID inClass, ImplementationID parentContext, IPMStream *inStream, IPMStream *outStream, int32 length)=0
 
virtual bool16 CopyClassData (ClassID inClass, const VersionID &version, bool16 isEmbedded, uint32 inLength, IPMStream *inStream, IPMStream *outStream)=0
 
virtual ImplementationID ConvertTag (ImplementationID inTag, ClassID parentContext, IPMStream *inStream, IPMStream *outStream, int32 length)=0
 
virtual bool16 CopyTagData (ImplementationID inImpl, const VersionID &version, uint32 inLength, IPMStream *inStream, IPMStream *outStream)=0
 
virtual IDataBaseGetConvertingDataBase ()=0
 
virtual UID GetConvertingUID ()=0
 
virtual int32 CountConversionFailures ()=0
 
virtual PluginID GetNthFailedConversion (int32 n)=0
 
virtual PluginID GetSourcePluginIDForClass (ClassID id)=0
 
virtual PluginID GetSourcePluginIDForImplementation (ImplementationID id)=0
 
virtual bool16 GetSourcePluginFormatNumber (PluginID plugin, FormatID &format) const =0
 
virtual bool16 ReadSourceData (UID uid, ImplementationID implID, const FormatID &format, IPMStream *outStream)=0
 
virtual PluginID GetTargetPluginIDForClass (ClassID id)=0
 
virtual PluginID GetTargetPluginIDForImplementation (ImplementationID id)=0
 
virtual bool16 GetTargetPluginFormatNumber (PluginID plugin, FormatID &format)=0
 
virtual void RemoveClass (ClassID clsID)=0
 
virtual void RemoveImplementation (ImplementationID implID)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

IConversionMgr is the key interface in the binary database conversion process. Although it is public, you are unlikely to need to call it directly. Conversion is a complex process. The methods in this interface must be called in a particular context and in a particular order. Caution is advised.

Member Enumeration Documentation

Values returned by GetStatus()
Enumerator
kUnknownConvert 

Conversion not yet initialized

kDontConvert 

Conversion is not necessary

kMustConvert 

Conversion is necessary: call ConvertDocument

kCantConvert 

Conversion is not possible (converters are missing)

Member Function Documentation

virtual void IConversionMgr::Close ()
pure virtual

Close the conversion session. Call this to complete a conversion session.

virtual ClassID IConversionMgr::ConvertClass (ClassID inClass,
ImplementationID parentContext,
IPMStreaminStream,
IPMStreamoutStream,
int32 length 
)
pure virtual

ConvertClass converts from the original format in the document to the current running format. No conversion is performed if the classID does not need conversion.

Parameters
inClassIN ClassID of the data in the stream
parentContextIN Containing context, or kInvalidImpl if it is in a UID
inStreamIN Stream containing data to be converted
outStreamIN Converted data is streamed out here
lengthIN Number of bytes of incoming data
Returns
The converted ClassID. Usually this is the same as inClass, but may be a different ClassID if inClass has been renumbered, or kInvalidClass if the class should be deleted.
virtual void IConversionMgr::ConvertDocument (IDataBasedbToConvert)
pure virtual

Performs any neccessary conversion from the existing database format to the most recent format.

Parameters
dbToConvertIN A pointer to the database to be converted.
virtual ImplementationID IConversionMgr::ConvertTag (ImplementationID inTag,
ClassID parentContext,
IPMStreaminStream,
IPMStreamoutStream,
int32 length 
)
pure virtual

ConvertTag converts from the original format in the document to the current running format. No conversion is performed if the ImplementationID does not need conversion.

Parameters
inTagIN ImplementationID of the data in the stream
parentContextIN Containing context
inStreamIN Stream containing data to be converted
outStreamIN Converted data is streamed out here
lengthIN Number of bytes of incoming data
Returns
The converted ImplementationID. Usually this is the same as inTag, but may be a different ImplementationID if inTag has been renumbered, or kInvalidImpl if the implementation should be deleted.
virtual bool16 IConversionMgr::CopyClassData (ClassID inClass,
const VersionIDversion,
bool16 isEmbedded,
uint32 inLength,
IPMStreaminStream,
IPMStreamoutStream 
)
pure virtual

Copies a Class' data from the input to the output stream, converting embedded objects, if necessary.

Parameters
inClassIN ClassID of the data in the stream
versionIN Version of the data
isEmbeddedIN kTrue if this data is embedded inside of another object
inLengthIN Number of bytes of incoming data
inStreamIN Stream containing data to be copied
outStreamIN Data is copied here
Returns
kTrue if the copy operation required the use of a Content Iterator, kFalse if not.
virtual bool16 IConversionMgr::CopyTagData (ImplementationID inImpl,
const VersionIDversion,
uint32 inLength,
IPMStreaminStream,
IPMStreamoutStream 
)
pure virtual

Copies an Implementation's data from the input to the output stream, converting embedded objects, if necessary.

Parameters
inImplIN ImplementationID of the data in the stream
versionIN Version of the data
inLengthIN Number of bytes of incoming data
inStreamIN Stream containing data to be copied
outStreamIN Data is copied here
Returns
kTrue if the copy operation required the use of a Content Iterator, kFalse if not.
virtual int32 IConversionMgr::CountConversionFailures ()
pure virtual

Get the number of plugins that can't be converted.

Returns
The count
virtual IDataBase* IConversionMgr::GetConvertingDataBase ()
pure virtual

Gets a pointer to the database that is currently being converted, or nil if there is no conversion session active.

Returns
The database, or nil
virtual UID IConversionMgr::GetConvertingUID ()
pure virtual

Gets the UID of the object currently being converted, or kInvalidUID. Note that this will return the enclosing UID even if the object currently being converted is an embedded object inside a UID.

Returns
The UID or kInvalidUID
virtual void IConversionMgr::GetIgnoredPlugins (K2Vector< PluginID > & list)
pure virtual

This method must be called after GetStatus. It returns a list of plugins that would have their priority reset to "Ignore" by the conversion if ConvertDocument is called.

Parameters
listOUT A list of the IDs of plugins that would be ignored.
virtual PluginID IConversionMgr::GetNthFailedConversion (int32 n)
pure virtual

Get the n-th plugin that can't be converted.

Parameters
nIN Which plugin
Returns
The plugin ID, or kInvalidPlugin if n is invalid
virtual void IConversionMgr::GetRemovedPlugins (K2Vector< PluginID > & list)
pure virtual

This method must be called after GetStatus. It returns a list of plugins that would be removed by the conversion if ConvertDocument is called.

Parameters
listOUT A list of the IDs of plugins that would be removed.
virtual bool16 IConversionMgr::GetSourcePluginFormatNumber (PluginID plugin,
FormatIDformat 
) const
pure virtual

Get the source format number for a particular plugin.

Parameters
pluginIN The plugin
formatOUT The source format number
Returns
kTrue if the plugin was in the source document, kFalse if not.
virtual PluginID IConversionMgr::GetSourcePluginIDForClass (ClassID id)
pure virtual

Determine which plugin supplied a particular class in the source document.

Parameters
idIN The class ID
Returns
The plugin ID, or kInvalidPlugin if the class was not in the source document
virtual PluginID IConversionMgr::GetSourcePluginIDForImplementation (ImplementationID id)
pure virtual

Determine which plugin supplied a particular implementation in the source document.

Parameters
idIN The implementation ID
Returns
The plugin ID, or kInvalidPlugin if the implementation was not in the source document
virtual ConversionStatus IConversionMgr::GetStatus (IContentMgrcontentMgr)
pure virtual

This method is used to determine whether conversion is necessary and possible. Each plug-in's source format number can be found in the document's Content Manager.

Parameters
contentMgrIN The Content Manager associated with the database to be checked.
Returns
An enum value that indicates whether the database should be (and can be) converted
See Also
IContentMgr
virtual bool16 IConversionMgr::GetTargetPluginFormatNumber (PluginID plugin,
FormatIDformat 
)
pure virtual

Get the target format number for a particular plugin.

Parameters
pluginIN The plugin
formatOUT The target format number
Returns
kTrue if the plugin will bein the target document, kFalse if not.
virtual PluginID IConversionMgr::GetTargetPluginIDForClass (ClassID id)
pure virtual

Determine which plugin will supply a particular class in the target document.

Parameters
idIN The class ID
Returns
The plugin ID, or kInvalidPlugin if the class will not be in the target document
virtual PluginID IConversionMgr::GetTargetPluginIDForImplementation (ImplementationID id)
pure virtual

Determine which plugin will supply a particular implementation in the target document.

Parameters
idIN The implementation ID
Returns
The plugin ID, or kInvalidPlugin if the implementation will not be in the target document
virtual void IConversionMgr::Open (IContentMgrcontentMgr)
pure virtual

Open a session on the conversion manager. Compiles information about what data needs to be converted.

Parameters
contentMgrIN The Content Manager associated with the database to be checked.
virtual bool16 IConversionMgr::ReadSourceData (UID uid,
ImplementationID implID,
const FormatIDformat,
IPMStreamoutStream 
)
pure virtual

Fill a stream with an object's data as it existed prior to the start of conversion.

Parameters
uidIN The object's UID
implIDIN Which implementation
formatIN Which format
outStreamIN The stream that will receive the data
Returns
kTrue if successful, kFalse if the object/instance isn't found, or conversion to the desired format number is not possible
virtual void IConversionMgr::RemoveClass (ClassID clsID)
pure virtual

Notify the Conversion Manager that a Class has been completely removed from the database during Phase Two conversion. NOTE: Removal is normally done during Phase One conversion. This method is for unusual circumstances.

Parameters
clsIDIN The class that was removed
virtual void IConversionMgr::RemoveImplementation (ImplementationID implID)
pure virtual

Notify the Conversion Manager that an Implementation has been completely removed from the database during Phase Two conversion. NOTE: Removal is normally done during Phase One conversion. This method is for unusual circumstances.

Parameters
implIDIN The implementation that was removed