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

#include <IImportProvider.h>

Inheritance diagram for IImportProvider:
IPMUnknownCPMUnknown< IImportProvider >CHMLFiltImportProviderTxtImpFilterXDocBkImportProvider

Public Types

enum  ImportAbility { kCannotImport, kPartialImport, kFullImport }
 

Public Member Functions

virtual int32 CountFileTypes ()=0
 
virtual SysOSType GetFileType (int32 n)=0
 
virtual PMFlavor GetInternalFlavor ()=0
 
virtual int32 CountExternalFlavors ()=0
 
virtual ExternalPMFlavor GetExternalFlavor (int32 n)=0
 
virtual int32 CountFormats ()=0
 
virtual PMString GetFormatName (int32 formatIndex)=0
 
virtual int32 CountExtensionsForFormat (int32 formatIndex)=0
 
virtual PMString GetExtensionForFormat (int32 formatIndex, int32 extensionIndex)=0
 
virtual ImportAbility CanImportThisType (IFormatType *formatType)=0
 
virtual ImportAbility CanImportThisStream (IPMStream *stream)=0
 
virtual void ImportThis (IDataBase *db, IPMStream *stream, UIFlags uiFlags, UIDRef *importedItem, UIDRef *dataLink=nil, PMString *asFormat=nil)=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

IImportProvider is the main interface an import filter has to implement. Import filters provide import functionality from other formats to InDesign native formats.

See Also
IImportManager

Member Enumeration Documentation

Specifies importability

Member Function Documentation

virtual ImportAbility IImportProvider::CanImportThisStream (IPMStreamstream)
pure virtual

Returns whether the import provider can import the data in the given stream.

Parameters
streamIN Data to import.
Returns
kCannotImport: if the data cannot be imported. kPartialImport: if the data is of a common type (i.e. TEXT on the Mac), or if the filter cannot determine with a high degree of certainty that the data is of a type it can support. kFullImport: if the filter can import the data, and it is of a proprietary or otherwise uncommon type.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual ImportAbility IImportProvider::CanImportThisType (IFormatTypeformatType)
pure virtual

Returns whether the import provider can import data of the given format type.

Parameters
formatTypeIN Format type of the data to import.
Returns
kCannotImport: if the format type cannot be imported. kPartialImport: if the format type is of a common file type (i.e. TEXT on the Mac), or if the filter cannot determine with a high degree of certainty that the type is one it can support. kFullImport: if the filter can import the format type, and it is a proprietary or otherwise uncommon type.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual int32 IImportProvider::CountExtensionsForFormat (int32 formatIndex)
pure virtual

Returns the number of extensions that correspond to the given file format supported by the import provider. On the Mac, file extensions are only used for import provider selection for files of type 'TEXT', ' ', 'BINA', or null. Examples of extensions are "DOC" and "TXT"; extensions do not include a preceeding period '.'.

Parameters
formatIndexIN Index of the format name whose n'th extension to return.
Returns
Number of extensions that correspond to the file format.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual int32 IImportProvider::CountExternalFlavors ()
pure virtual

For clipboard/drag and drop operations, returns the number of external flavors supported by the import provider.

Returns
Number of external flavors supported by the provider.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual int32 IImportProvider::CountFileTypes ()
pure virtual

Returns the number of Mac file types supported by the import provider.

Returns
Number of Mac file types supported by the provider.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual int32 IImportProvider::CountFormats ()
pure virtual

Returns the number of file formats supported by the import provider. Examples of file format names are "TIFF" and "MS Word 97".

Returns
Number of file formats supported by the provider.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual PMString IImportProvider::GetExtensionForFormat (int32 formatIndex,
int32 extensionIndex 
)
pure virtual

Returns the n'th file extension that corresponds to the n'th file format supported by the import provider.

Parameters
formatIndexIN Index of the file format whose n'th extension to return.
extensionIndexIN Index of the extension to return.
Returns
The n'th extension that corresponds to the file format.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual ExternalPMFlavor IImportProvider::GetExternalFlavor (int32 n)
pure virtual

For clipboard/drag and drop operations, returns the n'th external flavor supported by the import provider.

Parameters
nIN Index of the external flavor to return.
Returns
N'th external flavor supported by the provider.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual SysOSType IImportProvider::GetFileType (int32 n)
pure virtual

Returns the n'th Mac file type supported by the import provider.

Parameters
nIN Index of the Mac file type to return.
Returns
N'th Mac file type supported by the provider.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual PMString IImportProvider::GetFormatName (int32 formatIndex)
pure virtual

Returns the name (localized string) of the n'th file format supported by the import provider.

Parameters
formatIndexIN Index of the format name to return.
Returns
Name of the n'th format supported by the provider.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual PMFlavor IImportProvider::GetInternalFlavor ()
pure virtual

For clipboard/drag and drop operations, returns the internal flavor the import provider can operate on.

Returns
Internal flavor the provider can operate on.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.

virtual void IImportProvider::ImportThis (IDataBasedb,
IPMStreamstream,
UIFlags uiFlags,
UIDRefimportedItem,
UIDRefdataLink = nil,
PMStringasFormat = nil 
)
pure virtual

Imports the the data in the given stream. This method is the main entry point of the import provider. Note: If the import fails, the global error code must be set, giving the reason why the import failed. To cancel an import, set the global error code to kCancel.

Parameters
dbIN Database where the objects are created.
streamIN Data to import.
uiFlagsIN Flags denoting how to handle UI events. (see BaseType.h)
importedItemOUT UIDRef of the newly created imported item. This may be a page item or a text story UID.
dataLinkIN When updating this will contain the original page item UID. Providers should get their import preferences from this page item. If the preferences are not available on this page item, use the default preferences
asFormatOUT Optional return parameter of the format just imported. This string is displayed in the link information dialog. If the string is not filled in, the method GetFormatName(0) is used to get the format name.

Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.