#include <OXML_Element.h>
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_ElementVector & | getChildren () 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) |
OXML_Element::OXML_Element | ( | const std::string & | id, | |
OXML_ElementTag | tag, | |||
OXML_ElementType | type | |||
) |
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().
UT_Error OXML_Element::addChildrenToPT | ( | PD_Document * | pDocument | ) |
Calls the method addToPT() on all children.
WARNING: if you derive OXML_Element, you probably shouldn't redefine this method.
Reimplemented in OXML_Element_Row, and OXML_Element_Table.
References m_children, and UT_OK.
Referenced by OXML_Element_TextBox::addToPT(), OXML_Element_Run::addToPT(), OXML_Element_Paragraph::addToPT(), OXML_Element_Image::addToPT(), OXML_Element_Hyperlink::addToPT(), OXML_Element_Field::addToPT(), OXML_Element_Cell::addToPT(), OXML_Element_Bookmark::addToPT(), and addToPT().
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).
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::appendElement | ( | const OXML_SharedElement & | obj | ) |
References m_children, TARGET, UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by IE_Exp_OpenXML_Listener::populate(), and IE_Exp_OpenXML_Listener::populateStrux().
UT_Error OXML_Element::clearChildren | ( | ) |
References m_children, and UT_OK.
Referenced by ~OXML_Element().
const OXML_ElementVector& OXML_Element::getChildren | ( | ) | const [inline] |
References m_children.
Referenced by OXML_Element_Table::addChildrenToPT(), OXML_Element_Row::addChildrenToPT(), OXML_Element_Table::addMissingCell(), OXML_Element_Table::addToPT(), OXML_Element_Cell::addToPT(), OXML_Element_Table::serialize(), OXML_Element_Table::serializeChildren(), OXML_Element_Run::serializeChildren(), OXML_Element_Row::serializeChildren(), OXML_Element_Paragraph::serializeChildren(), OXML_Element_Paragraph::serializeProperties(), and OXML_Element_Cell::serializeProperties().
OXML_SharedElement OXML_Element::getElement | ( | const std::string & | id | ) | const |
References m_children.
const std::string& OXML_Element::getId | ( | ) | const [inline] |
OXML_ElementTag OXML_Element::getTag | ( | ) | const [inline] |
OXML_ElementType OXML_Element::getType | ( | void | ) | const [inline] |
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).
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().
bool operator== | ( | const OXML_SharedElement & | lhs, | |
const std::string & | id | |||
) | [friend] |
OXML_ElementVector OXML_Element::m_children [private] |
Referenced by addChildrenToPT(), appendElement(), clearChildren(), getChildren(), getElement(), and serializeChildren().
std::string OXML_Element::m_id [private] |
Referenced by getId(), operator==(), and setId().
OXML_ElementTag OXML_Element::m_tag [private] |
OXML_ElementType OXML_Element::m_type [private] |
Reimplemented in OXML_Element_Bookmark.
int OXML_Element::TARGET [protected] |
Referenced by appendElement(), OXML_Element_TextBox::serialize(), OXML_Element_Text::serialize(), OXML_Element_Run::serialize(), OXML_Element_Paragraph::serialize(), OXML_Element_Field::serialize(), OXML_Element_TextBox::serializeProperties(), OXML_Element_Run::serializeProperties(), OXML_Element_Row::serializeProperties(), OXML_Element_Paragraph::serializeProperties(), and setTarget().