1*06bcd5d2SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*06bcd5d2SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*06bcd5d2SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*06bcd5d2SAndrew Rist  * distributed with this work for additional information
6*06bcd5d2SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*06bcd5d2SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*06bcd5d2SAndrew Rist  * "License"); you may not use this file except in compliance
9*06bcd5d2SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*06bcd5d2SAndrew Rist  *
11*06bcd5d2SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*06bcd5d2SAndrew Rist  *
13*06bcd5d2SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*06bcd5d2SAndrew Rist  * software distributed under the License is distributed on an
15*06bcd5d2SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*06bcd5d2SAndrew Rist  * KIND, either express or implied.  See the License for the
17*06bcd5d2SAndrew Rist  * specific language governing permissions and limitations
18*06bcd5d2SAndrew Rist  * under the License.
19*06bcd5d2SAndrew Rist  *
20*06bcd5d2SAndrew Rist  *************************************************************/
21*06bcd5d2SAndrew Rist 
22*06bcd5d2SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SDEXT_PRESENTER_HELP_VIEW_HXX
25cdf0e10cSrcweir #define SDEXT_PRESENTER_HELP_VIEW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "PresenterController.hxx"
28cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx>
29cdf0e10cSrcweir #include <cppuhelper/compbase3.hxx>
30cdf0e10cSrcweir #include <com/sun/star/awt/XPaintListener.hpp>
31cdf0e10cSrcweir #include <com/sun/star/awt/XWindowListener.hpp>
32cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XView.hpp>
33cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XResourceId.hpp>
34cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp>
35cdf0e10cSrcweir #include <com/sun/star/rendering/XSpriteCanvas.hpp>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace css = ::com::sun::star;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace {
40cdf0e10cSrcweir     typedef cppu::WeakComponentImplHelper3<
41cdf0e10cSrcweir         css::drawing::framework::XView,
42cdf0e10cSrcweir         css::awt::XWindowListener,
43cdf0e10cSrcweir         css::awt::XPaintListener
44cdf0e10cSrcweir         > PresenterHelpViewInterfaceBase;
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
47cdf0e10cSrcweir namespace sdext { namespace presenter {
48cdf0e10cSrcweir 
49cdf0e10cSrcweir class PresenterButton;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir /** Show help text that describes the defined keys.
52cdf0e10cSrcweir */
53cdf0e10cSrcweir class PresenterHelpView
54cdf0e10cSrcweir     : private ::cppu::BaseMutex,
55cdf0e10cSrcweir       public PresenterHelpViewInterfaceBase
56cdf0e10cSrcweir {
57cdf0e10cSrcweir public:
58cdf0e10cSrcweir     explicit PresenterHelpView (
59cdf0e10cSrcweir         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
60cdf0e10cSrcweir         const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
61cdf0e10cSrcweir         const css::uno::Reference<css::frame::XController>& rxController,
62cdf0e10cSrcweir         const ::rtl::Reference<PresenterController>& rpPresenterController);
63cdf0e10cSrcweir     virtual ~PresenterHelpView (void);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     virtual void SAL_CALL disposing (void);
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     // lang::XEventListener
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     virtual void SAL_CALL
70cdf0e10cSrcweir         disposing (const css::lang::EventObject& rEventObject)
71cdf0e10cSrcweir         throw (css::uno::RuntimeException);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     // XWindowListener
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
77cdf0e10cSrcweir         throw (css::uno::RuntimeException);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
80cdf0e10cSrcweir         throw (css::uno::RuntimeException);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
83cdf0e10cSrcweir         throw (css::uno::RuntimeException);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
86cdf0e10cSrcweir         throw (css::uno::RuntimeException);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     // XPaintListener
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent)
92cdf0e10cSrcweir         throw (css::uno::RuntimeException);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     // XResourceId
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId (void)
98cdf0e10cSrcweir         throw (css::uno::RuntimeException);
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isAnchorOnly (void)
101cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir private:
104cdf0e10cSrcweir     class TextContainer;
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
107cdf0e10cSrcweir     css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
108cdf0e10cSrcweir     css::uno::Reference<css::drawing::framework::XPane> mxPane;
109cdf0e10cSrcweir     css::uno::Reference<css::awt::XWindow> mxWindow;
110cdf0e10cSrcweir     css::uno::Reference<css::rendering::XCanvas> mxCanvas;
111cdf0e10cSrcweir     ::rtl::Reference<PresenterController> mpPresenterController;
112cdf0e10cSrcweir     PresenterTheme::SharedFontDescriptor mpFont;
113cdf0e10cSrcweir     ::boost::scoped_ptr<TextContainer> mpTextContainer;
114cdf0e10cSrcweir     ::rtl::Reference<PresenterButton> mpCloseButton;
115cdf0e10cSrcweir     sal_Int32 mnSeparatorY;
116cdf0e10cSrcweir     sal_Int32 mnMaximalWidth;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     void ProvideCanvas (void);
119cdf0e10cSrcweir     void Resize (void);
120cdf0e10cSrcweir     void Paint (const css::awt::Rectangle& rRedrawArea);
121cdf0e10cSrcweir     void ReadHelpStrings (void);
122cdf0e10cSrcweir     void ProcessString (
123cdf0e10cSrcweir         const css::uno::Reference<css::beans::XPropertySet>& rsProperties);
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     /** Find a font size, so that all text can be displayed at the same
126cdf0e10cSrcweir         time.
127cdf0e10cSrcweir     */
128cdf0e10cSrcweir     void CheckFontSize (void);
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     /** This method throws a DisposedException when the object has already been
131cdf0e10cSrcweir         disposed.
132cdf0e10cSrcweir     */
133cdf0e10cSrcweir     void ThrowIfDisposed (void)
134cdf0e10cSrcweir         throw (css::lang::DisposedException);
135cdf0e10cSrcweir };
136cdf0e10cSrcweir 
137cdf0e10cSrcweir } } // end of namespace ::sdext::presenter
138cdf0e10cSrcweir 
139cdf0e10cSrcweir #endif
140