00001 /*************************************************************************** 00002 LibUFO - UI For OpenGL 00003 copyright : (C) 2001-2005 by Johannes Schmidt 00004 email : schmidtjf at users.sourceforge.net 00005 ------------------- 00006 00007 file : include/ufo/events/upropertychangeevent.hpp 00008 begin : Tue May 8 2001 00009 $Id: upropertychangeevent.hpp,v 1.10 2005/05/21 15:17:23 schmidtjf Exp $ 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * This library is free software; you can redistribute it and/or * 00014 * modify it under the terms of the GNU Lesser General Public * 00015 * License as published by the Free Software Foundation; either * 00016 * version 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00021 * Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00026 ***************************************************************************/ 00027 00028 #ifndef UPROPERTYCHANGEEVENT_HPP 00029 #define UPROPERTYCHANGEEVENT_HPP 00030 00031 #include "uevent.hpp" 00032 00033 namespace ufo { 00034 00041 class UFO_EXPORT UPropertyChangeEvent : public UEvent { 00042 UFO_DECLARE_DYNAMIC_CLASS(UPropertyChangeEvent) 00043 public: 00044 UPropertyChangeEvent(UObject * source, Type type, 00045 const std::string & propName, 00046 UObject * oldValue, UObject * newValue) 00047 : UEvent(source, type) 00048 , m_propName(propName) 00049 , m_oldValue(oldValue) 00050 , m_newValue(newValue) {} 00051 00053 const std::string & getPropertyName() const { 00054 return m_propName; 00055 } 00056 00058 UObject * getOldValue() const { 00059 return m_oldValue; 00060 } 00061 00063 UObject * getNewValue() const { 00064 return m_newValue; 00065 } 00066 00067 protected: // Protected methods 00068 virtual std::ostream & paramString(std::ostream & os) const; 00069 00070 protected: // Protected attributes 00071 std::string m_propName; 00072 00073 UObject * m_oldValue; 00074 UObject * m_newValue; 00075 }; 00076 00077 } // namespace ufo 00078 00079 #endif // UPROPERTYCHANGEEVENT_HPP