InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CXMLImportMatchMaker Class Reference

#include <CXMLImportMatchMaker.h>

Inheritance diagram for CXMLImportMatchMaker:
CPMUnknown< IXMLImportMatchMaker >IXMLImportMatchMakerIPMUnknown

Public Member Functions

 CXMLImportMatchMaker (IPMUnknown *boss)
 
virtual void Register (IPMUnknown *xmlImporter)
 
virtual ErrorCode MatchDocument (const IDXMLDOMGraph &leftGraph, IXMLImportMatchRecorder *matchRecorder)
 
virtual ErrorCode PostMatchDocument (const IDXMLDOMGraph &leftGraph, IXMLImportMatchRecorder *matchRecorder)
 
virtual ErrorCode Match (const IDXMLDOMGraph &leftGraph, const IDXMLDOMStructureOnlyIterator &leftIter, const IDXMLDOMStructureOnlyIterator &leftIterEnd, const XMLReferenceGraph &rightGraph, const XMLOutEdgeIterator &rightIter, const XMLOutEdgeIterator &rightIterEnd, IXMLImportMatchRecorder *matchRecorder)
 
virtual ErrorCode PostMatch (const IDXMLDOMGraph &leftGraph, const IDXMLDOMStructureOnlyIterator &leftIter, const IDXMLDOMStructureOnlyIterator &leftIterEnd, const XMLReferenceGraph &rightGraph, const XMLOutEdgeIterator &rightIter, const XMLOutEdgeIterator &rightIterEnd, IXMLImportMatchRecorder *matchRecorder)
 
virtual ErrorCode NoMatchMade (const IDXMLDOMGraph &leftGraph, const IDXMLDOMStructureOnlyIterator &leftIter, const IDXMLDOMStructureOnlyIterator &leftIterEnd, const XMLReferenceGraph &rightGraph, const XMLOutEdgeIterator &rightIter, const XMLOutEdgeIterator &rightIterEnd, IXMLImportMatchRecorder *matchRecorder)
 
virtual ErrorCode MatchPhaseComplete (const IDXMLDOMGraph &leftGraph, const XMLReferenceGraph &rightGraph, IXMLImportMatchRecorder *matchRecorder)
 
virtual ErrorCode NoMatchMadeOnRoot (const IDXMLDOMGraph &leftGraph, const IDXMLDOMStructureOnlyIterator &leftIter, const IDXMLDOMStructureOnlyIterator &leftIterEnd, const XMLReference &importIntoXMLRef, XMLReference &elementToMatch)
 
- Public Member Functions inherited from CPMUnknown< IXMLImportMatchMaker >
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 Types

enum  ElementType { kElementType_Normal = 0, kElementType_Table, kElementType_TableGrid, kElementType_TableCell }
 
enum  CellType { kUnknown = 0, kHeader, kBody, kFooter }
 

Protected Member Functions

ErrorCode GetTagUID (const IIDXMLDOMNode *leftNode, const UIDRef &tagList, UID &tagUID) const
 
ElementType GetElementType (const IIDXMLDOMNode *leftNode) const
 
ElementType GetElementType (const IIDXMLElement *rightElement) const
 
bool16 MatchType (IIDXMLDOMNode *leftNode, IIDXMLElement *rightElement, IXMLImportMatchRecorder *matchRecorder) const
 
bool16 IsElementNew (const IIDXMLElement *element, const IXMLImportMatchRecorder *matchRecorder) const
 
bool16 CheckTableNode (IIDXMLDOMNode *node, bool16 bCheckGrid) const
 
CellType GetCellType (const IIDXMLDOMNode *leftNode) const
 
CellType GetCellType (const IIDXMLElement *rightElement) const
 
- Protected Member Functions inherited from CPMUnknown< IXMLImportMatchMaker >
 CPMUnknown (IPMUnknown *boss)
 

Protected Attributes

bool16 fMatchTextToTable
 
WideString fURI
 
- Protected Attributes inherited from CPMUnknown< IXMLImportMatchMaker >
HelperInterface fHelperInterface
 

Additional Inherited Members

