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
00029
00030 #ifndef _CEGUIEventSet_h_
00031 #define _CEGUIEventSet_h_
00032
00033 #include "CEGUIBase.h"
00034 #include "CEGUIString.h"
00035 #include "CEGUIEvent.h"
00036 #include "CEGUIIteratorBase.h"
00037 #include <map>
00038
00039 #if defined (_MSC_VER)
00040 # pragma warning(push)
00041 # pragma warning(disable : 4251)
00042 #endif
00043
00044
00045
00046 namespace CEGUI
00047 {
00066 class CEGUIEXPORT EventSet
00067 {
00068 public:
00073 EventSet();
00074
00075
00080 virtual ~EventSet(void);
00081
00082
00095 void addEvent(const String& name);
00096
00097
00108 void removeEvent(const String& name);
00109
00110
00118 void removeAllEvents(void);
00119
00120
00128 bool isEventPresent(const String& name);
00129
00130
00146 virtual Event::Connection subscribeEvent(const String& name, Event::Subscriber subscriber);
00147
00148
00168 virtual Event::Connection subscribeEvent(const String& name, Event::Group group, Event::Subscriber subscriber);
00169
00170
00186 virtual Event::Connection subscribeScriptedEvent(const String& name, const String& subscriber_name);
00187
00188
00208 virtual Event::Connection subscribeScriptedEvent(const String& name, Event::Group group, const String& subscriber_name);
00209
00210
00232 virtual void fireEvent(const String& name, EventArgs& args, const String& eventNamespace = "");
00233
00234
00243 bool isMuted(void) const;
00244
00245
00257 void setMutedState(bool setting);
00258
00259
00260 protected:
00280 Event* getEventObject(const String& name, bool autoAdd = false);
00281
00286 void fireEvent_impl(const String& name, EventArgs& args);
00287
00288
00289
00290 EventSet(EventSet& e) {}
00291 EventSet& operator=(EventSet& e) {return *this;}
00292
00293 typedef std::map<String, Event*, String::FastLessCompare> EventMap;
00294 EventMap d_events;
00295
00296 bool d_muted;
00297
00298 public:
00299
00300
00301
00302 typedef ConstBaseIterator<EventMap> Iterator;
00303
00309 Iterator getIterator(void) const;
00310 };
00311
00312 }
00313
00314
00315 #if defined(_MSC_VER)
00316 # pragma warning(pop)
00317 #endif
00318
00319 #endif // end of guard _CEGUIEventSet_h_