bump product version to 5.0.4.1
[LibreOffice.git] / sdext / source / presenter / PresenterHelpView.hxx
blob7792d79389b902132e884891a83fff97edd5a9be
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/compbase3.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>
32 #include <boost/scoped_ptr.hpp>
34 namespace {
35 typedef cppu::WeakComponentImplHelper3<
36 css::drawing::framework::XView,
37 css::awt::XWindowListener,
38 css::awt::XPaintListener
39 > PresenterHelpViewInterfaceBase;
42 namespace sdext { namespace presenter {
44 class PresenterButton;
46 /** Show help text that describes the defined keys.
48 class PresenterHelpView
49 : private ::cppu::BaseMutex,
50 public PresenterHelpViewInterfaceBase
52 public:
53 explicit PresenterHelpView (
54 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
55 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
56 const css::uno::Reference<css::frame::XController>& rxController,
57 const ::rtl::Reference<PresenterController>& rpPresenterController);
58 virtual ~PresenterHelpView();
60 virtual void SAL_CALL disposing() SAL_OVERRIDE;
62 // lang::XEventListener
64 virtual void SAL_CALL
65 disposing (const css::lang::EventObject& rEventObject)
66 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 // XWindowListener
70 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
71 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
74 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
77 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
80 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 // XPaintListener
84 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent)
85 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 // XResourceId
89 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId()
90 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 virtual sal_Bool SAL_CALL isAnchorOnly()
93 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 private:
96 class TextContainer;
98 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
99 css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
100 css::uno::Reference<css::drawing::framework::XPane> mxPane;
101 css::uno::Reference<css::awt::XWindow> mxWindow;
102 css::uno::Reference<css::rendering::XCanvas> mxCanvas;
103 ::rtl::Reference<PresenterController> mpPresenterController;
104 PresenterTheme::SharedFontDescriptor mpFont;
105 ::boost::scoped_ptr<TextContainer> mpTextContainer;
106 ::rtl::Reference<PresenterButton> mpCloseButton;
107 sal_Int32 mnSeparatorY;
108 sal_Int32 mnMaximalWidth;
110 void ProvideCanvas();
111 void Resize();
112 void Paint (const css::awt::Rectangle& rRedrawArea);
113 void ReadHelpStrings();
114 void ProcessString (
115 const css::uno::Reference<css::beans::XPropertySet>& rsProperties);
117 /** Find a font size, so that all text can be displayed at the same
118 time.
120 void CheckFontSize();
122 /** This method throws a DisposedException when the object has already been
123 disposed.
125 void ThrowIfDisposed()
126 throw (css::lang::DisposedException);
129 } } // end of namespace ::sdext::presenter
131 #endif
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */