00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
#ifndef UEVENT_HPP
00029 
#define UEVENT_HPP
00030 
00031 
#include "../uobject.hpp"
00032 
00033 
namespace ufo {
00034 
00041 class UFO_EXPORT UEvent : 
public UObject {
00042     UFO_DECLARE_DYNAMIC_CLASS(UEvent)
00043 
public:
00044     enum Type {
00045         NoEvent = 0,
00047         Timer = 1,
00049         Action = 2,
00051         RunnableEvent = 3,
00053         QuitEvent = 4,
00055         Repaint = 5,
00057         Refresh = 6,
00058 
00059         MousePressed = 10, 
00060         MouseReleased = 11,
00061         MouseClicked = 12,
00062         MouseMoved = 13,
00063         MouseDragged = 14,
00065         MouseEntered = 15,
00067         MouseExited = 16,
00068 
00069         MouseWheel = 19,
00070 
00071         KeyPressed = 20,
00072         KeyReleased = 21,
00074         KeyTyped = 22,
00075         Shortcut = 23,
00076 
00078         FocusGained = 25,
00080         FocusLost = 26,
00081 
00082         WidgetMoved = 30,
00083         WidgetResized = 31,
00084 
00085         WidgetShown = 32,
00086         WidgetHidden = 33,
00087 
00089         WidgetAdded = 34,
00091         WidgetRemoved = 35,
00093         WidgetZOrderChanged = 36,
00094 
00096         PropertyChanged = 40
00097     };
00098 
00099 
public:
00100     UEvent(
UObject * sourceA, Type idA);
00101 
00103     
UObject * getSource() const;
00105     
void setSource(
UObject * newSourceA);
00106 
00108     Type getType() const;
00109 
00113     virtual 
void consume();
00114 
00119     virtual 
bool isConsumed() const;
00120 
00121 protected: 
00122     virtual std::ostream & paramString(std::ostream & os) const;
00123 
00124 protected:  
00126     UObject * m_source;
00128     Type m_type;
00132     bool m_isConsumed;
00133 };
00134 
00135 } 
00136 
00137 #endif