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

#include <IExportProvider.h>

Inheritance diagram for IExportProvider:
IPMUnknownCPMUnknown< IExportProvider >CExportProviderCHMLFiltExportProviderCInCopyStoryExportSuiteTxtExpFilterXDocBkExportProvider

Public Types

enum  { kDefaultIID = IID_IEXPORTPROVIDER }
 

Public Member Functions

Export
virtual void ExportToFile (const IDFile &sysFile, IDocument *doc, IPMUnknown *targetboss, const PMString &formatName, UIFlags uiFlags=kFullUI)=0
 
virtual void ExportToStream (IPMStream *stream, IDocument *doc, IPMUnknown *targetboss, const PMString &formatName, UIFlags uiFlags=kFullUI)=0
 
virtual bool16 CanExportToFile () const =0
 
virtual bool16 CanExportThisFormat (IDocument *doc, IPMUnknown *targetboss, const PMString &formatName)=0
 
virtual TaskInfo AsynchronousExportToFile (const IDFile &sysFile, IDocument *doc, IPMUnknown *targetboss, const PMString &formatName, UIFlags uiFlags=kFullUI)=0
 
virtual bool16 CanExportToFileAsynchronously () const =0
 
Clipboard/DragDrop Export
virtual bool16 CanExportForExternalize () const =0
 
virtual PMFlavor GetInternalFlavor () const =0
 
virtual int32 CountExternalFlavors () const =0
 
virtual ExternalPMFlavor GetExternalFlavor (int32 n) const =0
 
virtual bool16 CanExportThisFlavor (const ExternalPMFlavor &flavor, PMString &outFormatName) const =0
 
virtual ErrorCode ExportForExternalize (IDataExchangeHandler *handler, const ExternalPMFlavor toWhichFlavor, IPMStream *stream)=0
 
Internal File Based Formats
virtual int32 CountFormats ()=0
 
virtual PMString GetNthFormatName (int32 n)=0
 
virtual PMString GetExtensionForFormatName (const PMString &formatName)=0
 
virtual ScriptID GetScriptIDForFormatName (const PMString &formatName, const ScriptInfo::RequestContext &context)=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

IExportProvider is the main interface an export filter has to implement. Export filters provide export functionality from InDesign native formats to some other format(s).

See Also
IExportManager

Member Function Documentation

virtual TaskInfo IExportProvider::AsynchronousExportToFile (const IDFilesysFile,
IDocumentdoc,
IPMUnknowntargetboss,
const PMStringformatName,
UIFlags uiFlags = kFullUI 
)
pure virtual

Exports the current selection asynchronously to the given file, which must have a valid path. The provider will generate the specified file format. \ The calling code must verify that the given file does not exist and that no running exports \ are targeting the same file.

The asynchronous nature of this call means that operations that rely on the outcome of the export can no longer happen right after the call. Instead these operations should be moved into a signal responder that responds to two signals:

kAfterExportSignalResponderService    (signaled on kSuccess)

kFailedExportSignalResponderService   (signaled on any other error code)

Note: Some export providers may use the task monitor for UI and may export more than just the \ current selection (i.e. PDF export, EPS export, etc.)

Parameters
sysFileIN File to export to.
docIN Document we're exporting from.
targetbossIN Target boss.
formatNameIN Name of the format we're exporting.
uiFlagsIN UI flags denoting how to handle UI events. (see BaseType.h) \ FullUI means that progress and alert UI events will be handled \ by the task monitor.
Returns
TaskInfo representing the export task. The caller must not use the destination file\ until TI.GetCurrentState() == TaskInfo::kCompleted. (where TI is the TaskInfo)

Implemented in CExportProvider.

virtual bool16 IExportProvider::CanExportForExternalize () const
pure virtual

The provider indicates whether it can export to the clipboard.

Returns
kTrue if the provider supports exporting to the clipboard, else kFalse.

Implemented in TxtExpFilter, CInCopyStoryExportSuite, CHMLFiltExportProvider, XDocBkExportProvider, and CExportProvider.

virtual bool16 IExportProvider::CanExportThisFlavor (const ExternalPMFlavor & flavor,
PMStringoutFormatName 
) const
pure virtual

For Clip/Drag operations, what format type, if any, would the provider use to produce the desired external flavor.

Parameters
flavorIN External flavor to export.
outFormatNameOUT Format type the provider would export for the given external flavor.
Returns
kTrue if the provider can export the external flavor, else kFalse.

Implemented in TxtExpFilter, CInCopyStoryExportSuite, CHMLFiltExportProvider, XDocBkExportProvider, and CExportProvider.

virtual bool16 IExportProvider::CanExportThisFormat (IDocumentdoc,
IPMUnknowntargetboss,
const PMStringformatName 
)
pure virtual

The export provider indicates whether it can export the current selection in the specified file format (i.e. a text export file would return kFalse for a page item selection and kTrue for a text selection).

Parameters
docIN Document we're exporting from.
targetbossIN Target boss.
formatNameIN Name of the format we're exporting.
Returns
kTrue if the provider supports exporting in the current context, else kFalse.

Implemented in TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, and CInCopyStoryExportSuite.

