diff options
Diffstat (limited to 'sd/source/ui/inc/EventMultiplexer.hxx')
-rw-r--r-- | sd/source/ui/inc/EventMultiplexer.hxx | 76 |
1 files changed, 24 insertions, 52 deletions
diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx index 2e8aeb2fbe4a..45e8e8f84133 100644 --- a/sd/source/ui/inc/EventMultiplexer.hxx +++ b/sd/source/ui/inc/EventMultiplexer.hxx @@ -35,101 +35,93 @@ class ViewShellBase; } -enum class EventMultiplexerEventId : sal_uInt32 { +enum class EventMultiplexerEventId +{ /** The EventMultiplexer itself is being disposed. Called for a live EventMultiplexer. Removing a listener as response is not necessary, though. */ - Disposing = 0x00000001, + Disposing, /** The selection in the center pane has changed. */ - EditViewSelection = 0x00000002, + EditViewSelection, /** The selection in the slide sorter has changed, regardless of whether the slide sorter is displayed in the left pane or the center pane. */ - SlideSortedSelection = 0x00000004, + SlideSortedSelection, /** The current page has changed. */ - CurrentPageChanged = 0x00000008, + CurrentPageChanged, /** The current MainViewShell (the ViewShell displayed in the center pane) has been removed. */ - MainViewRemoved = 0x00000010, + MainViewRemoved, /** A new ViewShell has been made the MainViewShell. */ - MainViewAdded = 0x00000020, + MainViewAdded, /** A new ViewShell is being displayed in one of the panes. Note that for the ViewShell in the center pane both this event type and EventId::MainViewAdded is broadcasted. */ - ViewAdded = 0x00000040, + ViewAdded, /** The PaneManager is being destroyed. */ - PaneManagerDying = 0x00000080, + PaneManagerDying, /** Edit mode was (or is being) switched to normal mode. Find EventId::EditModeMaster below. */ - EditModeNormal = 0x00000100, + EditModeNormal, /** One or more pages have been inserted into or deleted from the model. */ - PageOrder = 0x00000200, + PageOrder, /** Text editing in one of the shapes in the MainViewShell has started. */ - BeginTextEdit = 0x00000400, + BeginTextEdit, /** Text editing in one of the shapes in the MainViewShell has ended. */ - EndTextEdit = 0x00000800, + EndTextEdit, /** A UNO controller has been attached to the UNO frame. */ - ControllerAttached = 0x00001000, + ControllerAttached, /** A UNO controller has been detached to the UNO frame. */ - ControllerDetached = 0x00002000, + ControllerDetached, /** The state of a shape has changed. The page is available in the user data. */ - ShapeChanged = 0x00004000, + ShapeChanged, /** A shape has been inserted to a page. The page is available in the user data. */ - ShapeInserted = 0x00008000, + ShapeInserted, /** A shape has been removed from a page. The page is available in the user data. */ - ShapeRemoved = 0x00010000, + ShapeRemoved, /** A configuration update has been completed. */ - ConfigurationUpdated = 0x00020000, + ConfigurationUpdated, /** Edit mode was (or is being) switched to master mode. */ - EditModeMaster = 0x00040000, - - /** Some constants that make it easier to remove a listener for all - event types at once. - */ - AllMask = 0x0007ffff, - NONE = 0x00000000 + EditModeMaster, }; -namespace o3tl { - template<> struct typed_flags<EventMultiplexerEventId> : is_typed_flags<EventMultiplexerEventId, 0x0007ffff> {}; -} namespace sd { namespace tools { @@ -150,14 +142,6 @@ public: There is usually one EventMultiplexer instance per ViewShellBase(). Call the laters GetEventMultiplexer() method to get access to that instance. - - When a listener is registered it can specify the events it - wants to be informed of. This can be done with code like the following: - - mrViewShellBase.GetEventMultiplexer().AddEventListener ( - LINK(this,MasterPagesSelector,EventMultiplexerListener), - EventMultiplexerEventId::MainViewAdded - | EventMultiplexerEventId::MainViewRemoved); */ class EventMultiplexer { @@ -172,24 +156,12 @@ public: @param rCallback The callback to call as soon as one of the event specified by aEventTypeSet is received by the EventMultiplexer. - @param aEventTypeSet - A, possibly empty, set of event types that the listener wants to - be informed about. */ - void AddEventListener ( - const Link<EventMultiplexerEvent&,void>& rCallback, - EventMultiplexerEventId aEventTypeSet); + void AddEventListener(const Link<EventMultiplexerEvent&,void>& rCallback); /** Remove an event listener for the specified event types. - @param aEventTypeSet - The listener will not be called anymore for any of the event - types in this set. Use EventMultiplexerEventId::AllMask, the default value, to - remove the listener for all event types it has been registered - for. - */ - void RemoveEventListener ( - const Link<EventMultiplexerEvent&,void>& rCallback, - EventMultiplexerEventId aEventTypeSet = EventMultiplexerEventId::AllMask); + */ + void RemoveEventListener(const Link<EventMultiplexerEvent&,void>& rCallback); /** This method is used for out-of-line events. An event of the specified type will be sent to all listeners that are registered for |