Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends

OXML_Element Class Reference

#include <OXML_Element.h>

Inheritance diagram for OXML_Element:
OXML_ObjectWithAttrProp OXML_Element_Bookmark OXML_Element_Cell OXML_Element_Field OXML_Element_Hyperlink OXML_Element_Image OXML_Element_List OXML_Element_Math OXML_Element_Paragraph OXML_Element_Row OXML_Element_Run OXML_Element_Table OXML_Element_Text OXML_Element_TextBox

List of all members.

Public Member Functions

 OXML_Element (const std::string &id, OXML_ElementTag tag, OXML_ElementType type)
virtual ~OXML_Element ()
const std::string & getId () const
void setId (const std::string &id)
OXML_ElementTag getTag () const
OXML_ElementType getType () const
void setType (OXML_ElementType type)
bool operator== (const std::string &id)
OXML_SharedElement getElement (const std::string &id) const
UT_Error appendElement (const OXML_SharedElement &obj)
const OXML_ElementVectorgetChildren () const
UT_Error clearChildren ()
virtual UT_Error serialize (IE_Exp_OpenXML *exporter)
 Writes the OpenXML element to a file on disk.
virtual UT_Error addToPT (PD_Document *pDocument)
 Appends this section and all its content to the Abiword Piecetable.
UT_Error addChildrenToPT (PD_Document *pDocument)
 Calls the method addToPT() on all children.
void setTarget (int target)

Protected Member Functions

UT_Error serializeChildren (IE_Exp_OpenXML *exporter)
 Calls the method serialize() on all children.

Protected Attributes

int TARGET

Private Attributes

std::string m_id
OXML_ElementTag m_tag
OXML_ElementType m_type
OXML_ElementVector m_children

Friends

bool operator== (const OXML_SharedElement &lhs, const std::string &id)

Constructor & Destructor Documentation

OXML_Element::OXML_Element ( const std::string &  id,
OXML_ElementTag  tag,
OXML_ElementType  type 
)
Parameters:
id String representing the id (should be unique, although no check is made)
tag The tag that this element represents.
The category (BLOCK or SPAN) that this element belongs to.
OXML_Element::~OXML_Element (  )  [virtual]

References clearChildren().


Member Function Documentation

UT_Error OXML_Element::addChildrenToPT ( PD_Document pDocument  ) 
UT_Error OXML_Element::addToPT ( PD_Document pDocument  )  [virtual]

Appends this section and all its content to the Abiword Piecetable.

This method is used during the import process. WARNING: If you derive OXML_Element, you should probably override this method. If you do, make sure to call the method addChildrenToPT (if applicable).

Parameters:
pDocument A valid reference to the PD_Document object.

Reimplemented in OXML_Element_Bookmark, OXML_Element_Cell, OXML_Element_Field, OXML_Element_Hyperlink, OXML_Element_Image, OXML_Element_List, OXML_Element_Math, OXML_Element_Paragraph, OXML_Element_Row, OXML_Element_Run, OXML_Element_Table, OXML_Element_Text, and OXML_Element_TextBox.

References addChildrenToPT(), PD_Document::appendSpan(), CL_BREAK, LN_BREAK, m_tag, P_TAG, PG_BREAK, R_TAG, T_TAG, UT_ASSERT_NOT_REACHED, UT_OK, and UT_return_val_if_fail.

UT_Error OXML_Element::clearChildren (  ) 

References m_children, and UT_OK.

Referenced by ~OXML_Element().

OXML_SharedElement OXML_Element::getElement ( const std::string &  id  )  const

References m_children.

bool OXML_Element::operator== ( const std::string &  id  ) 

References m_id.

UT_Error OXML_Element::serialize ( IE_Exp_OpenXML exporter  )  [virtual]

Writes the OpenXML element to a file on disk.

This method is used during the export process. WARNING: If you derive OXML_Element, you should probably override this method. If you do, make sure to call the method serializeChildren (if applicable).

Parameters:
exporter the actual exporter which handles writing the files.

Reimplemented in OXML_Element_Bookmark, OXML_Element_Cell, OXML_Element_Field, OXML_Element_Hyperlink, OXML_Element_Image, OXML_Element_List, OXML_Element_Math, OXML_Element_Paragraph, OXML_Element_Row, OXML_Element_Run, OXML_Element_Table, OXML_Element_Text, and OXML_Element_TextBox.

References serializeChildren(), and UT_OK.

UT_Error OXML_Element::serializeChildren ( IE_Exp_OpenXML exporter  )  [protected]

Calls the method serialize() on all children.

WARNING: if you derive OXML_Element, you probably shouldn't redefine this method.

Reimplemented in OXML_Element_Paragraph, OXML_Element_Row, OXML_Element_Run, and OXML_Element_Table.

References m_children, and UT_OK.

Referenced by OXML_Element_TextBox::serialize(), OXML_Element_Hyperlink::serialize(), OXML_Element_Cell::serialize(), and serialize().

void OXML_Element::setId ( const std::string &  id  )  [inline]

References m_id.

void OXML_Element::setTarget ( int  target  ) 

References TARGET.

void OXML_Element::setType ( OXML_ElementType  type  )  [inline]

References m_type.

Referenced by OXML_Element_Run::serializeChildren().


Friends And Related Function Documentation

bool operator== ( const OXML_SharedElement lhs,
const std::string &  id 
) [friend]

Member Data Documentation

std::string OXML_Element::m_id [private]

Referenced by getId(), operator==(), and setId().

Referenced by addToPT(), and getTag().

Reimplemented in OXML_Element_Bookmark.

Referenced by getType(), and setType().


The documentation for this class was generated from the following files: