• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ODi_ListenerStateAction.h

Go to the documentation of this file.
00001 /* AbiSource
00002  *
00003  * Copyright (C) 2005 Daniel d'Andrada T. de Carvalho
00004  * <daniel.carvalho@indt.org.br>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 #ifndef _ODI_LISTENERSTATEACTION_H_
00023 #define _ODI_LISTENERSTATEACTION_H_
00024 
00025 // AbiWord includes
00026 #include <ut_assert.h>
00027 #include <ut_string_class.h>
00028 #include <ut_types.h>
00029 
00030 // Internal classes
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_

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1