#include <ODi_ListenerStateAction.h>
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_ListenerState * | getState () |
bool | getDeleteWhenPop () const |
const UT_String & | getStateName () const |
bool | getComeBackAfter () const |
UT_sint32 | getElementLevel () const |
Private Attributes | |
UT_uint8 | m_action |
ODi_ListenerState * | m_pState |
UT_String | m_stateName |
bool | m_deleteWhenPop |
bool | m_comeBackAfter |
UT_sint32 | m_elementLevel |
anonymous enum |
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] |
References m_action.
Referenced by ODi_StreamListener::_endElement(), ODi_StreamListener::_handleStateAction(), and ODi_StreamListener::_startElement().
bool ODi_ListenerStateAction::getComeBackAfter | ( | ) | const [inline] |
References m_comeBackAfter.
Referenced by ODi_StreamListener::_handleStateAction().
bool ODi_ListenerStateAction::getDeleteWhenPop | ( | ) | const [inline] |
References m_deleteWhenPop.
Referenced by ODi_StreamListener::_handleStateAction().
UT_sint32 ODi_ListenerStateAction::getElementLevel | ( | ) | const [inline] |
References m_elementLevel.
Referenced by ODi_StreamListener::_handleStateAction().
ODi_ListenerState* ODi_ListenerStateAction::getState | ( | ) | [inline] |
References m_pState.
Referenced by ODi_StreamListener::_handleStateAction().
const UT_String& ODi_ListenerStateAction::getStateName | ( | ) | const [inline] |
References m_stateName.
Referenced by ODi_StreamListener::_handleStateAction().
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.
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 | ( | ) |
Release the current state and pops another from the top of the stack (if there is one) to take its place.
References UT_String::clear(), m_action, m_pState, and m_stateName.
Referenced by ODi_StreamListener::_handleStateAction(), ODi_TextContent_ListenerState::endElement(), ODi_TableOfContent_ListenerState::endElement(), ODi_Table_ListenerState::endElement(), ODi_StylesStream_ListenerState::endElement(), ODi_Style_Style::endElement(), ODi_Style_PageLayout::endElement(), ODi_Style_MasterPage::endElement(), ODi_Style_List::endElement(), ODi_Postpone_ListenerState::endElement(), ODi_NotesConfiguration::endElement(), ODi_MetaStream_ListenerState::endElement(), ODi_ManifestStream_ListenerState::endElement(), ODi_ListLevelStyle::endElement(), ODi_Frame_ListenerState::endElement(), ODi_FontFaceDecls::endElement(), ODi_ContentStreamAnnotationMatcher_ListenerState::endElement(), and ODi_ContentStream_ListenerState::endElement().
void ODi_ListenerStateAction::postponeElementParsing | ( | ODi_ListenerState * | pState, | |
bool | deleteWhenPop | |||
) |
Postpone the parsing of the current element.
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.
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.
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.
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 | ( | ) |
Reset/clear the action.
References UT_String::clear(), m_action, m_elementLevel, m_pState, and m_stateName.
Referenced by ODi_StreamListener::_endElement(), and ODi_StreamListener::_startElement().
UT_uint8 ODi_ListenerStateAction::m_action [private] |
bool ODi_ListenerStateAction::m_comeBackAfter [private] |
Referenced by bringUpMostRecentlyPostponedElement(), bringUpPostponedElements(), and getComeBackAfter().
bool ODi_ListenerStateAction::m_deleteWhenPop [private] |
Referenced by getDeleteWhenPop(), postponeElementParsing(), and pushState().
Referenced by getElementLevel(), ignoreElement(), and reset().