00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PAPYRUSCONTROLLER_H
00020 #define PAPYRUSCONTROLLER_H
00021
00022 #include <sigc++/sigc++.h>
00023
00024 #include <papyrus/smart_pointer.h>
00025 #include <papyrus/event.h>
00026
00027 namespace Papyrus {
00028
00032 class Controller {
00033 public:
00034
00035 typedef PapyrusSmartPointer<Controller> pointer;
00036
00037 Controller();
00038
00039 virtual ~Controller();
00040
00041 virtual bool is_disabled();
00042
00043 virtual bool disable(bool value=true);
00044
00045 virtual bool enable(bool value=true);
00046
00047 sigc::signal<void,bool> signal_disabled();
00048
00049 virtual bool handle(const Event::Event& event);
00050 virtual bool handle(const Event::Button& event);
00051 virtual bool handle(const Event::ButtonPress& event);
00052 virtual bool handle(const Event::ButtonDoublePress& event);
00053 virtual bool handle(const Event::ButtonTriplePress& event);
00054 virtual bool handle(const Event::ButtonRelease& event);
00055 virtual bool handle(const Event::Key& event);
00056 virtual bool handle(const Event::KeyPress& event);
00057 virtual bool handle(const Event::KeyRelease& event);
00058 virtual bool handle(const Event::Motion& event);
00059 virtual bool handle(const Event::Scroll& event);
00060
00061 protected:
00062 bool m_disabled;
00063
00064 sigc::signal<void,bool> m_signal_disabled;
00065
00066 virtual bool on_button_press(const Event::ButtonPress& event);
00067 virtual bool on_button_double_press(const Event::ButtonDoublePress& event);
00068 virtual bool on_button_triple_press(const Event::ButtonTriplePress& event);
00069 virtual bool on_button_release(const Event::ButtonRelease& event);
00070 virtual bool on_key_press(const Event::KeyPress& event);
00071 virtual bool on_key_release(const Event::KeyRelease& event);
00072 virtual bool on_motion(const Event::Motion& event);
00073 virtual bool on_scroll(const Event::Scroll& event);
00074
00075 };
00076
00077 }
00078
00079 #endif