LibreOffice Module sdext (master)  1
PresenterSlideShowView.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_PRESENTERSLIDESHOWVIEW_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSLIDESHOWVIEW_HXX
22 
23 #include "PresenterViewFactory.hxx"
24 #include <com/sun/star/presentation/XSlideShowView.hpp>
25 #include <com/sun/star/awt/XPaintListener.hpp>
26 #include <com/sun/star/awt/XMouseListener.hpp>
27 #include <com/sun/star/awt/XMouseMotionListener.hpp>
28 #include <com/sun/star/awt/XPointer.hpp>
29 #include <com/sun/star/awt/XWindowListener.hpp>
30 #include <com/sun/star/drawing/XDrawView.hpp>
31 #include <com/sun/star/drawing/framework/XPane.hpp>
32 #include <com/sun/star/drawing/framework/XResourceId.hpp>
33 #include <com/sun/star/drawing/framework/XView.hpp>
34 #include <com/sun/star/frame/XController.hpp>
35 #include <com/sun/star/presentation/XSlideShowController.hpp>
36 #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <cppuhelper/compbase.hxx>
39 #include <cppuhelper/basemutex.hxx>
40 
41 namespace sdext::presenter {
42 
43 typedef cppu::WeakComponentImplHelper<
44  css::presentation::XSlideShowView,
45  css::awt::XPaintListener,
46  css::awt::XMouseListener,
47  css::awt::XMouseMotionListener,
48  css::awt::XWindowListener,
49  css::drawing::framework::XView,
50  css::drawing::XDrawView
52 
56  : protected ::cppu::BaseMutex,
59 {
60 public:
62  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
63  const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
64  const css::uno::Reference<css::frame::XController>& rxController,
65  const ::rtl::Reference<PresenterController>& rpPresenterController);
66  virtual ~PresenterSlideShowView() override;
69 
70  void LateInit();
71  virtual void SAL_CALL disposing() override;
72 
73  // CachablePresenterView
74 
75  virtual void ReleaseView() override;
76 
77  // XSlideShowView
78 
79  virtual css::uno::Reference<
80  css::rendering::XSpriteCanvas > SAL_CALL getCanvas() override;
81 
82  virtual void SAL_CALL clear() override;
83 
84  virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation() override;
85 
86  virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset() override;
87 
88  virtual void SAL_CALL addTransformationChangedListener(
89  const css::uno::Reference<
90  css::util::XModifyListener >& xListener) override;
91 
92  virtual void SAL_CALL removeTransformationChangedListener(
93  const css::uno::Reference<
94  css::util::XModifyListener >& xListener) override;
95 
96  virtual void SAL_CALL addPaintListener(
97  const css::uno::Reference<
98  css::awt::XPaintListener >& xListener) override;
99 
100  virtual void SAL_CALL removePaintListener(
101  const css::uno::Reference<
102  css::awt::XPaintListener >& xListener) override;
103 
104  virtual void SAL_CALL addMouseListener(
105  const css::uno::Reference<
106  css::awt::XMouseListener >& xListener) override;
107 
108  virtual void SAL_CALL removeMouseListener(
109  const css::uno::Reference<
110  css::awt::XMouseListener >& xListener) override;
111 
112  virtual void SAL_CALL addMouseMotionListener(
113  const css::uno::Reference<
114  css::awt::XMouseMotionListener >& xListener) override;
115 
116  virtual void SAL_CALL removeMouseMotionListener(
117  const css::uno::Reference<
118  css::awt::XMouseMotionListener >& xListener) override;
119 
120  virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape) override;
121 
122  virtual css::awt::Rectangle SAL_CALL getCanvasArea( ) override;
123 
124  // lang::XEventListener
125  virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) override;
126 
127  // XPaintListener
128  virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
129 
130  // XMouseListener
131  virtual void SAL_CALL mousePressed (const css::awt::MouseEvent& rEvent) override;
132 
133  virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent& rEvent) override;
134 
135  virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent& rEvent) override;
136 
137  virtual void SAL_CALL mouseExited (const css::awt::MouseEvent& rEvent) override;
138 
139  // XMouseMotionListener
140 
141  virtual void SAL_CALL mouseDragged (const css::awt::MouseEvent& rEvent) override;
142 
143  virtual void SAL_CALL mouseMoved (const css::awt::MouseEvent& rEvent) override;
144 
145  // XWindowListener
146 
147  virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) override;
148 
149  virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) override;
150 
151  virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) override;
152 
153  virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) override;
154 
155  // XView
156 
157  virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL
158  getResourceId() override;
159 
160  virtual sal_Bool SAL_CALL isAnchorOnly() override;
161 
162  // XDrawView
163 
164  virtual void SAL_CALL setCurrentPage (
165  const css::uno::Reference<css::drawing::XDrawPage>& rxSlide) override;
166 
167  virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override;
168 
169  // CachablePresenterView
170 
171  virtual void ActivatePresenterView() override;
172 
173  virtual void DeactivatePresenterView() override;
174 
175 private:
176  css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
178  css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
179  css::uno::Reference<css::frame::XController> mxController;
180  css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController;
181  css::uno::Reference<css::presentation::XSlideShow> mxSlideShow;
182  css::uno::Reference<css::rendering::XCanvas> mxCanvas;
183  css::uno::Reference<css::rendering::XCanvas> mxViewCanvas;
184  css::uno::Reference<css::awt::XPointer> mxPointer;
185  css::uno::Reference<css::awt::XWindow> mxWindow;
186  css::uno::Reference<css::awt::XWindow> mxViewWindow;
187  css::uno::Reference<css::drawing::framework::XPane> mxTopPane;
188  css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
189  css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon1;
190  css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon2;
192 
196 
201 
203 
208  OUString msTitleTemplate;
210  css::uno::Reference<css::drawing::XDrawPage> mxCurrentSlide;
211 
216  css::uno::Reference<css::awt::XWindow> CreateViewWindow (
217  const css::uno::Reference<css::awt::XWindow>& rxParentWindow) const;
218  css::uno::Reference<css::rendering::XCanvas> CreateViewCanvas (
219  const css::uno::Reference<css::awt::XWindow>& rxWindow) const;
220 
221  void Resize();
222 
223  void PaintOuterWindow (const css::awt::Rectangle& rRepaintBox);
224  void PaintInnerWindow (const css::awt::PaintEvent& rEvent);
225  void PaintEndSlide (const css::awt::Rectangle& rRepaintBox);
226 
228 
232  void ThrowIfDisposed();
233 
235 };
236 
237 } // end of namespace ::sd::presenter
238 
239 #endif
240 
241 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
cppu::WeakComponentImplHelper< css::presentation::XSlideShowView, css::awt::XPaintListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, css::awt::XWindowListener, css::drawing::framework::XView, css::drawing::XDrawView > PresenterSlideShowViewInterfaceBase
css::uno::Reference< css::rendering::XCanvas > mxViewCanvas
virtual css::uno::Reference< css::rendering::XSpriteCanvas > SAL_CALL getCanvas() override
css::uno::Reference< css::awt::XWindow > CreateViewWindow(const css::uno::Reference< css::awt::XWindow > &rxParentWindow) const
Create the window into which the slide show will render its content.
PresenterSlideShowView(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewId, const css::uno::Reference< css::frame::XController > &rxController, const ::rtl::Reference< PresenterController > &rpPresenterController)
virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape) override
css::uno::Reference< css::frame::XController > mxController
virtual void SAL_CALL mouseDragged(const css::awt::MouseEvent &rEvent) override
css::uno::Reference< css::drawing::XPresenterHelper > mxPresenterHelper
css::uno::Reference< css::rendering::XCanvas > mxCanvas
css::uno::Reference< css::rendering::XPolyPolygon2D > mxBackgroundPolygon2
virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset() override
virtual void SAL_CALL mouseMoved(const css::awt::MouseEvent &rEvent) override
virtual void SAL_CALL removeTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentPage() override
std::shared_ptr< PresenterBitmapContainer::BitmapDescriptor > SharedBitmapDescriptor
virtual void SAL_CALL windowShown(const css::lang::EventObject &rEvent) override
css::uno::Reference< css::drawing::XDrawPage > mxCurrentSlide
virtual css::awt::Rectangle SAL_CALL getCanvasArea() override
virtual void SAL_CALL disposing() override
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &rEvent) override
css::uno::Reference< css::drawing::framework::XResourceId > mxViewId
virtual void SAL_CALL addMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
css::uno::Reference< css::rendering::XCanvas > CreateViewCanvas(const css::uno::Reference< css::awt::XWindow > &rxWindow) const
virtual void SAL_CALL addMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
virtual void SAL_CALL setCurrentPage(const css::uno::Reference< css::drawing::XDrawPage > &rxSlide) override
void PaintEndSlide(const css::awt::Rectangle &rRepaintBox)
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &rEvent) override
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &rEvent) override
virtual void SAL_CALL removePaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
virtual void DeactivatePresenterView() override
Called when the view is put into a cache.
void PaintInnerWindow(const css::awt::PaintEvent &rEvent)
virtual void SAL_CALL removeMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
virtual void SAL_CALL addTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
unsigned char sal_Bool
virtual void SAL_CALL windowHidden(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL windowPaint(const css::awt::PaintEvent &rEvent) override
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &rEvent) override
::cppu::OBroadcastHelper maBroadcaster
This broadcast helper is used to notify listeners registered to a SlideShowView object.
virtual void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &rEvent) override
PresenterSlideShowView & operator=(const PresenterSlideShowView &)=delete
virtual void SAL_CALL addPaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL getResourceId() override
double mnPageAspectRatio
Aspect ratio of the current slide.
::rtl::Reference< PresenterController > mpPresenterController
css::uno::Reference< css::awt::XPointer > mxPointer
css::uno::Reference< css::presentation::XSlideShowController > mxSlideShowController
virtual sal_Bool SAL_CALL isAnchorOnly() override
css::uno::Reference< css::drawing::framework::XPane > mxTopPane
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &rEvent) override
virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation() override
css::uno::Reference< css::awt::XWindow > mxWindow
Life view in a secondary window of a full screen slide show.
virtual void ReleaseView() override
Called before the view is disposed.
void PaintOuterWindow(const css::awt::Rectangle &rRepaintBox)
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
css::uno::Reference< css::awt::XWindow > mxViewWindow
css::uno::Reference< css::rendering::XPolyPolygon2D > mxBackgroundPolygon1
Base class for presenter views that allows the view factory to store them in a cache and reuse deacti...
css::uno::Reference< css::presentation::XSlideShow > mxSlideShow