Public Member Functions | Private Member Functions | Private Attributes

ODi_Table_ListenerState Class Reference

Used to parse <table:table> elements. More...

#include <ODi_Table_ListenerState.h>

Inheritance diagram for ODi_Table_ListenerState:
ODi_ListenerState

List of all members.

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_Documentm_pAbiDocument
ODi_Office_Stylesm_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

Detailed Description

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).


Constructor & Destructor Documentation

ODi_Table_ListenerState::ODi_Table_ListenerState ( PD_Document pDocument,
ODi_Office_Styles pStyles,
ODi_ElementStack rElementStack 
)
virtual ODi_Table_ListenerState::~ODi_Table_ListenerState (  )  [inline, virtual]

Member Function Documentation

void ODi_Table_ListenerState::_parseColumnStart ( const gchar **  ppAtts,
ODi_ListenerStateAction rAction 
) [private]
void ODi_Table_ListenerState::_parseRowStart ( const gchar **  ppAtts,
ODi_ListenerStateAction rAction 
) [private]
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>).

Parameters:
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.

Parameters:
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.


Member Data Documentation


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