+ //! \param theListener the object that will listen (process) the event
+ //! \param theID listen for messages with this ID
+ //! \param theSender listen only for this sender (NULL - listen everybody)
+ //! \param theImmediate for listeners who can not wait (no groupping mechanism is used for it)
+ EVENTS_EXPORT void registerListener(Events_Listener* theListener, const Events_ID theID,
+ void* theSender = 0, bool theImmediate = false);
+
+ //! Remove the listener from internal maps if it was registered there
+ //! \param theListener a listener
+ EVENTS_EXPORT void removeListener(Events_Listener* theListener);
+
+ //! Initializes sending of a group-message by the given ID
+ EVENTS_EXPORT void flush(const Events_ID& theID);
+
+ //! Removes messages with the given ID: they are not needed anymore (UPDATE on close)
+ EVENTS_EXPORT void eraseMessages(const Events_ID& theID);
+
+ //! Allows to disable flushes: needed in synchronization of document mechanism
+ //! (to synchronize all and only then flush create, update, etc in correct order)
+ //! \param theActivate a state about flushe is active. If false, the flush is disabled
+ //! \return the previous active flush state
+ EVENTS_EXPORT bool activateFlushes(const bool theActivate);
+
+ //! Clears all collected messages
+ EVENTS_EXPORT void clear(const Events_ID& theID);
+
+ //! Returns true if the evement is flushed right now
+ EVENTS_EXPORT bool isFlushed(const Events_ID& theID);
+ //! Sets the flag that the event is flished right now
+ EVENTS_EXPORT void setFlushed(const Events_ID& theID, const bool theValue);
+
+ //! Returns true if a loop accumulated events to be flashed
+ EVENTS_EXPORT bool hasGrouppedEvent(const Events_ID& theID);
+
+private:
+ //! Calls "processEvent" for the given listeners.
+ //! If theFlushedNow for grouped listeners is stores message in listeners.
+ void sendProcessEvent(const std::shared_ptr<Events_Message>& theMessage,
+ std::list<Events_Listener*>& theListeners, const bool theFlushedNow);
+