20 #ifndef Events_Loop_H_
21 #define Events_Loop_H_
23 #include <Events_Message.h>
24 #include <Events_Listener.h>
45 std::map<char*, std::map<void*, std::list<Events_Listener*> > > myListeners;
48 std::map<char*, Events_Listener*> myImmediateListeners;
51 std::map<char*, std::shared_ptr<Events_Message> > myGroups;
54 std::set<char*> myFlushed;
72 EVENTS_EXPORT
void send(
const std::shared_ptr<Events_Message>& theMessage,
bool isGroup =
true);
81 void* theSender = 0,
bool theImmediate =
false);
113 void sendProcessEvent(
const std::shared_ptr<Events_Message>& theMessage,
114 std::list<Events_Listener*>& theListeners,
const bool theFlushedNow);
Identifier of the event kind.
Definition: Events_Message.h:36
Base interface for any event listener.
Definition: Events_Listener.h:37
Base class that manages the receiving and sending of all not Qt-events in the application.
Definition: Events_Loop.h:43
EVENTS_EXPORT bool activateFlushes(const bool theActivate)
Allows to disable flushes: needed in synchronization of document mechanism (to synchronize all and on...
Definition: Events_Loop.cpp:244
EVENTS_EXPORT bool hasGrouppedEvent(const Events_ID &theID)
Returns true if a loop accumulated events to be flashed.
Definition: Events_Loop.cpp:273
EVENTS_EXPORT void setFlushed(const Events_ID &theID, const bool theValue)
Sets the flag that the event is flished right now.
Definition: Events_Loop.cpp:265
EVENTS_EXPORT void flush(const Events_ID &theID)
Initializes sending of a group-message by the given ID.
Definition: Events_Loop.cpp:183
EVENTS_EXPORT void removeListener(Events_Listener *theListener)
Remove the listener from internal maps if it was registered there.
Definition: Events_Loop.cpp:136
static EVENTS_EXPORT Events_Loop * loop()
! Returns the main object of the loop, one per application.
Definition: Events_Loop.cpp:26
EVENTS_EXPORT void send(const std::shared_ptr< Events_Message > &theMessage, bool isGroup=true)
Allows to send an event.
Definition: Events_Loop.cpp:66
EVENTS_EXPORT void registerListener(Events_Listener *theListener, const Events_ID theID, void *theSender=0, bool theImmediate=false)
Registers (or adds if such listener is already registered) a listener that will be called on the even...
Definition: Events_Loop.cpp:107
EVENTS_EXPORT bool isFlushed(const Events_ID &theID)
Returns true if the evement is flushed right now.
Definition: Events_Loop.cpp:260
static EVENTS_EXPORT Events_ID eventByName(const char *theName)
Returns the unique event by the given name.
Definition: Events_Loop.cpp:33
EVENTS_EXPORT void eraseMessages(const Events_ID &theID)
Removes messages with the given ID: they are not needed anymore (UPDATE on close)
Definition: Events_Loop.cpp:234
EVENTS_EXPORT void clear(const Events_ID &theID)
Clears all collected messages.
Definition: Events_Loop.cpp:251
Message that allows to group messages and send them later as a group of messages.
Definition: Events_MessageGroup.h:34