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

#include <IXMLMoveElementCmdData.h>

Inheritance diagram for IXMLMoveElementCmdData:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IXMLMOVEELEMENTCMDDATA }
 

Public Member Functions

virtual void Set (const XMLReference &moveElementXMLRef, const XMLReference &newParentXMLRef, int32 newIndexInParent, TextIndex contentOffset)=0
 
virtual const XMLReferenceGetMoveElementXMLRef (void) const =0
 
virtual void SetMoveElementXMLRef (const XMLReference &xmlRef)=0
 
virtual const XMLReferenceGetNewParentXMLRef (void) const =0
 
virtual int32 GetNewIndexInParent (void) const =0
 
virtual TextIndex GetContentOffset (void) const =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

Data interface for moving elements in the logical structure tree; use IXMLElementCommands methods to do this rather than processing low-level commands from client code.

Member Function Documentation

virtual TextIndex IXMLMoveElementCmdData::GetContentOffset (void ) const
pure virtual

Accessor for content offset stored on this

Returns
TextIndex stored on this interface
virtual const XMLReference& IXMLMoveElementCmdData::GetMoveElementXMLRef (void ) const
pure virtual

Acccessor for the element to be moved stored on this interface. Note: at the end of each of the command's Do/Undo/Redo operations, GetMoveElementXMLRef returns the updated XMLReference of the moved element at its current location

Returns
XMLReference specifying element to be moved stored on this interface
virtual int32 IXMLMoveElementCmdData::GetNewIndexInParent (void ) const
pure virtual

Accessor for new index in parent stored on this

Returns
int32 giving index in parent's list of nodes, stored on this interface
virtual const XMLReference& IXMLMoveElementCmdData::GetNewParentXMLRef (void ) const
pure virtual

Accessor for new parent element stored on this interface

Returns
XMLReference of new parent stored on this
virtual void IXMLMoveElementCmdData::Set (const XMLReferencemoveElementXMLRef,
const XMLReferencenewParentXMLRef,
int32 newIndexInParent,
TextIndex contentOffset 
)
pure virtual
    Set up the data on this interface.

Example; suppose that you have the following marked up content:


    <A>zzzXzz<B>z</B>zYz</A>

to insert at the "X" position, newParentXMLRef = "A"; newIndexInParent = 0; contentOffset = 3 to insert at the "Y" position, newParentXMLRef = "A"; newIndexInParent = 1; contentOffset = 1

To get the new XMLReference of the moved element after the command has processed, do:

  1. Instantiate the new parent element:
    
        InterfacePtr<IIDXMLElement> newParentElement(Utils<IXMLUtils>()->Instantiate(newParentXMLRef));
    
            
  2. Ask for the child at newIndexInParent:
    
        XMLReference newXMLRef(newParentElement->GetNthChild(newIndexInParent));
    
            
Parameters
moveElementXMLRefXML element to move
newParentXMLRefmove the element to a child of this element
newIndexInParentmove the element to this child index under the new parent
contentOffsetinsertion point in the content in front of the specified new index in parent use kInvalidTextIndex to specify the end of the content run
virtual void IXMLMoveElementCmdData::SetMoveElementXMLRef (const XMLReferencexmlRef)
pure virtual

Specify element to move

Parameters
xmlRefspecifying element to move