Update ooo320-m1
[ooovba.git] / sdext / source / presenter / PresenterSpritePane.hxx
blob12004e9cabe78efa0ac322f8a8f9dc342c3f4e17
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: PresenterSpritePane.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 SD_PRESENTER_PRESENTER_SPRITE_PANE_HXX
33 #define SD_PRESENTER_PRESENTER_SPRITE_PANE_HXX
35 #include "PresenterPaneBase.hxx"
36 #include "PresenterSprite.hxx"
37 #include <com/sun/star/awt/Size.hpp>
38 #include <com/sun/star/awt/XMouseListener.hpp>
39 #include <com/sun/star/awt/XMouseMotionListener.hpp>
40 #include <com/sun/star/awt/XWindowListener.hpp>
41 #include <com/sun/star/container/XChild.hpp>
42 #include <com/sun/star/drawing/XPresenterHelper.hpp>
43 #include <com/sun/star/drawing/framework/XPane.hpp>
44 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
45 #include <com/sun/star/lang/XInitialization.hpp>
46 #include <com/sun/star/uno/XComponentContext.hpp>
47 #include <com/sun/star/rendering/XCanvas.hpp>
48 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
49 #include <cppuhelper/basemutex.hxx>
50 #include <cppuhelper/compbase1.hxx>
51 #include <rtl/ref.hxx>
52 #include <boost/noncopyable.hpp>
53 #include <boost/shared_ptr.hpp>
55 namespace css = ::com::sun::star;
58 namespace sdext { namespace presenter {
60 /** Use a sprite to display the contents and the border of a pane. Windows
61 are still used to define the locations and sizes of both the border and
62 the pane content. Note that every resize results in a disposed canvas.
63 Therefore call getCanvas in every repaint or at least after every resize.
65 class PresenterSpritePane : public PresenterPaneBase
67 public:
68 PresenterSpritePane (
69 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
70 const ::rtl::Reference<PresenterController>& rpPresenterController);
71 virtual ~PresenterSpritePane (void);
73 virtual void SAL_CALL disposing (void);
75 using css::lang::XEventListener::disposing;
77 ::boost::shared_ptr<PresenterSprite> GetSprite (void);
79 static ::rtl::OUString getImplementationName_static (void);
80 static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void);
81 static css::uno::Reference<css::uno::XInterface> Create(
82 const css::uno::Reference<css::uno::XComponentContext>& rxContext)
83 SAL_THROW((css::uno::Exception));
85 void ShowTransparentBorder (void);
87 // XPane
89 virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getWindow (void)
90 throw (css::uno::RuntimeException);
92 virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL getCanvas (void)
93 throw (css::uno::RuntimeException);
96 // XWindowListener
98 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
99 throw (css::uno::RuntimeException);
101 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
102 throw (css::uno::RuntimeException);
104 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
105 throw (css::uno::RuntimeException);
107 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
108 throw (css::uno::RuntimeException);
111 // XPaintListener
113 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent)
114 throw (css::uno::RuntimeException);
117 private:
118 css::uno::Reference<css::awt::XWindow> mxParentWindow;
119 css::uno::Reference<css::rendering::XSpriteCanvas> mxParentCanvas;
120 ::boost::shared_ptr<PresenterSprite> mpSprite;
122 virtual void CreateCanvases (
123 const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
124 const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas);
125 void UpdateCanvases (void);
128 } } // end of namespace ::sd::presenter
130 #endif