LibreOffice Module sd (master) 1
PresenterController.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#ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCONTROLLER_HXX
21#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCONTROLLER_HXX
22
25#include "PresenterTheme.hxx"
28#include <com/sun/star/awt/XKeyListener.hpp>
29#include <com/sun/star/awt/XMouseListener.hpp>
30#include <com/sun/star/drawing/XPresenterHelper.hpp>
31#include <com/sun/star/frame/XController.hpp>
32#include <com/sun/star/frame/XDispatch.hpp>
33#include <com/sun/star/presentation/XSlideShowController.hpp>
34#include <com/sun/star/frame/XFrameActionListener.hpp>
35#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp>
36#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
37#include <com/sun/star/drawing/framework/XPane.hpp>
38#include <com/sun/star/uno/XComponentContext.hpp>
39#include <com/sun/star/util/XURLTransformer.hpp>
40#include <rtl/ref.hxx>
41#include <unotools/weakref.hxx>
42#include <map>
43#include <memory>
44
45namespace sd { class DrawController; }
46
47namespace sdext::presenter {
48
49class PresenterCanvasHelper;
50class PresenterPaintManager;
51class PresenterPaneAnimator;
52class PresenterPaneContainer;
53class PresenterPaneBorderPainter;
54class PresenterScreen;
55class PresenterTheme;
56class PresenterWindowManager;
57
58typedef ::cppu::WeakComponentImplHelper <
59 css::drawing::framework::XConfigurationChangeListener,
60 css::frame::XFrameActionListener,
61 css::awt::XKeyListener,
62 css::awt::XMouseListener
64
67{
68public:
69 virtual void restart() = 0;
70 virtual bool isPaused() = 0;
71 virtual void setPauseStatus(const bool pauseStatus) = 0;
72 virtual ~IPresentationTime();
73};
74
80 : protected ::cppu::BaseMutex,
82{
83public:
84 static ::rtl::Reference<PresenterController> Instance (
85 const css::uno::Reference<css::frame::XFrame>& rxFrame);
86
89 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
90 const rtl::Reference<::sd::DrawController>& rxController,
91 const css::uno::Reference<css::presentation::XSlideShowController>& rxSlideShowController,
93 const css::uno::Reference<css::drawing::framework::XResourceId>& rxMainPaneId);
94 virtual ~PresenterController() override;
95
96 virtual void SAL_CALL disposing() override;
97
98 void UpdateCurrentSlide (const sal_Int32 nOffset);
99
101 GetViewBackground (const OUString& rsViewURL) const;
103 GetViewFont (const OUString& rsViewURL) const;
104 const std::shared_ptr<PresenterTheme>& GetTheme() const;
105 const ::rtl::Reference<PresenterWindowManager>& GetWindowManager() const;
106 const css::uno::Reference<css::presentation::XSlideShowController>&
109 const ::rtl::Reference<PresenterPaneBorderPainter>& GetPaneBorderPainter() const;
110 const std::shared_ptr<PresenterCanvasHelper>& GetCanvasHelper() const;
111 const css::uno::Reference<css::drawing::XPresenterHelper>& GetPresenterHelper() const;
112 const std::shared_ptr<PresenterPaintManager>& GetPaintManager() const;
113 double GetSlideAspectRatio() const;
114 void ShowView (const OUString& rsViewURL);
115 void HideView (const OUString& rsViewURL);
116 void SwitchMonitors();
117 void ExitPresenter();
118 void DispatchUnoCommand (const OUString& rsCommand) const;
119 css::uno::Reference<css::frame::XDispatch> GetDispatch (
120 const css::util::URL& rURL) const;
121 css::util::URL CreateURLFromString (const OUString& rsURL) const;
122 const css::uno::Reference<css::drawing::framework::XConfigurationController>&
124 const css::uno::Reference<css::drawing::XDrawPage>& GetCurrentSlide() const;
125 static bool HasTransition (css::uno::Reference<css::drawing::XDrawPage> const & rxPage);
126 static bool HasCustomAnimation (css::uno::Reference<css::drawing::XDrawPage> const & rxPage);
127 void SetAccessibilityActiveState (const bool bIsActive);
129
130 void HandleMouseClick (const css::awt::MouseEvent& rEvent);
131 void UpdatePaneTitles();
132
136 void RequestViews (
137 const bool bIsSlideSorterActive,
138 const bool bIsNotesViewActive,
139 const bool bIsHelpViewActive);
140
141 void SetPresentationTime(IPresentationTime* pPresentationTime);
143
144 // XConfigurationChangeListener
145
146 virtual void SAL_CALL notifyConfigurationChange (
147 const css::drawing::framework::ConfigurationChangeEvent& rEvent) override;
148
149 // XEventListener
150
151 virtual void SAL_CALL disposing (
152 const css::lang::EventObject& rEvent) override;
153
154 // XFrameActionListener
155
156 virtual void SAL_CALL frameAction (
157 const css::frame::FrameActionEvent& rEvent) override;
158
159 // XKeyListener
160
161 virtual void SAL_CALL keyPressed (const css::awt::KeyEvent& rEvent) override;
162 virtual void SAL_CALL keyReleased (const css::awt::KeyEvent& rEvent) override;
163
164 // XMouseListener
165
166 virtual void SAL_CALL mousePressed (const css::awt::MouseEvent& rEvent) override;
167
168 virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent& rEvent) override;
169
170 virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent& rEvent) override;
171
172 virtual void SAL_CALL mouseExited (const css::awt::MouseEvent& rEvent) override;
173
174private:
175 typedef ::std::map<css::uno::Reference<css::frame::XFrame>,rtl::Reference<PresenterController> > InstanceContainer;
177
179 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
180 css::uno::Reference<css::rendering::XSpriteCanvas> mxCanvas;
182 css::uno::Reference<css::drawing::framework::XConfigurationController>
184 css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController;
185 css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId;
188 css::uno::Reference<css::drawing::XDrawPage> mxCurrentSlide;
189 css::uno::Reference<css::drawing::XDrawPage> mxNextSlide;
191 std::shared_ptr<PresenterTheme> mpTheme;
192 css::uno::Reference<css::awt::XWindow> mxMainWindow;
194 std::shared_ptr<PresenterCanvasHelper> mpCanvasHelper;
195 css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
196 std::shared_ptr<PresenterPaintManager> mpPaintManager;
198 css::uno::Reference<css::util::XURLTransformer> mxUrlTransformer;
202
203 void GetSlides (const sal_Int32 nOffset);
204 void UpdateViews();
205 void InitializeMainPane (const css::uno::Reference<css::drawing::framework::XPane>& rxPane);
206 void LoadTheme (const css::uno::Reference<css::drawing::framework::XPane>& rxPane);
207 void UpdatePendingSlideNumber (const sal_Int32 nPendingSlideNumber);
208
219 void HandleNumericKeyPress (const sal_Int32 nKey, const sal_Int32 nModifiers);
220};
221
222} // end of namespace ::sdext::presenter
223
224#endif
225
226/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents an element in the toolbar that shows the time elapsed since the presentation started.
virtual void setPauseStatus(const bool pauseStatus)=0
The controller of the presenter screen is responsible for telling the individual views which slides t...
void SetAccessibilityActiveState(const bool bIsActive)
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &rEvent) override
css::uno::Reference< css::presentation::XSlideShowController > mxSlideShowController
void GetSlides(const sal_Int32 nOffset)
const std::shared_ptr< PresenterPaintManager > & GetPaintManager() const
rtl::Reference<::sd::DrawController > mxController
void SetPresentationTime(IPresentationTime *pPresentationTime)
css::uno::Reference< css::drawing::XPresenterHelper > mxPresenterHelper
void InitializeMainPane(const css::uno::Reference< css::drawing::framework::XPane > &rxPane)
virtual void SAL_CALL notifyConfigurationChange(const css::drawing::framework::ConfigurationChangeEvent &rEvent) override
virtual void SAL_CALL keyPressed(const css::awt::KeyEvent &rEvent) override
const css::uno::Reference< css::drawing::framework::XConfigurationController > & GetConfigurationController() const
void HandleMouseClick(const css::awt::MouseEvent &rEvent)
css::uno::Reference< css::drawing::XDrawPage > mxCurrentSlide
void ShowView(const OUString &rsViewURL)
const css::uno::Reference< css::drawing::XDrawPage > & GetCurrentSlide() const
const ::rtl::Reference< PresenterWindowManager > & GetWindowManager() const
css::uno::Reference< css::rendering::XSpriteCanvas > mxCanvas
css::uno::Reference< css::frame::XDispatch > GetDispatch(const css::util::URL &rURL) const
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &rEvent) override
void DispatchUnoCommand(const OUString &rsCommand) const
virtual void SAL_CALL keyReleased(const css::awt::KeyEvent &rEvent) override
void UpdatePendingSlideNumber(const sal_Int32 nPendingSlideNumber)
const ::rtl::Reference< PresenterPaneBorderPainter > & GetPaneBorderPainter() const
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &rEvent) override
std::shared_ptr< PresenterCanvasHelper > mpCanvasHelper
virtual void SAL_CALL disposing() override
static bool HasTransition(css::uno::Reference< css::drawing::XDrawPage > const &rxPage)
const std::shared_ptr< PresenterCanvasHelper > & GetCanvasHelper() const
static bool HasCustomAnimation(css::uno::Reference< css::drawing::XDrawPage > const &rxPage)
const rtl::Reference< PresenterPaneContainer > & GetPaneContainer() const
virtual void SAL_CALL disposing(const css::lang::EventObject &rEvent) override
PresenterTheme::SharedFontDescriptor GetViewFont(const OUString &rsViewURL) const
css::uno::Reference< css::awt::XWindow > mxMainWindow
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &rEvent) override
static ::rtl::Reference< PresenterController > Instance(const css::uno::Reference< css::frame::XFrame > &rxFrame)
const css::uno::Reference< css::drawing::XPresenterHelper > & GetPresenterHelper() const
std::shared_ptr< PresenterPaintManager > mpPaintManager
void LoadTheme(const css::uno::Reference< css::drawing::framework::XPane > &rxPane)
css::uno::Reference< css::util::XURLTransformer > mxUrlTransformer
void HandleNumericKeyPress(const sal_Int32 nKey, const sal_Int32 nModifiers)
This method is called when the user pressed one of the numerical keys.
void HideView(const OUString &rsViewURL)
rtl::Reference< PresenterPaneContainer > mpPaneContainer
SharedBitmapDescriptor GetViewBackground(const OUString &rsViewURL) const
std::shared_ptr< PresenterTheme > mpTheme
const css::uno::Reference< css::presentation::XSlideShowController > & GetSlideShowController() const
const std::shared_ptr< PresenterTheme > & GetTheme() const
::std::map< css::uno::Reference< css::frame::XFrame >, rtl::Reference< PresenterController > > InstanceContainer
css::uno::Reference< css::drawing::framework::XResourceId > mxMainPaneId
css::uno::Reference< css::drawing::XDrawPage > mxNextSlide
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &rEvent) override
unotools::WeakReference< PresenterScreen > mxScreen
void UpdateCurrentSlide(const sal_Int32 nOffset)
::rtl::Reference< PresenterPaneBorderPainter > mpPaneBorderPainter
css::util::URL CreateURLFromString(const OUString &rsURL) const
::rtl::Reference< PresenterAccessible > mpAccessibleObject
css::uno::Reference< css::drawing::framework::XConfigurationController > mxConfigurationController
void RequestViews(const bool bIsSlideSorterActive, const bool bIsNotesViewActive, const bool bIsHelpViewActive)
Request activation or deactivation of (some of) the views according to the given parameters.
::rtl::Reference< PresenterWindowManager > mpWindowManager
PresenterController(unotools::WeakReference< PresenterScreen > xScreen, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const rtl::Reference<::sd::DrawController > &rxController, const css::uno::Reference< css::presentation::XSlideShowController > &rxSlideShowController, rtl::Reference< PresenterPaneContainer > xPaneContainer, const css::uno::Reference< css::drawing::framework::XResourceId > &rxMainPaneId)
std::shared_ptr< FontDescriptor > SharedFontDescriptor
::cppu::WeakComponentImplHelper< css::drawing::framework::XConfigurationChangeListener, css::frame::XFrameActionListener, css::awt::XKeyListener, css::awt::XMouseListener > PresenterControllerInterfaceBase
std::shared_ptr< PresenterBitmapContainer::BitmapDescriptor > SharedBitmapDescriptor