LibreOffice Module sdext (master)  1
PresenterSlideSorter.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_PRESENTERSLIDESORTER_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSLIDESORTER_HXX
22 
23 #include <memory>
24 #include "PresenterController.hxx"
26 #include "PresenterViewFactory.hxx"
27 #include <cppuhelper/basemutex.hxx>
28 #include <cppuhelper/compbase.hxx>
29 #include <com/sun/star/awt/XPaintListener.hpp>
30 #include <com/sun/star/awt/XWindowListener.hpp>
31 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
32 #include <com/sun/star/drawing/XDrawView.hpp>
33 #include <com/sun/star/drawing/XSlidePreviewCache.hpp>
34 #include <com/sun/star/drawing/framework/XView.hpp>
35 #include <com/sun/star/drawing/framework/XResourceId.hpp>
36 #include <com/sun/star/frame/XController.hpp>
37 #include <com/sun/star/geometry/RealRectangle2D.hpp>
38 #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
39 
40 namespace sdext { namespace presenter {
41 
42 class PresenterButton;
44 
45 typedef cppu::WeakComponentImplHelper<
46  css::drawing::framework::XView,
47  css::awt::XWindowListener,
48  css::awt::XPaintListener,
49  css::beans::XPropertyChangeListener,
50  css::drawing::XSlidePreviewCacheListener,
51  css::awt::XMouseListener,
52  css::awt::XMouseMotionListener,
53  css::drawing::XDrawView
55 
60  : private ::cppu::BaseMutex,
61  public PresenterSlideSorterInterfaceBase,
63 {
64 public:
66  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
67  const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
68  const css::uno::Reference<css::frame::XController>& rxController,
69  const ::rtl::Reference<PresenterController>& rpPresenterController);
70  virtual ~PresenterSlideSorter() override;
71 
72  virtual void SAL_CALL disposing() override;
73 
74  // lang::XEventListener
75 
76  virtual void SAL_CALL
77  disposing (const css::lang::EventObject& rEventObject) override;
78 
79  // XWindowListener
80 
81  virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) override;
82 
83  virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) override;
84 
85  virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) override;
86 
87  virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) override;
88 
89  // XPaintListener
90 
91  virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
92 
93  // XMouseListener
94 
95  virtual void SAL_CALL mousePressed (const css::awt::MouseEvent& rEvent) override;
96 
97  virtual void SAL_CALL mouseReleased (const css::awt::MouseEvent& rEvent) override;
98 
99  virtual void SAL_CALL mouseEntered (const css::awt::MouseEvent& rEvent) override;
100 
101  virtual void SAL_CALL mouseExited (const css::awt::MouseEvent& rEvent) override;
102 
103  // XMouseMotionListener
104 
105  virtual void SAL_CALL mouseMoved (const css::awt::MouseEvent& rEvent) override;
106 
107  virtual void SAL_CALL mouseDragged (const css::awt::MouseEvent& rEvent) override;
108 
109  // XResourceId
110 
111  virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId() override;
112 
113  virtual sal_Bool SAL_CALL isAnchorOnly() override;
114 
115  // XPropertyChangeListener
116 
117  virtual void SAL_CALL propertyChange (
118  const css::beans::PropertyChangeEvent& rEvent) override;
119 
120  // XSlidePreviewCacheListener
121 
122  virtual void SAL_CALL notifyPreviewCreation (
123  sal_Int32 nSlideIndex) override;
124 
125  // XDrawView
126 
127  virtual void SAL_CALL setCurrentPage (
128  const css::uno::Reference<css::drawing::XDrawPage>& rxSlide) override;
129 
130  virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override;
131 
132 private:
133  css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
134  css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
135  css::uno::Reference<css::drawing::framework::XPane> mxPane;
136  css::uno::Reference<css::rendering::XCanvas> mxCanvas;
137  css::uno::Reference<css::awt::XWindow> mxWindow;
139  css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController;
140  css::uno::Reference<css::drawing::XSlidePreviewCache> mxPreviewCache;
142  class Layout;
143  std::shared_ptr<Layout> mpLayout;
147  std::unique_ptr<MouseOverManager> mpMouseOverManager;
150  sal_Int32 mnSeparatorY;
151  css::util::Color maSeparatorColor;
152  css::awt::Rectangle maCurrentSlideFrameBoundingBox;
154  std::shared_ptr<CurrentSlideFrameRenderer> mpCurrentSlideFrameRenderer;
155  css::uno::Reference<css::rendering::XPolyPolygon2D> mxPreviewFrame;
156 
157  void UpdateLayout();
158  css::geometry::RealRectangle2D PlaceScrollBars (
159  const css::geometry::RealRectangle2D& rUpperBox);
160  void PlaceCloseButton (
162  const css::awt::Rectangle& rCenterBox,
163  const sal_Int32 nLeftFrameWidth);
164  void ClearBackground (
165  const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
166  const css::awt::Rectangle& rRedrawArea);
167  double GetSlideAspectRatio() const;
168  css::uno::Reference<css::rendering::XBitmap> GetPreview (const sal_Int32 nSlideIndex);
169  void PaintPreview (
170  const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
171  const css::awt::Rectangle& rUpdateBox,
172  const sal_Int32 nSlideIndex);
173  void Paint (const css::awt::Rectangle& rUpdateBox);
174  void SetHorizontalOffset (const double nXOffset);
175  void SetVerticalOffset (const double nYOffset);
176  void GotoSlide (const sal_Int32 nSlideIndex);
177  bool ProvideCanvas();
178 
182  void ThrowIfDisposed();
183 };
184 
185 } } // end of namespace ::sdext::presenter
186 
187 #endif
188 
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &rEvent) override
void PaintPreview(const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const css::awt::Rectangle &rUpdateBox, const sal_Int32 nSlideIndex)
virtual void SAL_CALL windowHidden(const css::lang::EventObject &rEvent) override
css::uno::Reference< css::drawing::framework::XResourceId > mxViewId
virtual sal_Bool SAL_CALL isAnchorOnly() override
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &rEvent) override
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentPage() override
css::uno::Reference< css::drawing::XSlidePreviewCache > mxPreviewCache
Base class of horizontal and vertical scroll bars.
css::uno::Reference< css::rendering::XBitmap > GetPreview(const sal_Int32 nSlideIndex)
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &rEvent) override
::rtl::Reference< PresenterScrollBar > mpVerticalScrollBar
::rtl::Reference< PresenterController > mpPresenterController
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &rEvent) override
virtual void SAL_CALL notifyPreviewCreation(sal_Int32 nSlideIndex) override
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &rEvent) override
css::uno::Reference< css::drawing::framework::XPane > mxPane
css::uno::Reference< css::awt::XWindow > mxWindow
void PlaceCloseButton(const PresenterPaneContainer::SharedPaneDescriptor &rpPane, const css::awt::Rectangle &rCenterBox, const sal_Int32 nLeftFrameWidth)
unsigned char sal_Bool
virtual void SAL_CALL disposing() override
void GotoSlide(const sal_Int32 nSlideIndex)
css::uno::Reference< css::presentation::XSlideShowController > mxSlideShowController
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL getResourceId() override
void ClearBackground(const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const css::awt::Rectangle &rRedrawArea)
css::uno::Reference< css::rendering::XCanvas > mxCanvas
css::uno::Reference< css::rendering::XPolyPolygon2D > mxPreviewFrame
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEvent) override
std::shared_ptr< CurrentSlideFrameRenderer > mpCurrentSlideFrameRenderer
void Paint(const css::awt::Rectangle &rUpdateBox)
virtual void SAL_CALL windowPaint(const css::awt::PaintEvent &rEvent) override
css::geometry::RealRectangle2D PlaceScrollBars(const css::geometry::RealRectangle2D &rUpperBox)
A simple slide sorter for the presenter screen.
virtual void SAL_CALL setCurrentPage(const css::uno::Reference< css::drawing::XDrawPage > &rxSlide) override
virtual void SAL_CALL mouseDragged(const css::awt::MouseEvent &rEvent) override
std::shared_ptr< PaneDescriptor > SharedPaneDescriptor
cppu::WeakComponentImplHelper< css::drawing::framework::XView, css::awt::XWindowListener, css::awt::XPaintListener, css::beans::XPropertyChangeListener, css::drawing::XSlidePreviewCacheListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, css::drawing::XDrawView > PresenterSlideSorterInterfaceBase
PresenterSlideSorter(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)
::rtl::Reference< PresenterButton > mpCloseButton
virtual void SAL_CALL mouseMoved(const css::awt::MouseEvent &rEvent) override
virtual void SAL_CALL windowShown(const css::lang::EventObject &rEvent) override
Base class for presenter views that allows the view factory to store them in a cache and reuse deacti...
void SetHorizontalOffset(const double nXOffset)
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &rEvent) override
std::unique_ptr< MouseOverManager > mpMouseOverManager