InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDOMElement Class Referenceabstract
Inheritance diagram for IDOMElement:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDOMELEMENT }
 
enum  ContentType { kTextContent, kBreakContent, kNonContent }
 
typedef object_type data_type
 
typedef ScriptID DOMElementID
 
typedef WideString DOMElementName
 
typedef ScriptID DOMAttributeID
 
typedef WideString DOMAttributeName
 
typedef KeyValuePair
< DOMAttributeID,
DOMAttributeValue
AttributeIDValuePair
 
typedef K2Vector< InterfacePtr
< IDOMElement > > 
ElementList
 
typedef K2Vector< DOMElementIDElementIDList
 
typedef adobe::vector
< AttributeIDValuePair
AttributeList
 
typedef K2Vector< DOMAttributeIDAttributeIDList
 

Public Member Functions

virtual void Reset ()=0
 
virtual DOMElementID GetElementID () const =0
 
virtual DOMElementName GetElementName () const =0
 
virtual bool16 IsSameElement (IDOMElement *other) const =0
 
virtual IDOMElementQueryParent () const =0
 
virtual bool16 HasAttribute (const DOMAttributeID id)=0
 
virtual bool16 IsAttributeReadOnly (const DOMAttributeID id)=0
 
virtual int32 GetAttributeIDs (AttributeIDList &ids)=0
 
virtual bool16 GetAttribute (const DOMAttributeID id, DOMAttributeValue &value)=0
 
virtual int32 GetMultipleAttributes (const AttributeIDList &idList, AttributeList &attributes)=0
 
virtual int32 GetAttributes (AttributeList &attributes)=0
 
virtual bool16 SetAttribute (const DOMAttributeID id, const DOMAttributeValue &value)=0
 
virtual bool16 SetAttributes (const AttributeList &attributes)=0
 
virtual int32 GetChildElements (ElementList &children)=0
 
virtual int32 GetSpecificChildElements (DOMElementID childType, ElementList &children, bool includeSubtypes=kFalse)=0
 
virtual IDOMElementCreateChildElement (DOMElementID type, const AttributeList &attributes)=0
 
virtual bool16 DeleteChildElement (IDOMElement *child)=0
 
virtual bool16 DeleteChildElements (const ElementList &children)=0
 
virtual void SetDontDiscoverResource (bool16 flag)=0
 
virtual bool16 GetDontDiscoverResource () const =0
 
virtual bool16 AddChildElement (IDOMElement *child)=0
 
virtual bool16 RemoveChildElement (IDOMElement *child)=0
 
virtual bool16 AddAttribute (const DOMAttributeID id, const DOMAttributeValue &value)=0
 
virtual bool16 RemoveAttribute (const DOMAttributeID id)=0
 
virtual bool16 InitializeAttributes (const IDOMElement::AttributeList &attributes, bool16 checkForSpecialObjects=kTrue)=0
 
virtual bool16 HasContentChildren ()=0
 
virtual void AddContent (ContentType type, WideString &content)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Member Function Documentation

virtual bool16 IDOMElement::AddAttribute (const DOMAttributeID id,
const DOMAttributeValuevalue 
)
pure virtual

Add an attribute to its cached attribute list.

Parameters
idIN The attribute ID.
valueIN A reference to DOMAttributeValue that will hold the attribute value.
Returns
kTrue if the attribute was added, kFalse if it already has this attribute.
virtual bool16 IDOMElement::AddChildElement (IDOMElementchild)
pure virtual

Add an element to its cached child list.

Parameters
childIN A pointer to the child element that should be added.
Returns
kTrue if the child was added, kFalse if it was already a child of the parent.
virtual void IDOMElement::AddContent (ContentType type,
WideStringcontent 
)
pure virtual

Used in IDML (INX-Alt) to add text content and break children to a text object for output

Parameters
type,INType of content child to add
content,INText content or string indicating type of break
virtual IDOMElement* IDOMElement::CreateChildElement (DOMElementID type,
const AttributeList & attributes 
)
pure virtual

Creates a new child element.

Parameters
typeIN The type of child to create ("Color", "XMLElement", etc.).
attributesIN A const reference to a list that contains the attribute IDs and values.
Returns
A pointer to the newly created child, or nil if the child could not be created.
virtual bool16 IDOMElement::DeleteChildElement (IDOMElementchild)
pure virtual

Delete a child element.

Parameters
childIN A pointer to the child element.
Returns
kTrue if the child was deleted, kFalse if not.
virtual bool16 IDOMElement::DeleteChildElements (const ElementListchildren)
pure virtual

Delete one or more child elements.

Parameters
childrenIN A const reference to the list of children to delete.
Returns
kTrue if at least one child was deleted, kFalse if none of the children could be deleted.
virtual bool16 IDOMElement::GetAttribute (const DOMAttributeID id,
DOMAttributeValuevalue 
)
pure virtual

Returns the current value of the specified attribute.

Parameters
idIN The attribute ID.
valueOUT A reference to an object that will hold the value.
Returns
kTrue if the value was returned, kFalse if the value could not be obtained.
virtual int32 IDOMElement::GetAttributeIDs (AttributeIDListids)
pure virtual

Returns a list of the IDs of all of the node's attributes.

