LibreOffice Module sd (master) 1
SlsListener.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
23#include <com/sun/star/document/XEventListener.hpp>
24#include <com/sun/star/beans/XPropertyChangeListener.hpp>
25#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
26#include <com/sun/star/frame/XFrameActionListener.hpp>
29
30#include <svl/lstner.hxx>
31#include <tools/link.hxx>
32#include <memory>
33
34class SdrPage;
35
36namespace sd {
37class ViewShellBase;
38}
39
40namespace sd::tools { class EventMultiplexerEvent; }
41namespace sd::slidesorter { class SlideSorter; }
42
44
46 css::document::XEventListener,
47 css::beans::XPropertyChangeListener,
48 css::accessibility::XAccessibleEventListener,
49 css::frame::XFrameActionListener
51
61 : public ListenerInterfaceBase,
62 public SfxListener
63{
64public:
65 explicit Listener (SlideSorter& rSlideSorter);
66 virtual ~Listener() override;
67
75
83
84 virtual void Notify (
85 SfxBroadcaster& rBroadcaster,
86 const SfxHint& rHint) override;
87
88 //===== lang::XEventListener ============================================
89 virtual void SAL_CALL
90 disposing (const css::lang::EventObject& rEventObject) override;
91
92 //===== document::XEventListener ========================================
93 virtual void SAL_CALL
95 const css::document::EventObject& rEventObject) override;
96
97 //===== beans::XPropertySetListener =====================================
98 virtual void SAL_CALL
100 const css::beans::PropertyChangeEvent& rEvent) override;
101
102 //===== accessibility::XAccessibleEventListener ==========================
103 virtual void SAL_CALL
105 const css::accessibility::AccessibleEventObject&
106 rEvent) override;
107
108 //===== frame::XFrameActionListener ======================================
113 virtual void SAL_CALL
114 frameAction (const css::frame::FrameActionEvent& rEvent) override;
115
116 virtual void disposing(std::unique_lock<std::mutex>&) override;
117
118private:
122
132
133 css::uno::WeakReference< css::frame::XController> mxControllerWeak;
134 css::uno::WeakReference< css::frame::XFrame> mxFrameWeak;
135
140 std::shared_ptr<SlideSorterController::ModelChangeLock> mpModelChangeLock;
141
142 void ReleaseListeners();
143
146 void UpdateEditMode();
147
151 void HandleModelChange (const SdrPage* pPage);
152
157 void HandleShapeModification (const SdrPage* pPage);
158
159 DECL_LINK(EventMultiplexerCallback, tools::EventMultiplexerEvent&, void);
160};
161
162} // end of namespace ::sd::slidesorter::controller
163
164/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
Listen for events of various types and sources and react to them.
Definition: SlsListener.hxx:63
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &rEvent) override
css::uno::WeakReference< css::frame::XFrame > mxFrameWeak
void HandleModelChange(const SdrPage *pPage)
Handle a change in the order of slides or when the set of slides has changed, i.e.
void DisconnectFromController()
Disconnect from the current controller of the view shell as listener.
css::uno::WeakReference< css::frame::XController > mxControllerWeak
bool mbListeningToFrame
Remember whether we are listening to the frame.
void ConnectToController()
Connect to the current controller of the view shell as listener.
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &rEvent) override
For certain actions the listener connects to a new controller of the frame it is listening to.
virtual void SAL_CALL notifyEvent(const css::document::EventObject &rEventObject) override
virtual void Notify(SfxBroadcaster &rBroadcaster, const SfxHint &rHint) override
bool mbListeningToDocument
Remember whether we are listening to the document.
std::shared_ptr< SlideSorterController::ModelChangeLock > mpModelChangeLock
This object is used to lock the model between some events.
Listener(SlideSorter &rSlideSorter)
Definition: SlsListener.cxx:55
void HandleShapeModification(const SdrPage *pPage)
Handle a modification to a shape on the given page.
bool mbListeningToController
Remember whether we are listening to the UNO controller.
SlideSorterController & mrController
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEvent) override
void UpdateEditMode()
Called when the edit mode has changed.
bool mbListeningToUNODocument
Remember whether we are listening to the UNO document.
virtual void SAL_CALL disposing(const css::lang::EventObject &rEventObject) override
DECL_LINK(EventMultiplexerCallback, tools::EventMultiplexerEvent &, void)
comphelper::WeakComponentImplHelper< css::document::XEventListener, css::beans::XPropertyChangeListener, css::accessibility::XAccessibleEventListener, css::frame::XFrameActionListener > ListenerInterfaceBase
Definition: SlsListener.hxx:50