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

Public Member Functions

 TxtImpFilter (IPMUnknown *boss)
 
virtual ~TxtImpFilter (void)
 
virtual int32 CountFileTypes (void)
 
virtual SysOSType GetFileType (int32 n)
 
virtual int32 CountFormats ()
 
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 *dataLink=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 an import provider (Place provider, invoked from the File >> Place menu), which allows for external files to be placed into an InDesign document. Methods allow for getting information about supported file types, and the actual importing of the external files.

Constructor & Destructor Documentation

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

Constructor.

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

Destructor

Member Function Documentation

IImportProvider::ImportAbility TxtImpFilter::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: kFullImport: The filter can import this format. kPartialImport: The filter can import this file, but there may be a better match, only use this filter if no other returns kFullImport kCannotImport: This filter does not import this format.

Implements IImportProvider.

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

Indicates whether the import provider can import the given file. There are three possible results - kFullImport: The filter can import this format. kPartialImport: The filter can import this file, but there may be a better match, only use this filter if no other returns kFullImport kCannotImport: This filter does not import this format.

Implements IImportProvider.

int32 TxtImpFilter::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 '.'

Implements IImportProvider.

int32 TxtImpFilter::CountExternalFlavors (void )
virtual

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

Implements IImportProvider.

int32 TxtImpFilter::CountFileTypes (void )
virtual

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

Implements IImportProvider.

int32 TxtImpFilter::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".

Implements IImportProvider.

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

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

Implements IImportProvider.

ExternalPMFlavor TxtImpFilter::GetExternalFlavor (int32 n)
virtual

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

Implements IImportProvider.

SysOSType TxtImpFilter::GetFileType (int32 n)
virtual

Get the Nth filetype supported by the import provider.

Implements IImportProvider.

PMString TxtImpFilter::GetFormatName (int32 formatIndex)
virtual

Get the Nth file format supported by the import provider.

Implements IImportProvider.

PMFlavor TxtImpFilter::GetInternalFlavor (void )
virtual

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

Implements IImportProvider.

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

This method is the main entry point of the import provider. 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. Please note that the typographer's quotation marks will NOT be modified in this plug-in.

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
dataLinkOptional. 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.