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