Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sd / source / console / PresenterHelpView.hxx
blobe342e2c9945ef5935287710f39b5103f0a455e29
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_PRESENTERHELPVIEW_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERHELPVIEW_HXX
23 #include "PresenterController.hxx"
24 #include <cppuhelper/basemutex.hxx>
25 #include <cppuhelper/compbase.hxx>
26 #include <com/sun/star/awt/XPaintListener.hpp>
27 #include <com/sun/star/awt/XWindowListener.hpp>
28 #include <com/sun/star/drawing/framework/XView.hpp>
29 #include <com/sun/star/drawing/framework/XResourceId.hpp>
30 #include <com/sun/star/frame/XController.hpp>
31 #include <memory>
33 namespace sdext::presenter {
35 class PresenterButton;
37 typedef cppu::WeakComponentImplHelper<
38 css::drawing::framework::XView,
39 css::awt::XWindowListener,
40 css::awt::XPaintListener
41 > PresenterHelpViewInterfaceBase;
43 /** Show help text that describes the defined keys.
45 class PresenterHelpView
46 : private ::cppu::BaseMutex,
47 public PresenterHelpViewInterfaceBase
49 public:
50 explicit PresenterHelpView (
51 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
52 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
53 const rtl::Reference<::sd::DrawController>& rxController,
54 ::rtl::Reference<PresenterController> xPresenterController);
55 virtual ~PresenterHelpView() override;
57 virtual void SAL_CALL disposing() override;
59 // lang::XEventListener
61 virtual void SAL_CALL
62 disposing (const css::lang::EventObject& rEventObject) override;
64 // XWindowListener
66 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent) override;
68 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent) override;
70 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent) override;
72 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent) override;
74 // XPaintListener
76 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
78 // XResourceId
80 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId() override;
82 virtual sal_Bool SAL_CALL isAnchorOnly() override;
84 private:
85 class TextContainer;
87 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
88 css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
89 css::uno::Reference<css::drawing::framework::XPane> mxPane;
90 css::uno::Reference<css::awt::XWindow> mxWindow;
91 css::uno::Reference<css::rendering::XCanvas> mxCanvas;
92 ::rtl::Reference<PresenterController> mpPresenterController;
93 PresenterTheme::SharedFontDescriptor mpFont;
94 std::unique_ptr<TextContainer> mpTextContainer;
95 ::rtl::Reference<PresenterButton> mpCloseButton;
96 sal_Int32 mnSeparatorY;
97 sal_Int32 mnMaximalWidth;
99 void ProvideCanvas();
100 void Resize();
101 void Paint (const css::awt::Rectangle& rRedrawArea);
102 void ReadHelpStrings();
103 void ProcessString (
104 const css::uno::Reference<css::beans::XPropertySet>& rsProperties);
106 /** Find a font size, so that all text can be displayed at the same
107 time.
109 void CheckFontSize();
111 /** @throws css::lang::DisposedException when the object has already been
112 disposed.
114 void ThrowIfDisposed();
117 } // end of namespace ::sdext::presenter
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */