Public Types | Public Member Functions | Private Attributes

ODi_ListenerStateAction Class Reference

#include <ODi_ListenerStateAction.h>

List of all members.

Public Types

enum  {
  ACTION_NONE = 0, ACTION_PUSH = 1, ACTION_POP = 2, ACTION_POSTPONE = 3,
  ACTION_BRINGUP = 4, ACTION_BRINGUPALL = 5, ACTION_REPEAT = 6, ACTION_IGNORE = 7
}

Public Member Functions

void pushState (ODi_ListenerState *pListenerState, bool deleteWhenPop)
 Push a state on the top of the stack.
void pushState (const char *pStateName)
 Push a state on the top of the stack.
void popState ()
 Release the current state and pops another from the top of the stack (if there is one) to take its place.
void postponeElementParsing (ODi_ListenerState *pState, bool deleteWhenPop)
 Postpone the parsing of the current element.
void postponeElementParsing (const gchar *pStateName)
 Postpone the parsing of the current element.
void bringUpPostponedElements (bool comeBackAfter)
 Brings up all the postponed element parsing.
void bringUpMostRecentlyPostponedElement (const gchar *pStateName, bool comeBackAfter)
 Brings up the most recently postponed element (top of the stack) if it has the specified name.
void repeatElement ()
 Tells the StreamListener to repeat the current element parsing calls (startElement, endElement and charData) after having called then all once.
void ignoreElement (UT_sint32 elementLevel=-1)
 Tells the StreamListener to ignore an element that is being parsed.
void reset ()
 Reset/clear the action.
UT_uint32 getAction () const
ODi_ListenerStategetState ()
bool getDeleteWhenPop () const
const UT_StringgetStateName () const
bool getComeBackAfter () const
UT_sint32 getElementLevel () const

Private Attributes

UT_uint8 m_action
ODi_ListenerStatem_pState
UT_String m_stateName
bool m_deleteWhenPop
bool m_comeBackAfter
UT_sint32 m_elementLevel

Member Enumeration Documentation

anonymous enum
Enumerator:
ACTION_NONE 
ACTION_PUSH 
ACTION_POP 
ACTION_POSTPONE 
ACTION_BRINGUP 
ACTION_BRINGUPALL 
ACTION_REPEAT 
ACTION_IGNORE 

Member Function Documentation

void ODi_ListenerStateAction::bringUpMostRecentlyPostponedElement ( const gchar *  pStateName,
bool  comeBackAfter 
)

Brings up the most recently postponed element (top of the stack) if it has the specified name.

References m_action, m_comeBackAfter, m_pState, and m_stateName.

Referenced by ODi_TextContent_ListenerState::_endParagraphElement().

void ODi_ListenerStateAction::bringUpPostponedElements ( bool  comeBackAfter  ) 

Brings up all the postponed element parsing.

References UT_String::clear(), m_action, m_comeBackAfter, m_pState, and m_stateName.

Referenced by ODi_TextContent_ListenerState::endElement().

UT_uint32 ODi_ListenerStateAction::getAction (  )  const [inline]
bool ODi_ListenerStateAction::getComeBackAfter (  )  const [inline]
bool ODi_ListenerStateAction::getDeleteWhenPop (  )  const [inline]
UT_sint32 ODi_ListenerStateAction::getElementLevel (  )  const [inline]
ODi_ListenerState* ODi_ListenerStateAction::getState (  )  [inline]
const UT_String& ODi_ListenerStateAction::getStateName (  )  const [inline]
void ODi_ListenerStateAction::ignoreElement ( UT_sint32  elementLevel = -1  ) 

Tells the StreamListener to ignore an element that is being parsed.

OBS: The next call received by the ListenerState will be the endElement() of the ignored element.

Parameters:
elementLevel The level of the element that will be ignored, as defined by ODi_ElementStack::getStartTag(). -1 if it's the element that has just been opened (the one specified by startElement()).

References UT_String::clear(), m_action, m_elementLevel, m_pState, and m_stateName.

Referenced by ODi_Frame_ListenerState::_drawImage(), ODi_Frame_ListenerState::_drawObject(), ODi_Frame_ListenerState::_drawTextBox(), ODi_TextContent_ListenerState::startElement(), and ODi_Frame_ListenerState::startElement().

void ODi_ListenerStateAction::popState (  ) 
void ODi_ListenerStateAction::postponeElementParsing ( ODi_ListenerState pState,
bool  deleteWhenPop 
)

Postpone the parsing of the current element.

Parameters:
pState The state that should be used to parse this element.
deleteWhenPop If the state should be deleted after use (when popped).

References UT_String::clear(), m_action, m_deleteWhenPop, m_pState, and m_stateName.

Referenced by ODi_TextContent_ListenerState::startElement(), and ODi_Style_MasterPage::startElement().

void ODi_ListenerStateAction::postponeElementParsing ( const gchar *  pStateName  ) 

Postpone the parsing of the current element.

Parameters:
pStateName The name of the state that should be used to parse this element.

References m_action, m_deleteWhenPop, m_pState, and m_stateName.

void ODi_ListenerStateAction::pushState ( const char *  pStateName  ) 

Push a state on the top of the stack.

Parameters:
pStateName The name of the state to be pushed onto the stack.

References m_action, m_deleteWhenPop, m_pState, and m_stateName.

void ODi_ListenerStateAction::pushState ( ODi_ListenerState pListenerState,
bool  deleteWhenPop 
)

Push a state on the top of the stack.

Parameters:
pListenerState The state to be pushed. It isn't deleted when popped afterwards.
deleteWhenPop If the state should be deleted after use (when popped).
pListenerState The state to be pushed. It isn't deleted when popped afterwards.

References UT_String::clear(), m_action, m_deleteWhenPop, m_pState, m_stateName, and UT_ASSERT.

Referenced by ODi_Frame_ListenerState::_drawTextBox(), ODi_Table_ListenerState::_parseCellStart(), ODi_Table_ListenerState::_parseTableStart(), ODi_TextContent_ListenerState::startElement(), ODi_StylesStream_ListenerState::startElement(), ODi_Style_MasterPage::startElement(), ODi_Style_List::startElement(), ODi_Frame_ListenerState::startElement(), and ODi_ContentStream_ListenerState::startElement().

void ODi_ListenerStateAction::repeatElement (  ) 

Tells the StreamListener to repeat the current element parsing calls (startElement, endElement and charData) after having called then all once.

Useful for ListenerStates that have to pass twice through a XML element.

References UT_String::clear(), m_action, m_pState, and m_stateName.

Referenced by ODi_Table_ListenerState::_parseRowStart(), ODi_Table_ListenerState::_parseTableStart(), and ODi_Style_MasterPage::startElement().

void ODi_ListenerStateAction::reset (  ) 

Member Data Documentation


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