Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _ODI_LISTENERSTATEACTION_H_
00023 #define _ODI_LISTENERSTATEACTION_H_
00024
00025
00026 #include <ut_assert.h>
00027 #include <ut_string_class.h>
00028 #include <ut_types.h>
00029
00030
00031 class ODi_ListenerState;
00032
00033
00037 class ODi_ListenerStateAction {
00038
00039 public:
00040
00041 enum {
00042 ACTION_NONE = 0,
00043 ACTION_PUSH = 1,
00044 ACTION_POP = 2,
00045 ACTION_POSTPONE = 3,
00046 ACTION_BRINGUP = 4,
00047 ACTION_BRINGUPALL = 5,
00048 ACTION_REPEAT = 6,
00049 ACTION_IGNORE = 7
00050 };
00051
00060 void pushState(ODi_ListenerState* pListenerState, bool deleteWhenPop);
00061
00067 void pushState(const char* pStateName);
00068
00073 void popState();
00074
00081 void postponeElementParsing(ODi_ListenerState* pState, bool deleteWhenPop);
00082
00089 void postponeElementParsing(const gchar* pStateName);
00090
00094 void bringUpPostponedElements(bool comeBackAfter);
00095
00100 void bringUpMostRecentlyPostponedElement(const gchar* pStateName,
00101 bool comeBackAfter);
00102
00109 void repeatElement();
00110
00122 void ignoreElement(UT_sint32 elementLevel = -1);
00123
00127 void reset();
00128
00129
00130 UT_uint32 getAction() const {return m_action;}
00131 ODi_ListenerState* getState() {return m_pState;}
00132 bool getDeleteWhenPop() const {return m_deleteWhenPop;}
00133 const UT_String& getStateName() const {return m_stateName;}
00134 bool getComeBackAfter() const {return m_comeBackAfter;}
00135 UT_sint32 getElementLevel() const {return m_elementLevel;}
00136
00137 private:
00138
00139 UT_uint8 m_action;
00140 ODi_ListenerState* m_pState;
00141 UT_String m_stateName;
00142 bool m_deleteWhenPop;
00143 bool m_comeBackAfter;
00144 UT_sint32 m_elementLevel;
00145 };
00146
00147 #endif //_ODI_LISTENERSTATEACTION_H_