xref: /trunk/main/sdext/source/presenter/PresenterPane.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_PRESENTER_PRESENTER_PANE_HXX
25 #define SD_PRESENTER_PRESENTER_PANE_HXX
26 
27 #include "PresenterPaneBase.hxx"
28 #include <com/sun/star/awt/XMouseListener.hpp>
29 #include <com/sun/star/awt/XMouseMotionListener.hpp>
30 #include <com/sun/star/awt/XWindowListener.hpp>
31 #include <com/sun/star/container/XChild.hpp>
32 #include <com/sun/star/drawing/XPresenterHelper.hpp>
33 #include <com/sun/star/drawing/framework/XPane.hpp>
34 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
35 #include <com/sun/star/lang/XInitialization.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/rendering/XCanvas.hpp>
38 #include <rtl/ref.hxx>
39 #include <boost/noncopyable.hpp>
40 
41 namespace css = ::com::sun::star;
42 
43 
44 namespace sdext { namespace presenter {
45 
46 /** Pane used by the presenter screen.  Pane objects are stored in the
47     PresenterPaneContainer.  Sizes and positions are controlled
48     by the PresenterWindowManager.  Interactive positioning and resizing is
49     managed by the PresenterPaneBorderManager.  Borders around panes are
50     painted by the PresenterPaneBorderPainter.
51 */
52 class PresenterPane : public PresenterPaneBase
53 {
54 public:
55     PresenterPane (
56         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
57         const ::rtl::Reference<PresenterController>& rpPresenterController);
58     virtual ~PresenterPane (void);
59 
60     static ::rtl::OUString getImplementationName_static (void);
61     static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void);
62     static css::uno::Reference<css::uno::XInterface> Create(
63         const css::uno::Reference<css::uno::XComponentContext>& rxContext);
64 
65 
66     // XPane
67 
68     css::uno::Reference<css::awt::XWindow> SAL_CALL getWindow (void);
69 
70     css::uno::Reference<css::rendering::XCanvas> SAL_CALL getCanvas (void);
71 
72 
73     // XWindowListener
74 
75     virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent);
76 
77     virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent);
78 
79     virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent);
80 
81     virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent);
82 
83 
84     // XPaintListener
85 
86     virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent);
87 
88 
89 private:
90     /** Store the bounding box so that when the window is resized or moved
91         we still know the old position and size.
92     */
93     css::awt::Rectangle maBoundingBox;
94 
95     virtual void CreateCanvases (
96         const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
97         const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas);
98 
99     void Invalidate (
100         const css::awt::Rectangle& rRepaintBox);
101     void UpdateBoundingBox (void);
102 };
103 
104 } } // end of namespace ::sd::presenter
105 
106 #endif
107