InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXMLImportMatchRecorder Class Referenceabstract

#include <IXMLImportMatchRecorder.h>

Inheritance diagram for IXMLImportMatchRecorder:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IXMLIMPORTMATCHRECORDER }
 
typedef KeyValuePair
< IIDXMLDOMNode
*, XMLReference
MatchRecord
 

Public Member Functions

virtual void RecordMatch (IIDXMLDOMNode *leftNode, const XMLReference &rightNode, bool16 rightNodeIsNew, bool16 recordAsLastMatch=kTrue)=0
 
virtual bool16 MatchMade (void) const =0
 
virtual MatchRecord GetLastMatch (void) const =0
 
virtual bool16 FindMatch (IIDXMLDOMNode *leftNode, XMLReference *rightNode=nil, bool16 *rightNodeIsNew=nil) const =0
 
virtual bool16 FindMatchRight (const XMLReference &rightNode, IIDXMLDOMNode **leftNode=nil, bool16 *rightNodeIsNew=nil) const =0
 
virtual void ReplaceRightNode (const XMLReference &oldRightNode, const XMLReference &newRightNode, bool16 rightNodeIsNew)=0
 
virtual void PushMatchMade (bool16 matchMade=kFalse)=0
 
virtual bool16 PopMatchMade (void)=0
 
virtual void PushLevel (void)=0
 
virtual void PopLevel (void)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

interface to perform XML import match notification and record keeping

Member Typedef Documentation

a match record denoting how an incoming XML node is matched to the existing node

Parameters
keyleft tree (incoming XML) node
valueright tree (existing/importing into) node

Member Function Documentation

virtual bool16 IXMLImportMatchRecorder::FindMatch (IIDXMLDOMNodeleftNode,
XMLReferencerightNode = nil,
bool16 * rightNodeIsNew = nil 
) const
pure virtual
for use by ContentHandlers. Use this method to find the corresponding element in the 

document for the incoming elements

Parameters
leftNodeincoming XML node
rightNode[OUT] optionally receives the element in the document leftNode is matched to
rightNodeIsNew[OUT] optionally receives whether the right element is a new element
Returns
bool16 whether a match was found
virtual bool16 IXMLImportMatchRecorder::FindMatchRight (const XMLReferencerightNode,
IIDXMLDOMNode ** leftNode = nil,
bool16 * rightNodeIsNew = nil 
) const
pure virtual
internal use only

temporary method to lookup whether a right node has a match applied to it already. Later when we have a way to determine this from the right tree iterator, this method should be removed

Parameters
rightNoderight tree node to lookup
leftNode[OUT] optionally returns the element in the document that rightNode is matched to note that it could be nil
rightNodeIsNew[OUT] optionally receives whether the right element is a new element
Returns
bool16 whether rightNode has a match applied alreaedy
virtual MatchRecord IXMLImportMatchRecorder::GetLastMatch (void ) const
pure virtual
if MatchMade() is kTrue, return the match that was made for this round

Returns
std::pair<XMLReference, XMLReference> the made made during this round
virtual bool16 IXMLImportMatchRecorder::MatchMade (void ) const
pure virtual
returns whether a match has been made during this round

Returns
bool16 whether a match has been made during this round
virtual void IXMLImportMatchRecorder::PopLevel (void )
pure virtual
internal use only

call this method at the end of each level of match making process. A level is defined as a parent/child level

virtual bool16 IXMLImportMatchRecorder::PopMatchMade (void )
pure virtual

internal use only call this method at the end of each round of match making process

virtual void IXMLImportMatchRecorder::PushLevel (void )
pure virtual
internal use only

call this method at the beginning of each level of match making process. A level is defined as a parent/child level

virtual void IXMLImportMatchRecorder::PushMatchMade (bool16 matchMade = kFalse)
pure virtual
internal use only

call this method at the beginning of each round of match making process. A round is defined as a single match

Parameters
matchMadeinitial value of match made for the new round
virtual void IXMLImportMatchRecorder::RecordMatch (IIDXMLDOMNodeleftNode,
const XMLReferencerightNode,
bool16 rightNodeIsNew,
bool16 recordAsLastMatch = kTrue 
)
pure virtual
call this method to record a match

Parameters
leftNodeincoming node
rightNodeleft node is matched to this node in the right/existing tree. If kInvalidXMLReference is used, it means a match was made, and leftNode was matched to nothing. This is different than no match made (in which case this function should not be called at all)
rightNodeIsNewindicates whether the right node is a new element in the document. If the element is an existing element or one that was cloned/duplicated from an existing element, then the element/node is not new. If the element was created by, for example, a XMLCreateElementCmd, or it was cloned/duplicated from a new element, then the element is new
recordAsLastMatchif kTrue (default), the given match will be recorded as the last match made. Until another RecordMatch is called on this level, all subsequent calls to GetLastMatch() will return this match. If kFalse, the given match will not be recorded as last match. The previous last match record will remain
virtual void IXMLImportMatchRecorder::ReplaceRightNode (const XMLReferenceoldRightNode,
const XMLReferencenewRightNode,
bool16 rightNodeIsNew 
)
pure virtual
internal use only

replaces the a right tree node in the match recorder with a new one

Parameters
oldRightNoderight tree node to be replaced
newRightNodethe new right tree node
rightNodeIsNewindicates whether the right node is a new element in the document. If the element is an existing element or one that was cloned/duplicated from an existing element, then the element/node is not new. If the element was created by, for example, a XMLCreateElementCmd, or it was cloned/duplicated from a new element, then the element is new NOTE: Passing kInvalidXMLReference for oldRightNode is not recommended because it could result in the wrong DOMNode getting replaced. Similarly, Passing kInvalidXMLReference for newRightNode is not recommended because it can result in incorect searches by FindMatchRight()