merge the formfield patch from ooo-build
[ooovba.git] / sdext / source / presenter / PresenterHelpView.hxx
blob50cd9d7f122a1904250785ffcf40191246ef1663
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PresenterHelpView.hxx,v $
11 * $Revision: 1.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SDEXT_PRESENTER_HELP_VIEW_HXX
33 #define SDEXT_PRESENTER_HELP_VIEW_HXX
35 #include "PresenterController.hxx"
36 #include <cppuhelper/basemutex.hxx>
37 #include <cppuhelper/compbase3.hxx>
38 #include <com/sun/star/awt/XPaintListener.hpp>
39 #include <com/sun/star/awt/XWindowListener.hpp>
40 #include <com/sun/star/drawing/framework/XView.hpp>
41 #include <com/sun/star/drawing/framework/XResourceId.hpp>
42 #include <com/sun/star/frame/XController.hpp>
43 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
45 namespace css = ::com::sun::star;
47 namespace {
48 typedef cppu::WeakComponentImplHelper3<
49 css::drawing::framework::XView,
50 css::awt::XWindowListener,
51 css::awt::XPaintListener
52 > PresenterHelpViewInterfaceBase;
55 namespace sdext { namespace presenter {
57 class PresenterButton;
59 /** Show help text that describes the defined keys.
61 class PresenterHelpView
62 : private ::cppu::BaseMutex,
63 public PresenterHelpViewInterfaceBase
65 public:
66 explicit PresenterHelpView (
67 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
68 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
69 const css::uno::Reference<css::frame::XController>& rxController,
70 const ::rtl::Reference<PresenterController>& rpPresenterController);
71 virtual ~PresenterHelpView (void);
73 virtual void SAL_CALL disposing (void);
75 // lang::XEventListener
77 virtual void SAL_CALL
78 disposing (const css::lang::EventObject& rEventObject)
79 throw (css::uno::RuntimeException);
82 // XWindowListener
84 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
85 throw (css::uno::RuntimeException);
87 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
88 throw (css::uno::RuntimeException);
90 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
91 throw (css::uno::RuntimeException);
93 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
94 throw (css::uno::RuntimeException);
97 // XPaintListener
99 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent)
100 throw (css::uno::RuntimeException);
103 // XResourceId
105 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId (void)
106 throw (css::uno::RuntimeException);
108 virtual sal_Bool SAL_CALL isAnchorOnly (void)
109 throw (com::sun::star::uno::RuntimeException);
111 private:
112 class TextContainer;
114 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
115 css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
116 css::uno::Reference<css::drawing::framework::XPane> mxPane;
117 css::uno::Reference<css::awt::XWindow> mxWindow;
118 css::uno::Reference<css::rendering::XCanvas> mxCanvas;
119 ::rtl::Reference<PresenterController> mpPresenterController;
120 PresenterTheme::SharedFontDescriptor mpFont;
121 ::boost::scoped_ptr<TextContainer> mpTextContainer;
122 ::rtl::Reference<PresenterButton> mpCloseButton;
123 sal_Int32 mnSeparatorY;
124 sal_Int32 mnMaximalWidth;
126 void ProvideCanvas (void);
127 void Resize (void);
128 void Paint (const css::awt::Rectangle& rRedrawArea);
129 void ReadHelpStrings (void);
130 void ProcessString (
131 const css::uno::Reference<css::beans::XPropertySet>& rsProperties);
133 /** Find a font size, so that all text can be displayed at the same
134 time.
136 void CheckFontSize (void);
138 /** This method throws a DisposedException when the object has already been
139 disposed.
141 void ThrowIfDisposed (void)
142 throw (css::lang::DisposedException);
145 } } // end of namespace ::sdext::presenter
147 #endif