virtual bool16 IExportProvider::CanExportToFile () const
pure virtual

The provider indicates whether it can perform exports to a file.

Returns
kTrue if the provider can export to a file, else false.

Implemented in TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, CInCopyStoryExportSuite, and CExportProvider.

virtual bool16 IExportProvider::CanExportToFileAsynchronously () const
pure virtual

The provider indicates whether it can perform asynchronous exports to a file.

Returns
kTrue if the provider can export asynchronously to a file, else false.

Implemented in CExportProvider.

virtual int32 IExportProvider::CountExternalFlavors () const
pure virtual

For Clip/Drag operations, returns the number of external flavors the provider can export to.

Returns
Number of external flavors the provider can export to.

Implemented in TxtExpFilter, CInCopyStoryExportSuite, CHMLFiltExportProvider, XDocBkExportProvider, and CExportProvider.

virtual int32 IExportProvider::CountFormats ()
pure virtual

Returns the number of file formats supported by this export provider.

Returns
Number of file formats supported.

Implemented in TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, and CInCopyStoryExportSuite.

virtual ErrorCode IExportProvider::ExportForExternalize (IDataExchangeHandlerhandler,
const ExternalPMFlavor toWhichFlavor,
IPMStreamstream 
)
pure virtual

Externalize the given data to a stream.

Parameters
handlerIN Handler to use to exchange the data.
toWhichFlavorIN External flavor to export.
streamIN Stream to export to.
Returns
kSuccess if the export succeeds, else an error code.

Implemented in CInCopyStoryExportSuite, TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, and CExportProvider.

virtual void IExportProvider::ExportToFile (const IDFilesysFile,
IDocumentdoc,
IPMUnknowntargetboss,
const PMStringformatName,
UIFlags uiFlags = kFullUI 
)
pure virtual

Exports the current selection to the given file, which must have a valid path. The provider will generate the specified file format. \ The calling code must verify that the given file does not exist. \ Note: Some export providers may display UI and may export more than just the current selection (i.e. PDF export, EPS export, etc.)

Parameters
sysFileIN File to export to.
docIN Document we're exporting from.
targetbossIN Target boss.
formatNameIN Name of the format we're exporting.
uiFlagsIN UI flags denoting how to handle UI events. (see BaseType.h)

Implemented in CInCopyStoryExportSuite, TxtExpFilter, XDocBkExportProvider, CHMLFiltExportProvider, and CExportProvider.

virtual void IExportProvider::ExportToStream (IPMStreamstream,
IDocumentdoc,
IPMUnknowntargetboss,
const PMStringformatName,
UIFlags uiFlags = kFullUI 
)
pure virtual

Exports the current selection to the given stream. The provider will generate the specified file format. \ Note: Some export providers may display UI and may export more than just the current selection (i.e. PDF export, EPS export, etc.).

Parameters
streamIN Streaam to export to.
docIN Document we're exporting from.
targetbossIN Target boss.
formatNameIN Name of the format we're exporting.
uiFlagsIN UI flags denoting how to handle UI events. (see BaseType.h)

Implemented in CInCopyStoryExportSuite, TxtExpFilter, CHMLFiltExportProvider, and XDocBkExportProvider.

virtual PMString IExportProvider::GetExtensionForFormatName (const PMStringformatName)
pure virtual

Returns the preferred file extension of the format name.

Parameters
formatNameIN Format name whose preferred file extension to return.
Returns
Preferred file extension of the format name.

Implemented in TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, and CInCopyStoryExportSuite.

virtual ExternalPMFlavor IExportProvider::GetExternalFlavor (int32 n) const
pure virtual

For Clip/Drag operations, returns the n'th flavor the provider can export to.

Parameters
nIN Index of the external flavor to return.
Returns
N'th external flavor the provider can export to.

Implemented in TxtExpFilter, CInCopyStoryExportSuite, CHMLFiltExportProvider, XDocBkExportProvider, and CExportProvider.

virtual PMFlavor IExportProvider::GetInternalFlavor () const
pure virtual

For Clip/Drag operations, returns the internal flavor the provider can operate on.

Returns
Internal flavor the provider can operate on.

Implemented in TxtExpFilter, CInCopyStoryExportSuite, CHMLFiltExportProvider, XDocBkExportProvider, and CExportProvider.

virtual PMString IExportProvider::GetNthFormatName (int32 n)
pure virtual

Returns the name (non-localized string) of the n'th file format supported by this export provider.

Parameters
nIN Index of the format name to return.
Returns
Name of the n'th format.

Implemented in TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, and CInCopyStoryExportSuite.

virtual ScriptID IExportProvider::GetScriptIDForFormatName (const PMStringformatName,
const ScriptInfo::RequestContextcontext 
)
pure virtual

Returns the ScriptID for the given format's enumerator in the kExportFormatEnumScriptElement

Parameters
formatNameIN Format name whose ScriptID to return
contextis the scripting request context
Returns
the ScriptID (or kInvalidScriptID if this format is not supported by enum)

Implemented in TxtExpFilter, CHMLFiltExportProvider, XDocBkExportProvider, and CInCopyStoryExportSuite.