- Public Types inherited from IXMLImportMatchMaker
enum  { kDefaultIID = IID_IXMLIMPORTMATCHMAKER }
 

Detailed Description

An empty base class implementation of IXMLImportMatchMaker. Clients who wish to add a XML import match maker serevice provider should implement new classes derived from this class.

See Also
IXMLImportMatchMaker

Member Enumeration Documentation

Enumerator
kUnknown 

the order here is the same as they appear in a table

kBody 

a cell in a header row

kFooter 

a cell in a body row a cell in a footer row

the type of the element
Enumerator
kElementType_Table 

generic element

kElementType_TableGrid 

table element

kElementType_TableCell 

table row element – for future expansion table cell element

Member Function Documentation

CellType CXMLImportMatchMaker::GetCellType (const IIDXMLDOMNodeleftNode) const
protected

Given an IIDXMLDOMNode, return its cell type by by checking its attributes The IIDXMLDOMNode must have ElementType kElementType_TableCell.

CellType CXMLImportMatchMaker::GetCellType (const IIDXMLElementrightElement) const
protected

Given a table cell element, get its type.

ElementType CXMLImportMatchMaker::GetElementType (const IIDXMLDOMNodeleftNode) const
protected

Given an IIDXMLDOMNode, return its element type by by checking its attributes

ElementType CXMLImportMatchMaker::GetElementType (const IIDXMLElementrightElement) const
protected

Given an element, return its type

ErrorCode CXMLImportMatchMaker::GetTagUID (const IIDXMLDOMNodeleftNode,
const UIDReftagList,
UIDtagUID 
) const
protected

Get the UID of the node's tag.

bool16 CXMLImportMatchMaker::IsElementNew (const IIDXMLElementelement,
const IXMLImportMatchRecordermatchRecorder 
) const
protected

Given an element, return whether it is a new element created during this import session

virtual ErrorCode CXMLImportMatchMaker::Match (const IDXMLDOMGraphleftGraph,
const IDXMLDOMStructureOnlyIteratorleftIter,
const IDXMLDOMStructureOnlyIteratorleftIterEnd,
const XMLReferenceGraphrightGraph,
const XMLOutEdgeIterator & rightIter,
const XMLOutEdgeIterator & rightIterEnd,
IXMLImportMatchRecordermatchRecorder 
)
virtual
called for kXMLImportMatchMakerSignalService to perform a match service

Parameters
leftGraphgraph of incoming XML
leftIterleft tree iterator
leftIterEndleft tree end iterator
rightGraphgraph of existing XML
rightIterright tree iterator
rightIterEndright tree end iterator
matchRecorderMatchRecorder. If the service decides to make a match, it must make appropriate calls in this functor class. Do not call the match recording method of this data if the service decides to not handle the match.
See Also
XMLImportMatchRecorder
Returns
ErrorCode

Implements IXMLImportMatchMaker.

virtual ErrorCode CXMLImportMatchMaker::MatchDocument (const IDXMLDOMGraphleftGraph,
IXMLImportMatchRecordermatchRecorder 
)
virtual
this is the first match call. It asks the match maker to match the incoming XML's 

document node to a XMLReference in the existing document. Use the match recorder to indicate whether the match was handled

Parameters
leftGraphgraph of incoming XML
matchRecorderMatchRecorder. If the service decides to make a match, it must make appropriate calls in this functor class. Do not call the match recording method of this data if the service decides to not handle the match.
See Also
XMLImportMatchRecorder
Returns
ErrorCode

Implements IXMLImportMatchMaker.

virtual ErrorCode CXMLImportMatchMaker::MatchPhaseComplete (const IDXMLDOMGraphleftGraph,
const XMLReferenceGraphrightGraph,
IXMLImportMatchRecordermatchRecorder 
)
virtual
called at the end of the entire match making phase

Parameters
leftGraphgraph of incoming XML
leftIterleft tree iterator
leftIterEndleft tree end iterator
rightGraphgraph of existing XML
rightIterright tree iterator
rightIterEndright tree end iterator
Returns
ErrorCode

