InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
XDocBkImportProvider Class Reference
Inheritance diagram for XDocBkImportProvider:
CPMUnknown< IImportProvider >IImportProviderIPMUnknown

Public Member Functions

 XDocBkImportProvider (IPMUnknown *boss)
 
virtual ~XDocBkImportProvider ()
 
virtual int32 CountFileTypes (void)
 
virtual SysOSType GetFileType (int32 n)
 
virtual int32 CountFormats (void)
 
virtual PMString GetFormatName (int32 formatIndex)
 
virtual int32 CountExtensionsForFormat (int32 formatIndex)
 
virtual PMString GetExtensionForFormat (int32 formatIndex, int32 extensionIndex)
 
virtual ImportAbility CanImportThisType (IFormatType *formatType)
 
virtual ImportAbility CanImportThisStream (IPMStream *stream)
 
virtual void ImportThis (IDataBase *db, IPMStream *stream, UIFlags uiFlags, UIDRef *importedItem, UIDRef *pDataLinkUIDRef=nil, PMString *asFormat=nil)
 
virtual PMFlavor GetInternalFlavor (void)
 
virtual int32 CountExternalFlavors (void)
 
virtual ExternalPMFlavor GetExternalFlavor (int32 n)
 
- Public Member Functions inherited from CPMUnknown< IImportProvider >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Additional Inherited Members

- Public Types inherited from IImportProvider
enum  ImportAbility { kCannotImport, kPartialImport, kFullImport }
 
- Protected Member Functions inherited from CPMUnknown< IImportProvider >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< IImportProvider >
HelperInterface fHelperInterface
 

Detailed Description

Implements IImportProvider; opens a template to create a new document and imports XML into this new document.

Constructor & Destructor Documentation

Binds the C implementation class onto its ImplementationID making the C code callable by the application * XDocBkImportProvider::XDocBkImportProvider (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.
virtual XDocBkImportProvider::~XDocBkImportProvider ()
inlinevirtual

Destructor

Member Function Documentation

IImportProvider::ImportAbility XDocBkImportProvider::CanImportThisStream (IPMStreamstream)
virtual

Indicates whether the import provider can import the given stream. In this method, we also check for the file extension, and on the Macintosh, we check for the file type as well. There are three possible results:

  • IImportProvider::kFullImport: The filter can import this format.
  • IImportProvider::kPartialImport: The filter can import this file, but there may be a better match, only use this filter if no other returns kFullImport
  • IImportProvider::kCannotImport: This filter does not import this format.
    See Also
    IImportProvider::CanImportThisStream
    Parameters
    streamThe stream to test.
    Returns
    Whether or not this import provider could import this stream.

Implements IImportProvider.

IImportProvider::ImportAbility XDocBkImportProvider::CanImportThisType (IFormatTypeformatType)
virtual

Indicates whether the import provider can import the given file type (Mac only). There are three possible results -

  • IImportProvider::kFullImport: The filter can import this format.
  • IImportProvider::kPartialImport: The filter can import this file, but there may be a better match, only use this filter if no other returns kFullImport
  • IImportProvider::kCannotImport: This filter does not import this format.
    See Also
    IImportProvider::CanImportThisType
    Parameters
    formatTypeThe format type to test.
    Returns
    Whether or not this import provider could import this type.

Implements IImportProvider.

int32 XDocBkImportProvider::CountExtensionsForFormat (int32 formatIndex)
virtual

Get the number of extensions that correspond to each file format supported by the import provider. An example extension would be "DOC" or "TXT". On the Mac, file extensions are only used for import provider selection for file of type 'TEXT', ' ', 'BINA', or null. Note the file extensions do not include a preceeding period '.'

See Also
IImportProvider::CountExtensionsForFormat
Parameters
formatIndexMust be between 0 and CountFormats().
Returns
The number of extensions supported by this import provider.

Implements IImportProvider.

int32 XDocBkImportProvider::CountExternalFlavors (void )
virtual

Gets the number of external flavors supported by import provider. (Flavors are used by clipboard/drag and drop)

See Also
IImportProvider::CountInternalFlavors

Implements IImportProvider.

int32 XDocBkImportProvider::CountFileTypes (void )
virtual

Get the number of filetypes supported by the import provider. (File types are Mac-specific.)

See Also
IImportProvider::CountFileTypes

Implements IImportProvider.

int32 XDocBkImportProvider::CountFormats (void )
virtual

Get the number of file formats supported by the import provider. An example file format name would be "TIFF" or "MS Word 97".

See Also
IImportProvider::CountFormats

Implements IImportProvider.

PMString XDocBkImportProvider::GetExtensionForFormat (int32 formatIndex,
int32 extensionIndex 
)
virtual

Get the Nth extension that corresponds to the provided format (index).

See Also
IImportProvider::GetExtensionForFormat
Parameters
formatIndexMust be between 0 and CountFormats().
extensionIndexMust be between 0 and CountExtensionsForFormat().
Returns
The extension for the specified format.

Implements IImportProvider.

ExternalPMFlavor XDocBkImportProvider::GetExternalFlavor (int32 n)
virtual

Gets the Nth external flavor supported by import provider. (Flavors are used by clipboard/drag and drop)

See Also
IImportProvider::GetExternalFlavor

Implements IImportProvider.

SysOSType XDocBkImportProvider::GetFileType (int32 n)
virtual

Get the Nth filetype supported by the import provider.

See Also
IImportProvider::GetFileType
Parameters
nIN The index. Must be greater than 0, less than CountFileTypes().
Returns
The Nth filetype.

Implements IImportProvider.

PMString XDocBkImportProvider::GetFormatName (int32 formatIndex)
virtual

Get the Nth file format supported by the import provider.

See Also
IImportProvider::GetFormatName
Parameters
nThe index. Must be greater than 0, less than CountFormats().
Returns
The Nth formatname, as a PMString.

Implements IImportProvider.

PMFlavor XDocBkImportProvider::GetInternalFlavor (void )
virtual

Gets internal flavor supported by import provider. (Flavors are used by clipboard/drag and drop)

See Also
IImportProvider::GetInternalFlavor

Implements IImportProvider.

void XDocBkImportProvider::ImportThis (IDataBasedb,
IPMStreamstream,
UIFlags uiFlags,
UIDRefimportedItem,
UIDRefpDataLinkUIDRef = nil,
PMStringasFormat = nil 
)
virtual

This method is the main entry point of the import provider and does most of the work.

See Also
IImportProvider::ImportThis
Parameters
dbThe database where the objects are created.
streamThe data to be imported.
uiFlagsFlags to indicate whether the import provider to display or suppress it's user interface
pDataLinkUIDRefOptional. 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.
asFormatOptional. 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.
importedItemReturns a UIDRef of the newly created imported item. This may be a page item or a text story UID.

Implements IImportProvider.