Parameters
idsIN A reference to the list to be filled with the attribute IDs.
Returns
The number of attributes in the list.
virtual int32 IDOMElement::GetAttributes (AttributeList & attributes)
pure virtual

Returns the IDs and current values of all of the node's attributes.

Parameters
attributesOUT A reference to a list that will contain the attributes.
Returns
The number of attributes returned in the list.
virtual int32 IDOMElement::GetChildElements (ElementListchildren)
pure virtual

Returns a list of all of the node's children.

Parameters
childrenOUT A reference to the list that will contain the children. Note that current contents of the caller's list are REPLACED.
Returns
The number of children returned in the list.
virtual bool16 IDOMElement::GetDontDiscoverResource () const
pure virtual

Retrieve do not discover resource flag.

Returns
do not discover resource flag, kTrue or kFalse
virtual DOMElementID IDOMElement::GetElementID () const
pure virtual

Returns the ID of the node.

Returns
The node ID.
virtual DOMElementName IDOMElement::GetElementName () const
pure virtual

Returns the name of the node.

Returns
The node name.
virtual int32 IDOMElement::GetMultipleAttributes (const AttributeIDListidList,
AttributeList & attributes 
)
pure virtual

Returns the IDs and current values of node's attributes specified in ID list.

Parameters
idListIN The list which contains the IDs of attribute we want to collect.
attributesOUT A reference to a list that will contain the attributes.
Returns
The number of attributes returned in the list.
virtual int32 IDOMElement::GetSpecificChildElements (DOMElementID childType,
ElementListchildren,
bool includeSubtypes = kFalse 
)
pure virtual

Returns a list of all of the node's children of childType.

Parameters
childrenIN The type of child element to get.
childrenOUT A reference to the list that will contain the children.
childrenIN flag to indicate whether or not also collect subtypes. Note that current contents of the caller's list are REPLACED.
Returns
The number of children returned in the list.
virtual bool16 IDOMElement::HasAttribute (const DOMAttributeID id)
pure virtual

Tests to see whether the node has an attribute of the specified ID.

Parameters
idIN The attribute ID.
Returns
kTrue if the attribute exists, kFalse if not.
virtual bool16 IDOMElement::HasContentChildren ()
pure virtual

Ask the element if it has content children

Returns
kTrue if the element has children that contain content
virtual bool16 IDOMElement::InitializeAttributes (const IDOMElement::AttributeList & attributes,
bool16 checkForSpecialObjects = kTrue 
)
pure virtual

A special form of SetAttributes used during object creation. Should only be used during object creation. Other clients should use SetAttributes instead.

Parameters
attributesIN A const reference to a list that contains the attribute IDs and values.
checkForSpecialObjectsIN kTrue to handle properties in an object-type-specific way. kFalse to just set them with no extra checking.
Returns
kTrue if at least one value was set, kFalse if none of the values could be set.
virtual bool16 IDOMElement::IsAttributeReadOnly (const DOMAttributeID id)
pure virtual

Tests to see whether the attribute is read-only.

Parameters
idIN The attribute ID.
Returns
kTrue if the attribute is read-only, kFalse if not.
virtual bool16 IDOMElement::IsSameElement (IDOMElementother) const
pure virtual

Determines if two IDOMElement pointers reference the same Element.

Returns
kTrue if the Elements are the same, kFalse if not.
virtual IDOMElement* IDOMElement::QueryParent () const
pure virtual

Returns a pointer to the node's parent. The parent's reference count is incremented.

Returns
A pointer to the parent node.
virtual bool16 IDOMElement::RemoveAttribute (const DOMAttributeID id)
pure virtual

Remove an attribute from its cached attribute list.

Parameters
idIN The attribute ID.
Returns
kTrue if the attribute was removed, kFalse if it was not found on this element.
virtual bool16 IDOMElement::RemoveChildElement (IDOMElementchild)
pure virtual

Remove a child element from its cached child list. Note: The child is NOT destroyed.

Parameters
childIN A pointer to the child element that should be removed.
Returns
kTrue if the child was removed, kFalse if it was not found in the parent.
virtual void IDOMElement::Reset ()
pure virtual

Releases all cached resources held by the node and all nodes beneath it.

virtual bool16 IDOMElement::SetAttribute (const DOMAttributeID id,
const DOMAttributeValuevalue 
)
pure virtual

Sets the value of the specified attribute.

Parameters
idIN The attribute ID.
valueIN A const reference to an object that holds the new value.
Returns
kTrue if the value was set, kFalse if the value could not be set.
virtual bool16 IDOMElement::SetAttributes (const AttributeList & attributes)
pure virtual

Sets the values of one or more of the node's attributes.

Parameters
attributesIN A const reference to a list that contains the attribute IDs and values.
Returns
kTrue if at least one value was set, kFalse if none of the values could be set.
virtual void IDOMElement::SetDontDiscoverResource (bool16 flag)
pure virtual

Set this flag put element in special state. When flag is set to kTrue, element won't retrieve child and attribute information from underline system. Element will only return children and attributes in its cache. Flag is initialized to kFalse. Calling Reset also set this flag to kFalse.

Parameters
flagIN Do not discover resource flag