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