Implements IXMLImportMatchMaker.

bool16 CXMLImportMatchMaker::MatchType (IIDXMLDOMNodeleftNode,
IIDXMLElementrightElement,
IXMLImportMatchRecordermatchRecorder 
) const
protected

Check if the left node's type matches rightElement.

virtual ErrorCode CXMLImportMatchMaker::NoMatchMade (const IDXMLDOMGraphleftGraph,
const IDXMLDOMStructureOnlyIteratorleftIter,
const IDXMLDOMStructureOnlyIteratorleftIterEnd,
const XMLReferenceGraphrightGraph,
const XMLOutEdgeIterator & rightIter,
const XMLOutEdgeIterator & rightIterEnd,
IXMLImportMatchRecordermatchRecorder 
)
virtual
called by the default match maker. This is called after all match makers have been 

called, including the default match maker, and none of the services made a match. The default match maker is about to insert a new element and make a match to it. The match maker service being called is allow to make a last attempt at making a match. If still no match is made, then the default match maker will insert a new element

Parameters
leftGraphgraph of incoming XML
leftIterleft tree iterator
leftIterEndleft tree end iterator
rightGraphgraph of existing XML
rightIterright tree iterator
rightIterEndright tree end iterator
Returns
ErrorCode

Implements IXMLImportMatchMaker.

virtual ErrorCode CXMLImportMatchMaker::NoMatchMadeOnRoot (const IDXMLDOMGraphleftGraph,
const IDXMLDOMStructureOnlyIteratorleftIter,
const IDXMLDOMStructureOnlyIteratorleftIterEnd,
const XMLReferenceimportIntoXMLRef,
XMLReferenceelementToMatch 
)
virtual
called by the default match maker. This is called after all match makers have been 

called, including the default match maker, and none of the services made a match on the incoming root node. The default match maker is about to insert a new element and make a match to it. The match maker service being called is allowed to make a last attempt at making a match. If still no match is made, then the default match maker will insert a new element

Parameters
leftGraphgraph of incoming XML
leftIterleft tree iterator
leftIterEndleft tree end iterator
importIntoXMLRefthe element to import into
elementToMatchreturns the created element that the incoming root element should match to
Returns
ErrorCode

Implements IXMLImportMatchMaker.

virtual ErrorCode CXMLImportMatchMaker::PostMatch (const IDXMLDOMGraphleftGraph,
const IDXMLDOMStructureOnlyIteratorleftIter,
const IDXMLDOMStructureOnlyIteratorleftIterEnd,
const XMLReferenceGraphrightGraph,
const XMLOutEdgeIterator & rightIter,
const XMLOutEdgeIterator & rightIterEnd,
IXMLImportMatchRecordermatchRecorder 
)
virtual
called as part of kXMLImportMatchMakerSignalService after a match as been performed

Parameters
leftGraphgraph of incoming XML
leftIterleft tree iterator
leftIterEndleft tree end iterator
rightGraphgraph of existing XML
rightIterright tree iterator
rightIterEndright tree end iterator
Returns
ErrorCode

Implements IXMLImportMatchMaker.

virtual ErrorCode CXMLImportMatchMaker::PostMatchDocument (const IDXMLDOMGraphleftGraph,
IXMLImportMatchRecordermatchRecorder 
)
virtual
this is called after MatchDocument(). It is a notification for document element match

Parameters
leftGraphgraph of incoming XML
matchRecorderMatchRecorder. If the service decides to make a match, it must make appropriate calls in this functor class. Do not call the match recording method of this data if the service decides to not handle the match.
See Also
XMLImportMatchRecorder
Returns
ErrorCode

Implements IXMLImportMatchMaker.

virtual void CXMLImportMatchMaker::Register (IPMUnknownxmlImporter)
virtual

Initializes some preferences. Clients that implement this fuction should call the implementation in the base class.

Implements IXMLImportMatchMaker.

Member Data Documentation

bool16 CXMLImportMatchMaker::fMatchTextToTable
protected

Import option "Import text elements into tables if tags match". Default is kTrue. Initialized in Register().