00001 #ifndef GUI_EVENTMANAGER_HPP 00002 #define GUI_EVENTMANAGER_HPP 00003 00004 #include <utils.hpp> 00005 #include <string> 00006 #include <map> 00007 #include <vector> 00008 00009 namespace gui 00010 { 00011 class event_receiver; 00012 class event; 00013 00015 class event_manager 00016 { 00017 public : 00018 00020 00023 void register_event(event_receiver* pReceiver, const std::string& sEvent); 00024 00026 00029 void unregister_event(event_receiver* pReceiver, const std::string& sEvent); 00030 00032 00034 void unregister_receiver(event_receiver* pReceiver); 00035 00037 00042 void fire_event(const event& mEvent); 00043 00045 void frame_ended(); 00046 00047 private : 00048 00049 std::multimap<std::string, event_receiver*> lReceiverList_; 00050 std::vector<std::string> lFiredEventList_; 00051 }; 00052 00053 } 00054 00055 #endif