Used to parse <table:table> elements. More...
#include <ODi_Table_ListenerState.h>
Public Member Functions | |
ODi_Table_ListenerState (PD_Document *pDocument, ODi_Office_Styles *pStyles, ODi_ElementStack &rElementStack) | |
Constructor. | |
virtual | ~ODi_Table_ListenerState () |
void | startElement (const gchar *pName, const gchar **ppAtts, ODi_ListenerStateAction &rAction) |
Called when the XML parser finds a start element tag. | |
void | endElement (const gchar *pName, ODi_ListenerStateAction &rAction) |
Called when an "end of element" tag is parsed (like <myElementName>). | |
void | charData (const gchar *, int) |
Private Member Functions | |
void | _parseTableStart (const gchar **ppAtts, ODi_ListenerStateAction &rAction) |
Used to parse a <table:table> start element. | |
void | _parseColumnStart (const gchar **ppAtts, ODi_ListenerStateAction &rAction) |
Used to parse a <table:table-column> start element. | |
void | _parseRowStart (const gchar **ppAtts, ODi_ListenerStateAction &rAction) |
Used to parse a <table:table-row start element. | |
void | _parseCellStart (const gchar **ppAtts, ODi_ListenerStateAction &rAction) |
Private Attributes | |
bool | m_onContentStream |
bool | m_onFirstPass |
UT_sint16 | m_elementLevel |
PD_Document * | m_pAbiDocument |
ODi_Office_Styles * | m_pStyles |
UT_sint16 | m_row |
UT_sint16 | m_col |
UT_sint32 | m_rowsLeftToRepeat |
std::string | m_columnWidths |
std::string | m_rowHeights |
std::string | m_columnRelWidths |
bool | m_gotAllColumnWidths |
std::string | m_waitingEndElement |
Used to parse <table:table> elements.
It uses a two-pass approach.
The first pass gathers info about its rows and collumns to fill the properties of the AbiWord
(eg: Rows and collumns sizes). When the first pass is finished, the Abi
is appended.
The second pass defines all <cell> tags with their paragraph contents (ie: the table content itself).
ODi_Table_ListenerState::ODi_Table_ListenerState | ( | PD_Document * | pDocument, | |
ODi_Office_Styles * | pStyles, | |||
ODi_ElementStack & | rElementStack | |||
) |
Constructor.
References ODi_ElementStack::hasElement(), m_onContentStream, and ODi_ListenerState::m_rElementStack.
virtual ODi_Table_ListenerState::~ODi_Table_ListenerState | ( | ) | [inline, virtual] |
void ODi_Table_ListenerState::_parseCellStart | ( | const gchar ** | ppAtts, | |
ODi_ListenerStateAction & | rAction | |||
) | [private] |
References PD_Document::appendStrux(), gchar, ODi_Style_Style::getBackgroundColor(), ODi_Style_Style::getBackgroundImageID(), ODi_Style_Style::getBorderBottom_color(), ODi_Style_Style::getBorderBottom_thickness(), ODi_Style_Style::getBorderLeft_color(), ODi_Style_Style::getBorderLeft_thickness(), ODi_Style_Style::getBorderRight_color(), ODi_Style_Style::getBorderRight_thickness(), ODi_Style_Style::getBorderTop_color(), ODi_Style_Style::getBorderTop_thickness(), ODi_Office_Styles::getTableCellStyle(), ODi_Style_Style::getVerticalAlign(), ODi_Style_Style::hasBottomBorder(), ODi_Style_Style::hasLeftBorder(), ODi_Style_Style::hasRightBorder(), ODi_Style_Style::hasTopBorder(), m_col, m_onContentStream, m_onFirstPass, m_pAbiDocument, m_pStyles, m_row, PT_XMLID, PTX_SectionCell, ODi_ListenerStateAction::pushState(), UT_ASSERT, UT_getAttribute(), UT_std_string_sprintf(), and xxx_UT_DEBUGMSG.
Referenced by startElement().
void ODi_Table_ListenerState::_parseColumnStart | ( | const gchar ** | ppAtts, | |
ODi_ListenerStateAction & | rAction | |||
) | [private] |
Used to parse a <table:table-column> start element.
References gchar, ODi_Style_Style::getColumnRelWidth(), ODi_Style_Style::getColumnWidth(), ODi_Office_Styles::getTableColumnStyle(), m_columnRelWidths, m_columnWidths, m_gotAllColumnWidths, m_onContentStream, m_onFirstPass, m_pStyles, UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, and UT_getAttribute().
Referenced by startElement().
void ODi_Table_ListenerState::_parseRowStart | ( | const gchar ** | ppAtts, | |
ODi_ListenerStateAction & | rAction | |||
) | [private] |
Used to parse a <table:table-row start element.
References gchar, ODi_Style_Style::getMinRowHeight(), ODi_Style_Style::getRowHeight(), ODi_Office_Styles::getTableRowStyle(), m_col, m_onContentStream, m_onFirstPass, m_pStyles, m_row, m_rowHeights, m_rowsLeftToRepeat, ODi_ListenerStateAction::repeatElement(), UT_ASSERT, UT_ASSERT_HARMLESS, and UT_getAttribute().
Referenced by startElement().
void ODi_Table_ListenerState::_parseTableStart | ( | const gchar ** | ppAtts, | |
ODi_ListenerStateAction & | rAction | |||
) | [private] |
Used to parse a <table:table> start element.
References PD_Document::appendStrux(), gchar, ODi_Style_Style::getBackgroundColor(), ODi_Style_Style::getTableMarginLeft(), ODi_Style_Style::getTableRelWidth(), ODi_Office_Styles::getTableStyle(), ODi_Style_Style::getTableWidth(), m_col, m_columnRelWidths, m_columnWidths, m_elementLevel, m_gotAllColumnWidths, m_onContentStream, m_onFirstPass, m_pAbiDocument, m_pStyles, m_row, m_rowHeights, m_waitingEndElement, PTX_SectionTable, ODi_ListenerStateAction::pushState(), ODi_ListenerStateAction::repeatElement(), UT_ASSERT, and UT_getAttribute().
Referenced by startElement().
void ODi_Table_ListenerState::charData | ( | const gchar * | , | |
int | ||||
) | [inline, virtual] |
Implements ODi_ListenerState.
void ODi_Table_ListenerState::endElement | ( | const gchar * | pName, | |
ODi_ListenerStateAction & | rAction | |||
) | [virtual] |
Called when an "end of element" tag is parsed (like <myElementName>).
pName | The name of the element |
Implements ODi_ListenerState.
References PD_Document::appendStrux(), m_elementLevel, m_onFirstPass, m_pAbiDocument, m_waitingEndElement, ODi_ListenerStateAction::popState(), PTX_EndCell, PTX_EndTable, UT_ASSERT, and UT_DEBUGMSG.
void ODi_Table_ListenerState::startElement | ( | const gchar * | pName, | |
const gchar ** | ppAtts, | |||
ODi_ListenerStateAction & | rAction | |||
) | [virtual] |
Called when the XML parser finds a start element tag.
pName | The name of the element. | |
ppAtts | The attributes of the parsed start tag. |
Implements ODi_ListenerState.
References _parseCellStart(), _parseColumnStart(), _parseRowStart(), _parseTableStart(), m_col, m_elementLevel, m_waitingEndElement, and UT_ASSERT.
UT_sint16 ODi_Table_ListenerState::m_col [private] |
Referenced by _parseCellStart(), _parseRowStart(), _parseTableStart(), and startElement().
std::string ODi_Table_ListenerState::m_columnRelWidths [private] |
Referenced by _parseColumnStart(), and _parseTableStart().
std::string ODi_Table_ListenerState::m_columnWidths [private] |
Referenced by _parseColumnStart(), and _parseTableStart().
Referenced by _parseTableStart(), endElement(), and startElement().
bool ODi_Table_ListenerState::m_gotAllColumnWidths [private] |
Referenced by _parseColumnStart(), and _parseTableStart().
bool ODi_Table_ListenerState::m_onContentStream [private] |
Referenced by _parseCellStart(), _parseColumnStart(), _parseRowStart(), _parseTableStart(), and ODi_Table_ListenerState().
bool ODi_Table_ListenerState::m_onFirstPass [private] |
Referenced by _parseCellStart(), _parseColumnStart(), _parseRowStart(), _parseTableStart(), and endElement().
Referenced by _parseCellStart(), _parseTableStart(), and endElement().
Referenced by _parseCellStart(), _parseColumnStart(), _parseRowStart(), and _parseTableStart().
UT_sint16 ODi_Table_ListenerState::m_row [private] |
Referenced by _parseCellStart(), _parseRowStart(), and _parseTableStart().
std::string ODi_Table_ListenerState::m_rowHeights [private] |
Referenced by _parseRowStart(), and _parseTableStart().
Referenced by _parseRowStart().
std::string ODi_Table_ListenerState::m_waitingEndElement [private] |
Referenced by _parseTableStart(), endElement(), and startElement().