InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
XDocBkXMLPostImportIteration Class Reference
Inheritance diagram for XDocBkXMLPostImportIteration:
CPMUnknown< IXMLPostImportIteration >IXMLPostImportIterationIPMUnknown

Public Member Functions

 XDocBkXMLPostImportIteration (IPMUnknown *boss)
 
virtual bool16 ShouldIterate (IPostImportResponderData *responderData)
 
virtual ErrorCode BeforeIteration (IPostImportResponderData *responderData)
 
virtual ErrorCode HandleElement (IIDXMLElement *element, IIDXMLDOMNode *domNode)
 
virtual ErrorCode AfterIteration ()
 
- Public Member Functions inherited from CPMUnknown< IXMLPostImportIteration >
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
 

Protected Member Functions

ErrorCode DoTryImageImport (IIDXMLElement *element, IIDXMLDOMNode *domNode)
 
ErrorCode DoTryTaggingTable (IIDXMLElement *element, IIDXMLDOMNode *domNode)
 
ErrorCode DoTryDeleteElement (IIDXMLElement *element, IIDXMLDOMNode *domNode, const WideString &tagString)
 
void ImportAndPlace (IIDXMLElement *element, const WideString &attribValue, const TextIndex &whereTextIndex)
 
void PlaceInlines (const XMLReference &xmlRef, const WideString &elemName, const WideString &attribName)
 
void ImportImage (const IDFile &sysFile, const InterfacePtr< ITextModel > &iTextModel, const TextIndex &whereTextIndex)
 
ErrorCode TagTable (const UIDRef &tableModelUIDRef, const WideString &tableTagName, const WideString &cellTagName, XMLReference &outCreatedXMLReference)
 
- Protected Member Functions inherited from CPMUnknown< IXMLPostImportIteration >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

- Public Types inherited from IXMLPostImportIteration
enum  { kDefaultIID = IID_IXMLPOSTIMPORTITERATION }
 
- Protected Attributes inherited from CPMUnknown< IXMLPostImportIteration >
HelperInterface fHelperInterface
 

Detailed Description

Implementation of a post-import iterator (IXMLPostImportIteration) that, subject to preference settings, will:

  • place images referred to in the input
  • delete unwanted elements in the input
  • tag tables that were created earlier by a SAX DOM serializer handler.

This used to require a path to the asset folder, but now it just uses the path relative to the XML being imported, since the XML importer (kXMLImporterBoss) maintains this and we have access to that through IPostImportResponderData (see BeforeIteration).

See Also
IXMLPostImportIteration

Constructor & Destructor Documentation

XDocBkXMLPostImportIteration::XDocBkXMLPostImportIteration (IPMUnknownboss)

Constructor

Parameters
bossIN refers to boss object on which this implementation is aggregated

Member Function Documentation

ErrorCode XDocBkXMLPostImportIteration::AfterIteration ()
virtual
See Also
IXMLPostImportIteration::AfterIteration
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise

Implements IXMLPostImportIteration.

ErrorCode XDocBkXMLPostImportIteration::BeforeIteration (IPostImportResponderDataresponderData)
virtual
See Also
IXMLPostImportIteration::BeforeIteration
Parameters
responderDataIN refers to objects like importer (kXMLImporterBoss)
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise

Implements IXMLPostImportIteration.

ErrorCode XDocBkXMLPostImportIteration::DoTryDeleteElement (IIDXMLElementelement,
IIDXMLDOMNodedomNode,
const WideStringtagString 
)
protected

Attempt deleting an element if it matches our specification, ie tagString is what we expect

Parameters
elementIN
domNodeIN
tagStringIN
Returns
ErrorCode
ErrorCode XDocBkXMLPostImportIteration::DoTryImageImport (IIDXMLElementelement,
IIDXMLDOMNodedomNode 
)
protected

Attempt importing an image if the given element specifies one should be imported.

Parameters
elementIN
domNodeIN
Returns
ErrorCode
ErrorCode XDocBkXMLPostImportIteration::DoTryTaggingTable (IIDXMLElementelement,
IIDXMLDOMNodedomNode 
)
protected

Attempt tagging a table if given element matches our specification, a <para;> element with an attribute of TABLEHOLDER

Parameters
elementIN
domNodeIN
Returns
ErrorCode
ErrorCode XDocBkXMLPostImportIteration::HandleElement (IIDXMLElementelement,
IIDXMLDOMNodedomNode 
)
virtual
See Also
IXMLPostImportIteration::HandleElement
Parameters
elementIN current element in iteration
domNodeIN
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise

Implements IXMLPostImportIteration.

void XDocBkXMLPostImportIteration::ImportAndPlace (IIDXMLElementelement,
const WideStringattribValue,
const TextIndex & whereTextIndex 
)
protected

Try to find an image that matches the specified name, and place it in-line.

Parameters
elementIN location of element that may contain a specification of an image we'd like to place
attribNameIN names the attribute that could have a media reference
whereTextIndexIN locus in the textmodel where we'd like to place the graphic as inline
void XDocBkXMLPostImportIteration::ImportImage (const IDFilesysFile,
const InterfacePtr< ITextModel > & iTextModel,
const TextIndex & whereTextIndex 
)
protected

Method to execute an import of specified image into text model at given TextIndex

Parameters
sysFileIN
iTextModelIN
whereTextIndexIN
void XDocBkXMLPostImportIteration::PlaceInlines (const XMLReferencexmlRef,
const WideStringelemName,
const WideStringattribName 
)
protected

Place inline graphics referenced in logical structure within the associated text model for

Parameters
xmlRefIN
elemNameIN
attribNameIN
subDictIN
bool16 XDocBkXMLPostImportIteration::ShouldIterate (IPostImportResponderDataresponderData)
virtual
See Also
IXMLPostImportIteration::ShouldIterate
Parameters
responderDataThe responder data from kXMLImporterPostImportSignalMgrBoss.
Returns
bool16 kTrue if this service should be iterated. kFalse if this service should not be iterated

Implements IXMLPostImportIteration.

ErrorCode XDocBkXMLPostImportIteration::TagTable (const UIDReftableModelUIDRef,
const WideStringtableTagName,
const WideStringcellTagName,
XMLReferenceoutCreatedXMLReference 
)
protected

Tag given table

Parameters
tableModelUIDRefIN
tableTagNameIN
cellTagNameIN
outCreatedXMLReferenceOUT
Returns
ErrorCode kSuccess on success, other ErrorCode otherwise