LibreOffice Module sdext (master) 1
PresenterWindowManager.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_PRESENTERWINDOWMANAGER_HXX
21#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERWINDOWMANAGER_HXX
22
24#include "PresenterTheme.hxx"
25#include <com/sun/star/awt/Size.hpp>
26#include <com/sun/star/awt/XFocusListener.hpp>
27#include <com/sun/star/awt/XPaintListener.hpp>
28#include <com/sun/star/awt/XWindow.hpp>
29#include <com/sun/star/awt/XWindowListener.hpp>
30#include <com/sun/star/document/XEventListener.hpp>
31#include <com/sun/star/drawing/framework/XPane.hpp>
32#include <com/sun/star/rendering/XBitmap.hpp>
33#include <com/sun/star/uno/XComponentContext.hpp>
36#include <rtl/ref.hxx>
37#include <memory>
38
39namespace sdext::presenter {
40
41class PresenterController;
42class PresenterPaneBorderPainter;
43class PresenterTheme;
44
45typedef ::cppu::WeakComponentImplHelper<
46 css::awt::XWindowListener,
47 css::awt::XPaintListener,
48 css::awt::XMouseListener,
49 css::awt::XFocusListener
51
57 : protected ::cppu::BaseMutex,
59{
60public:
62 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
64 ::rtl::Reference<PresenterController> pPresenterController);
65 virtual ~PresenterWindowManager() override;
68
69 void SAL_CALL disposing() override;
70
71 void SetParentPane (const css::uno::Reference<css::drawing::framework::XPane>& rxPane);
72 void SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme);
73 void NotifyViewCreation (const css::uno::Reference<css::drawing::framework::XView>& rxView);
75 const OUString& rsPaneURL,
76 const double nX,
77 const double nY,
78 const double nWidth,
79 const double nHeight);
80 void SetPaneBorderPainter (const ::rtl::Reference<PresenterPaneBorderPainter>& rPainter);
81 void Update();
82 void Layout();
83
84 void SetSlideSorterState (bool bIsActive);
85 void SetHelpViewState (bool bIsActive);
86 void SetPauseState (bool bIsPaused);
87
89private:
90 void SetLayoutMode (const LayoutMode eMode);
91
92public:
97 void SetViewMode (const ViewMode eMode);
98
99 ViewMode GetViewMode() const;
100
104 void RestoreViewMode();
105
106 void AddLayoutListener (
107 const css::uno::Reference<css::document::XEventListener>& rxListener);
109 const css::uno::Reference<css::document::XEventListener>& rxListener);
110
111 // XWindowListener
112
113 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) override;
114
115 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) override;
116
117 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) override;
118
119 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) override;
120
121 // XPaintListener
122
123 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
124
125 // XMouseListener
126
127 virtual void SAL_CALL mousePressed (const css::awt::MouseEvent& rEvent) override;
128
129 virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent& rEvent) override;
130
131 virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent& rEvent) override;
132
133 virtual void SAL_CALL mouseExited (const css::awt::MouseEvent& rEvent) override;
134
135 // XFocusListener
136
137 virtual void SAL_CALL focusGained (const css::awt::FocusEvent& rEvent) override;
138
139 virtual void SAL_CALL focusLost (const css::awt::FocusEvent& rEvent) override;
140
141 // XEventListener
142
143 virtual void SAL_CALL disposing (
144 const css::lang::EventObject& rEvent) override;
145
146private:
147 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
149 css::uno::Reference<css::awt::XWindow> mxParentWindow;
150 css::uno::Reference<css::rendering::XCanvas> mxParentCanvas;
151 css::uno::Reference<css::uno::XInterface> mxPaneBorderManager;
160 std::shared_ptr<PresenterTheme> mpTheme;
162 css::uno::Reference<css::rendering::XBitmap> mxScaledBackgroundBitmap;
163 css::uno::Reference<css::rendering::XPolyPolygon2D> mxClipPolygon;
168 typedef ::std::vector<css::uno::Reference<css::document::XEventListener> >
172
173 void PaintChildren (const css::awt::PaintEvent& rEvent) const;
174 void UpdateWindowSize (const css::uno::Reference<css::awt::XWindow>& rxBorderWindow);
175 void PaintBackground (const css::awt::Rectangle& rUpdateBox);
177 css::uno::Reference<css::rendering::XPolyPolygon2D> CreateClipPolyPolygon() const;
178
179 void StoreViewMode (const ViewMode eViewMode);
180
181 void LayoutStandardMode();
182 void LayoutNotesMode();
184 void LayoutHelpMode();
185
188 css::geometry::RealRectangle2D LayoutToolBar();
189
190 css::awt::Size CalculatePaneSize (
191 const double nOuterWidth,
192 const OUString& rsPaneURL);
193
197
198 void NotifyDisposing();
199
201 void ThrowIfDisposed() const;
202};
203
204}
205
206#endif
207
208/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A simple manager of the positions of the panes of the presenter screen.
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &rEvent) override
void SetPaneBorderPainter(const ::rtl::Reference< PresenterPaneBorderPainter > &rPainter)
void NotifyLayoutModeChange()
Notify changes of the layout mode and of the slide sorter state.
virtual void SAL_CALL windowPaint(const css::awt::PaintEvent &rEvent) override
void UpdateWindowSize(const css::uno::Reference< css::awt::XWindow > &rxBorderWindow)
void SetTheme(const std::shared_ptr< PresenterTheme > &rpTheme)
bool mbIsLayouting
This flag is set to <TRUE> while the Layout() method is being executed.
css::geometry::RealRectangle2D LayoutToolBar()
Layout the tool bar and return its outer bounding box.
virtual void SAL_CALL disposing(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL focusLost(const css::awt::FocusEvent &rEvent) override
void AddLayoutListener(const css::uno::Reference< css::document::XEventListener > &rxListener)
css::uno::Reference< css::rendering::XBitmap > mxScaledBackgroundBitmap
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &rEvent) override
virtual void SAL_CALL windowShown(const css::lang::EventObject &rEvent) override
void SetPanePosSizeAbsolute(const OUString &rsPaneURL, const double nX, const double nY, const double nWidth, const double nHeight)
PresenterWindowManager(const css::uno::Reference< css::uno::XComponentContext > &rxContext, ::rtl::Reference< PresenterPaneContainer > pPaneContainer, ::rtl::Reference< PresenterController > pPresenterController)
css::uno::Reference< css::uno::XInterface > mxPaneBorderManager
virtual void SAL_CALL windowHidden(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &rEvent) override
css::uno::Reference< css::rendering::XCanvas > mxParentCanvas
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &rEvent) override
virtual void SAL_CALL focusGained(const css::awt::FocusEvent &rEvent) override
void PaintChildren(const css::awt::PaintEvent &rEvent) const
void RemoveLayoutListener(const css::uno::Reference< css::document::XEventListener > &rxListener)
void NotifyViewCreation(const css::uno::Reference< css::drawing::framework::XView > &rxView)
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &rEvent) override
::rtl::Reference< PresenterPaneContainer > mpPaneContainer
css::uno::Reference< css::rendering::XPolyPolygon2D > mxClipPolygon
void RestoreViewMode()
Restore the layout mode (or slide sorter state) from the configuration.
::std::vector< css::uno::Reference< css::document::XEventListener > > LayoutListenerContainer
void PaintBackground(const css::awt::Rectangle &rUpdateBox)
PresenterWindowManager & operator=(const PresenterWindowManager &)=delete
PresenterWindowManager(const PresenterWindowManager &)=delete
::rtl::Reference< PresenterPaneBorderPainter > mpPaneBorderPainter
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &rEvent) override
css::awt::Size CalculatePaneSize(const double nOuterWidth, const OUString &rsPaneURL)
std::shared_ptr< PresenterTheme > mpTheme
void SetViewMode(const ViewMode eMode)
The high-level method to switch the view mode.
::rtl::Reference< PresenterController > mpPresenterController
void SetParentPane(const css::uno::Reference< css::drawing::framework::XPane > &rxPane)
css::uno::Reference< css::awt::XWindow > mxParentWindow
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
css::uno::Reference< css::rendering::XPolyPolygon2D > CreateClipPolyPolygon() const
::cppu::WeakComponentImplHelper< css::awt::XWindowListener, css::awt::XPaintListener, css::awt::XMouseListener, css::awt::XFocusListener > PresenterWindowManagerInterfaceBase
std::shared_ptr< PresenterBitmapContainer::BitmapDescriptor > SharedBitmapDescriptor