1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SD_PRESENTER_PRESENTER_PANE_HXX
29 #define SD_PRESENTER_PRESENTER_PANE_HXX
30 
31 #include "PresenterPaneBase.hxx"
32 #include <com/sun/star/awt/XMouseListener.hpp>
33 #include <com/sun/star/awt/XMouseMotionListener.hpp>
34 #include <com/sun/star/awt/XWindowListener.hpp>
35 #include <com/sun/star/container/XChild.hpp>
36 #include <com/sun/star/drawing/XPresenterHelper.hpp>
37 #include <com/sun/star/drawing/framework/XPane.hpp>
38 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
39 #include <com/sun/star/lang/XInitialization.hpp>
40 #include <com/sun/star/uno/XComponentContext.hpp>
41 #include <com/sun/star/rendering/XCanvas.hpp>
42 #include <rtl/ref.hxx>
43 #include <boost/noncopyable.hpp>
44 
45 namespace css = ::com::sun::star;
46 
47 
48 namespace sdext { namespace presenter {
49 
50 /** Pane used by the presenter screen.  Pane objects are stored in the
51     PresenterPaneContainer.  Sizes and positions are controlled
52     by the PresenterWindowManager.  Interactive positioning and resizing is
53     managed by the PresenterPaneBorderManager.  Borders around panes are
54     painted by the PresenterPaneBorderPainter.
55 */
56 class PresenterPane : public PresenterPaneBase
57 {
58 public:
59     PresenterPane (
60         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
61         const ::rtl::Reference<PresenterController>& rpPresenterController);
62     virtual ~PresenterPane (void);
63 
64     static ::rtl::OUString getImplementationName_static (void);
65     static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void);
66     static css::uno::Reference<css::uno::XInterface> Create(
67         const css::uno::Reference<css::uno::XComponentContext>& rxContext)
68         SAL_THROW((css::uno::Exception));
69 
70 
71     // XPane
72 
73     css::uno::Reference<css::awt::XWindow> SAL_CALL getWindow (void)
74         throw (css::uno::RuntimeException);
75 
76     css::uno::Reference<css::rendering::XCanvas> SAL_CALL getCanvas (void)
77         throw (css::uno::RuntimeException);
78 
79 
80     // XWindowListener
81 
82     virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
83         throw (css::uno::RuntimeException);
84 
85     virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
86         throw (css::uno::RuntimeException);
87 
88     virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
89         throw (css::uno::RuntimeException);
90 
91     virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
92         throw (css::uno::RuntimeException);
93 
94 
95     // XPaintListener
96 
97     virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent)
98         throw (css::uno::RuntimeException);
99 
100 
101 private:
102     /** Store the bounding box so that when the window is resized or moved
103         we still know the old position and size.
104     */
105     css::awt::Rectangle maBoundingBox;
106 
107     virtual void CreateCanvases (
108         const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
109         const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas);
110 
111     void Invalidate (
112         const css::awt::Rectangle& rRepaintBox);
113     void UpdateBoundingBox (void);
114 };
115 
116 } } // end of namespace ::sd::presenter
117 
118 #endif
119