1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <com/sun/star/rendering/XSpriteCanvas.hpp>
34 namespace sdext
{ namespace presenter
{
36 class PresenterButton
;
38 typedef cppu::WeakComponentImplHelper
<
39 css::drawing::framework::XView
,
40 css::awt::XWindowListener
,
41 css::awt::XPaintListener
42 > PresenterHelpViewInterfaceBase
;
44 /** Show help text that describes the defined keys.
46 class PresenterHelpView
47 : private ::cppu::BaseMutex
,
48 public PresenterHelpViewInterfaceBase
51 explicit PresenterHelpView (
52 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
53 const css::uno::Reference
<css::drawing::framework::XResourceId
>& rxViewId
,
54 const css::uno::Reference
<css::frame::XController
>& rxController
,
55 const ::rtl::Reference
<PresenterController
>& rpPresenterController
);
56 virtual ~PresenterHelpView() override
;
58 virtual void SAL_CALL
disposing() override
;
60 // lang::XEventListener
63 disposing (const css::lang::EventObject
& rEventObject
) override
;
67 virtual void SAL_CALL
windowResized (const css::awt::WindowEvent
& rEvent
) override
;
69 virtual void SAL_CALL
windowMoved (const css::awt::WindowEvent
& rEvent
) override
;
71 virtual void SAL_CALL
windowShown (const css::lang::EventObject
& rEvent
) override
;
73 virtual void SAL_CALL
windowHidden (const css::lang::EventObject
& rEvent
) override
;
77 virtual void SAL_CALL
windowPaint (const css::awt::PaintEvent
& rEvent
) override
;
81 virtual css::uno::Reference
<css::drawing::framework::XResourceId
> SAL_CALL
getResourceId() override
;
83 virtual sal_Bool SAL_CALL
isAnchorOnly() override
;
88 css::uno::Reference
<css::uno::XComponentContext
> mxComponentContext
;
89 css::uno::Reference
<css::drawing::framework::XResourceId
> mxViewId
;
90 css::uno::Reference
<css::drawing::framework::XPane
> mxPane
;
91 css::uno::Reference
<css::awt::XWindow
> mxWindow
;
92 css::uno::Reference
<css::rendering::XCanvas
> mxCanvas
;
93 ::rtl::Reference
<PresenterController
> mpPresenterController
;
94 PresenterTheme::SharedFontDescriptor mpFont
;
95 std::unique_ptr
<TextContainer
> mpTextContainer
;
96 ::rtl::Reference
<PresenterButton
> mpCloseButton
;
97 sal_Int32 mnSeparatorY
;
98 sal_Int32 mnMaximalWidth
;
100 void ProvideCanvas();
102 void Paint (const css::awt::Rectangle
& rRedrawArea
);
103 void ReadHelpStrings();
105 const css::uno::Reference
<css::beans::XPropertySet
>& rsProperties
);
107 /** Find a font size, so that all text can be displayed at the same
110 void CheckFontSize();
112 /** @throws css::lang::DisposedException when the object has already been
115 void ThrowIfDisposed();
118 } } // end of namespace ::sdext::presenter
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */