Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes

ODi_StreamListener Class Reference

This class parses the OpenDocument XML. More...

#include <ODi_StreamListener.h>

Inheritance diagram for ODi_StreamListener:
UT_XML::Listener

List of all members.

Classes

class  StackCell

Public Member Functions

 ODi_StreamListener (PD_Document *pAbiDocument, GsfInfile *pGsfInfile, ODi_Office_Styles *pStyles, ODi_Abi_Data &rAbiData, ODi_ElementStack *pElementStack=NULL)
 Constructor.
virtual ~ODi_StreamListener ()
 Destructor.
void startElement (const gchar *pName, const gchar **ppAtts)
void endElement (const gchar *pName)
void charData (const gchar *pBuffer, int length)
UT_Error setState (const char *pStateName)
 Sets the current state of the stream listener.
void setState (ODi_ListenerState *pState, bool deleteWhenPop)
void clearFontFaceDecls ()
ODi_ElementStackgetElementStack ()
ODi_ListenerStategetCurrentState ()

Private Types

enum  ODi_StreamListenerAction { ODI_NONE, ODI_RECORDING, ODI_IGNORING }

Private Member Functions

void _startElement (const gchar *pName, const gchar **ppAtts, bool doingRecursion)
void _endElement (const gchar *pName, bool doingRecursion)
void _handleStateAction ()
 Push or pop the stack according to the action stated by the current state.
void _clear ()
 Clear the state stack.
ODi_ListenerState_createState (const char *pStateName)
 Create a state given its name.
void _resumeParsing (ODi_Postpone_ListenerState *pPostponeState)
 Resumes the parsing of a XML element that was postponed.
void _playRecordedElement ()

Private Attributes

PD_Documentm_pAbiDocument
GsfInfile * m_pGsfInfile
ODi_Office_Stylesm_pStyles
ODi_Abi_Datam_rAbiData
ODi_FontFaceDecls m_fontFaceDecls
ODi_ListenerStateAction m_stateAction
ODi_ElementStackm_pElementStack
enum
ODi_StreamListener::ODi_StreamListenerAction 
m_currentAction
UT_sint32 m_elemenStackSize
ODi_XMLRecorder m_xmlRecorder
ODi_ListenerStatem_pCurrentState
bool m_deleteCurrentWhenPop
bool m_ownStack
UT_GenericVector
< ODi_StreamListener::StackCell
m_stateStack
UT_GenericVector
< ODi_Postpone_ListenerState * > 
m_postponedParsing

Detailed Description

This class parses the OpenDocument XML.

Its behaviour is distributed among several ODi_*_ListenerState classes. So, the code used for its functions depends on its current state.

It follows the State design pattern.


Member Enumeration Documentation

Enumerator:
ODI_NONE 
ODI_RECORDING 
ODI_IGNORING 

Constructor & Destructor Documentation

ODi_StreamListener::ODi_StreamListener ( PD_Document pAbiDocument,
GsfInfile *  pGsfInfile,
ODi_Office_Styles pStyles,
ODi_Abi_Data rAbiData,
ODi_ElementStack pElementStack = NULL 
)

Member Function Documentation

ODi_ListenerState * ODi_StreamListener::_createState ( const char *  pStateName  )  [private]

Create a state given its name.

Parameters:
pStateName Tha name of the state to be created.

References m_fontFaceDecls, m_pAbiDocument, m_pElementStack, m_pGsfInfile, m_pStyles, m_rAbiData, and UT_DEBUGMSG.

Referenced by _handleStateAction(), and setState().

void ODi_StreamListener::_handleStateAction (  )  [private]
void ODi_StreamListener::charData ( const gchar *  pBuffer,
int  length 
) [virtual]
void ODi_StreamListener::clearFontFaceDecls (  )  [inline]
void ODi_StreamListener::endElement ( const gchar *  pName  )  [inline, virtual]

Implements UT_XML::Listener.

References _endElement().

Referenced by _playRecordedElement(), and _resumeParsing().

ODi_ListenerState* ODi_StreamListener::getCurrentState (  )  [inline]

References m_pCurrentState.

ODi_ElementStack* ODi_StreamListener::getElementStack (  )  [inline]
UT_Error ODi_StreamListener::setState ( const char *  pStateName  ) 
void ODi_StreamListener::setState ( ODi_ListenerState pState,
bool  deleteWhenPop 
)
void ODi_StreamListener::startElement ( const gchar *  pName,
const gchar **  ppAtts 
) [inline, virtual]

Implements UT_XML::Listener.

References _startElement().

Referenced by _playRecordedElement(), and _resumeParsing().


Member Data Documentation


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