update credits
[LibreOffice.git] / sdext / source / presenter / PresenterSlideShowView.hxx
blobd009888f9fb863cf6774303ae7d5c9cecd802da0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSLIDESHOWVIEW_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSLIDESHOWVIEW_HXX
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>
41 namespace sdext::presenter {
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
51 > PresenterSlideShowViewInterfaceBase;
53 /** Life view in a secondary window of a full screen slide show.
55 class PresenterSlideShowView
56 : protected ::cppu::BaseMutex,
57 public PresenterSlideShowViewInterfaceBase,
58 public CachablePresenterView
60 public:
61 PresenterSlideShowView (
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;
67 PresenterSlideShowView(const PresenterSlideShowView&) = delete;
68 PresenterSlideShowView& operator=(const PresenterSlideShowView&) = delete;
70 void LateInit();
71 virtual void SAL_CALL disposing() override;
73 // CachablePresenterView
75 virtual void ReleaseView() override;
77 // XSlideShowView
79 virtual css::uno::Reference<
80 css::rendering::XSpriteCanvas > SAL_CALL getCanvas() override;
82 virtual void SAL_CALL clear() override;
84 virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation() override;
86 virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset() override;
88 virtual void SAL_CALL addTransformationChangedListener(
89 const css::uno::Reference<
90 css::util::XModifyListener >& xListener) override;
92 virtual void SAL_CALL removeTransformationChangedListener(
93 const css::uno::Reference<
94 css::util::XModifyListener >& xListener) override;
96 virtual void SAL_CALL addPaintListener(
97 const css::uno::Reference<
98 css::awt::XPaintListener >& xListener) override;
100 virtual void SAL_CALL removePaintListener(
101 const css::uno::Reference<
102 css::awt::XPaintListener >& xListener) override;
104 virtual void SAL_CALL addMouseListener(
105 const css::uno::Reference<
106 css::awt::XMouseListener >& xListener) override;
108 virtual void SAL_CALL removeMouseListener(
109 const css::uno::Reference<
110 css::awt::XMouseListener >& xListener) override;
112 virtual void SAL_CALL addMouseMotionListener(
113 const css::uno::Reference<
114 css::awt::XMouseMotionListener >& xListener) override;
116 virtual void SAL_CALL removeMouseMotionListener(
117 const css::uno::Reference<
118 css::awt::XMouseMotionListener >& xListener) override;
120 virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape) override;
122 virtual css::awt::Rectangle SAL_CALL getCanvasArea( ) override;
124 // lang::XEventListener
125 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) override;
127 // XPaintListener
128 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
130 // XMouseListener
131 virtual void SAL_CALL mousePressed (const css::awt::MouseEvent& rEvent) override;
133 virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent& rEvent) override;
135 virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent& rEvent) override;
137 virtual void SAL_CALL mouseExited (const css::awt::MouseEvent& rEvent) override;
139 // XMouseMotionListener
141 virtual void SAL_CALL mouseDragged (const css::awt::MouseEvent& rEvent) override;
143 virtual void SAL_CALL mouseMoved (const css::awt::MouseEvent& rEvent) override;
145 // XWindowListener
147 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) override;
149 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) override;
151 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) override;
153 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) override;
155 // XView
157 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL
158 getResourceId() override;
160 virtual sal_Bool SAL_CALL isAnchorOnly() override;
162 // XDrawView
164 virtual void SAL_CALL setCurrentPage (
165 const css::uno::Reference<css::drawing::XDrawPage>& rxSlide) override;
167 virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override;
169 // CachablePresenterView
171 virtual void ActivatePresenterView() override;
173 virtual void DeactivatePresenterView() override;
175 private:
176 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
177 ::rtl::Reference<PresenterController> mpPresenterController;
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;
191 bool mbIsViewAdded;
193 /** Aspect ratio of the current slide.
195 double mnPageAspectRatio;
197 /** This broadcast helper is used to notify listeners registered to a
198 SlideShowView object.
200 ::cppu::OBroadcastHelper maBroadcaster;
202 SharedBitmapDescriptor mpBackground;
204 bool mbIsForcedPaintPending;
205 bool mbIsPaintPending;
206 OUString msClickToExitPresentationText;
207 OUString msClickToExitPresentationTitle;
208 OUString msTitleTemplate;
209 bool mbIsEndSlideVisible;
210 css::uno::Reference<css::drawing::XDrawPage> mxCurrentSlide;
212 /** Create the window into which the slide show will render its
213 content. This window has the correct aspect ratio and is displayed centered
214 and as large as possible in its parent window.
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;
221 void Resize();
223 void PaintOuterWindow (const css::awt::Rectangle& rRepaintBox);
224 void PaintInnerWindow (const css::awt::PaintEvent& rEvent);
225 void PaintEndSlide (const css::awt::Rectangle& rRepaintBox);
227 void CreateBackgroundPolygons();
229 /** @throws css::lang::DisposedException when the object has already been
230 disposed.
232 void ThrowIfDisposed();
234 void impl_addAndConfigureView();
237 } // end of namespace ::sd::presenter
239 #endif
241 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */