00001 /* AbiSource 00002 * 00003 * Copyright (C) 2005 INdT 00004 * Author: Daniel d'Andrada T. de Carvalho <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 ODE_LISTENERACTION_H_ 00023 #define ODE_LISTENERACTION_H_ 00024 00025 // AbiWord includes 00026 #include <ut_types.h> 00027 00028 // Internal classes 00029 class ODe_AbiDocListenerImpl; 00030 00031 00036 class ODe_ListenerAction { 00037 public: 00038 00039 enum { 00040 ACTION_NONE = 0, 00041 ACTION_PUSH = 1, 00042 ACTION_POP = 2 00043 }; 00044 00045 void pushListenerImpl(ODe_AbiDocListenerImpl* pListenerImpl, bool _deleteWhenPop) { 00046 m_action = ACTION_PUSH; 00047 m_pListenerImpl = pListenerImpl; 00048 m_deleteWhenPop = _deleteWhenPop; 00049 } 00050 00051 void popListenerImpl() { 00052 m_action = ACTION_POP; 00053 } 00054 00055 UT_uint8 getAction() const { 00056 return m_action; 00057 } 00058 00059 ODe_AbiDocListenerImpl* getListenerImpl() const { 00060 return m_pListenerImpl; 00061 } 00062 00063 bool deleteWhenPop() const {return m_deleteWhenPop;} 00064 00065 void reset() { 00066 m_action = ACTION_NONE; 00067 m_pListenerImpl = NULL; 00068 } 00069 00070 private: 00071 UT_uint8 m_action; 00072 ODe_AbiDocListenerImpl* m_pListenerImpl; 00073 bool m_deleteWhenPop; 00074 }; 00075 00076 #endif /*ODE_LISTENERACTION_H_*/