LibreOffice Module sd (master) 1
PresenterNotesView.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_PRESENTERNOTESVIEW_HXX
21#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERNOTESVIEW_HXX
22
24#include "PresenterToolBar.hxx"
28#include <com/sun/star/awt/XWindowListener.hpp>
29#include <com/sun/star/drawing/XDrawPage.hpp>
30#include <com/sun/star/drawing/XDrawView.hpp>
31#include <com/sun/star/drawing/framework/XView.hpp>
32#include <com/sun/star/drawing/framework/XResourceId.hpp>
33#include <com/sun/star/frame/XController.hpp>
34#include <rtl/ref.hxx>
35#include <memory>
36
37namespace sd { class DrawController; }
38
39namespace sdext::presenter {
40
41class PresenterButton;
42class PresenterScrollBar;
43class PresenterTextView;
44
45typedef cppu::WeakComponentImplHelper<
46 css::awt::XWindowListener,
47 css::awt::XPaintListener,
48 css::drawing::framework::XView,
49 css::drawing::XDrawView,
50 css::awt::XKeyListener
52
58 : private ::cppu::BaseMutex,
60 public CachablePresenterView
61{
62public:
63 explicit PresenterNotesView (
64 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
65 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
66 const ::rtl::Reference<::sd::DrawController>& rxController,
67 const ::rtl::Reference<PresenterController>& rpPresenterController);
68 virtual ~PresenterNotesView() override;
69
70 virtual void SAL_CALL disposing() override;
71
78 void SetSlide (
79 const css::uno::Reference<css::drawing::XDrawPage>& rxNotesPage);
80
81 void ChangeFontSize (const sal_Int32 nSizeChange);
82
83 const std::shared_ptr<PresenterTextView>& GetTextView() const;
84
85 // lang::XEventListener
86
87 virtual void SAL_CALL
88 disposing (const css::lang::EventObject& rEventObject) override;
89
90 // XWindowListener
91
92 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) override;
93
94 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) override;
95
96 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) override;
97
98 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) override;
99
100 // XPaintListener
101
102 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
103
104 // XResourceId
105
106 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId() override;
107
108 virtual sal_Bool SAL_CALL isAnchorOnly() override;
109
110 // XDrawView
111
112 virtual void SAL_CALL setCurrentPage (
113 const css::uno::Reference<css::drawing::XDrawPage>& rxSlide) override;
114
115 virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage() override;
116
117 // XKeyListener
118
119 virtual void SAL_CALL keyPressed (const css::awt::KeyEvent& rEvent) override;
120 virtual void SAL_CALL keyReleased (const css::awt::KeyEvent& rEvent) override;
121
122private:
123 css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
125 css::uno::Reference<css::awt::XWindow> mxParentWindow;
126 css::uno::Reference<css::rendering::XCanvas> mxCanvas;
127 css::uno::Reference<css::drawing::XDrawPage> mxCurrentNotesPage;
129 css::uno::Reference<css::awt::XWindow> mxToolBarWindow;
130 css::uno::Reference<css::rendering::XCanvas> mxToolBarCanvas;
133 css::util::Color maSeparatorColor;
135 css::geometry::RealRectangle2D maTextBoundingBox;
137 double mnTop;
139 std::shared_ptr<PresenterTextView> mpTextView;
140
141 void CreateToolBar (
142 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
143 const ::rtl::Reference<PresenterController>& rpPresenterController);
144 void Layout();
145 void Paint (const css::awt::Rectangle& rUpdateBox);
146 void PaintToolBar (const css::awt::Rectangle& rUpdateBox);
147 void PaintText (const css::awt::Rectangle& rUpdateBox);
148 void Invalidate();
149 void Scroll (const double nDistance);
150 void SetTop (const double nTop);
151 void UpdateScrollBar();
152};
153
154} // end of namespace ::sdext::presenter
155
156#endif
157
158/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A drawing framework view of the notes of a slide.
::rtl::Reference< PresenterController > mpPresenterController
css::uno::Reference< css::drawing::XDrawPage > mxCurrentNotesPage
virtual sal_Bool SAL_CALL isAnchorOnly() override
virtual void SAL_CALL disposing() override
void CreateToolBar(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const ::rtl::Reference< PresenterController > &rpPresenterController)
css::uno::Reference< css::rendering::XCanvas > mxToolBarCanvas
css::uno::Reference< css::rendering::XCanvas > mxCanvas
void Scroll(const double nDistance)
virtual void SAL_CALL setCurrentPage(const css::uno::Reference< css::drawing::XDrawPage > &rxSlide) override
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentPage() override
css::uno::Reference< css::awt::XWindow > mxToolBarWindow
::rtl::Reference< PresenterScrollBar > mpScrollBar
::rtl::Reference< PresenterButton > mpCloseButton
std::shared_ptr< PresenterTextView > mpTextView
void ChangeFontSize(const sal_Int32 nSizeChange)
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &rEvent) override
::rtl::Reference< PresenterToolBar > mpToolBar
PresenterTheme::SharedFontDescriptor mpFont
PresenterNotesView(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewId, const ::rtl::Reference<::sd::DrawController > &rxController, const ::rtl::Reference< PresenterController > &rpPresenterController)
void Paint(const css::awt::Rectangle &rUpdateBox)
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL getResourceId() override
void PaintText(const css::awt::Rectangle &rUpdateBox)
virtual void SAL_CALL disposing(const css::lang::EventObject &rEventObject) override
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &rEvent) override
void SetSlide(const css::uno::Reference< css::drawing::XDrawPage > &rxNotesPage)
Typically called from setCurrentSlide() with the notes page that is associated with the slide given t...
virtual void SAL_CALL windowShown(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL keyPressed(const css::awt::KeyEvent &rEvent) override
css::uno::Reference< css::drawing::framework::XResourceId > mxViewId
virtual void SAL_CALL windowHidden(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL windowPaint(const css::awt::PaintEvent &rEvent) override
const std::shared_ptr< PresenterTextView > & GetTextView() const
virtual void SAL_CALL keyReleased(const css::awt::KeyEvent &rEvent) override
void PaintToolBar(const css::awt::Rectangle &rUpdateBox)
css::geometry::RealRectangle2D maTextBoundingBox
css::uno::Reference< css::awt::XWindow > mxParentWindow
std::shared_ptr< FontDescriptor > SharedFontDescriptor
cppu::WeakComponentImplHelper< css::awt::XWindowListener, css::awt::XPaintListener, css::drawing::framework::XView, css::drawing::XDrawView, css::awt::XKeyListener > PresenterNotesViewInterfaceBase
std::shared_ptr< PresenterBitmapContainer::BitmapDescriptor > SharedBitmapDescriptor
unsigned char sal_Bool