![]() | InDesign SDK 20.5 |
#include <IImportProvider.h>

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 IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
IImportProvider is the main interface an import filter has to implement. Import filters provide import functionality from other formats to InDesign native formats.
Specifies importability
| pure virtual |
Returns whether the import provider can import the data in the given stream.
| stream | IN Data to import. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
Returns whether the import provider can import data of the given format type.
| formatType | IN Format type of the data to import. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| 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 '.'.
| formatIndex | IN Index of the format name whose n'th extension to return. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
For clipboard/drag and drop operations, returns the number of external flavors supported by the import provider.
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
Returns the number of Mac file types supported by the import provider.
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
Returns the number of file formats supported by the import provider. Examples of file format names are "TIFF" and "MS Word 97".
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
Returns the n'th file extension that corresponds to the n'th file format supported by the import provider.
| formatIndex | IN Index of the file format whose n'th extension to return. |
| extensionIndex | IN Index of the extension to return. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
For clipboard/drag and drop operations, returns the n'th external flavor supported by the import provider.
| n | IN Index of the external flavor to return. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
Returns the n'th Mac file type supported by the import provider.
| n | IN Index of the Mac file type to return. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
Returns the name (localized string) of the n'th file format supported by the import provider.
| formatIndex | IN Index of the format name to return. |
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| pure virtual |
For clipboard/drag and drop operations, returns the internal flavor the import provider can operate on.
Implemented in TxtImpFilter, CHMLFiltImportProvider, and XDocBkImportProvider.
| 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.
| db | IN Database where the objects are created. |
| stream | IN Data to import. |
| uiFlags | IN Flags denoting how to handle UI events. (see BaseType.h) |
| importedItem | OUT UIDRef of the newly created imported item. This may be a page item or a text story UID. |
| dataLink | IN 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 |
| asFormat | OUT 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.