1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_VIEWAPPLETSHAPE_HXX 29*cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_VIEWAPPLETSHAPE_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <basegfx/range/b2drectangle.hxx> 32*cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp> 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir #include <boost/utility.hpp> 35*cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir #include "viewlayer.hxx" 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 40*cdf0e10cSrcweir namespace frame { 41*cdf0e10cSrcweir class XSynchronousFrameLoader; 42*cdf0e10cSrcweir class XFrame; 43*cdf0e10cSrcweir } 44*cdf0e10cSrcweir namespace uno { 45*cdf0e10cSrcweir class XComponentContext; 46*cdf0e10cSrcweir } 47*cdf0e10cSrcweir namespace drawing { 48*cdf0e10cSrcweir class XShape; 49*cdf0e10cSrcweir }}}} 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir namespace slideshow 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir namespace internal 54*cdf0e10cSrcweir { 55*cdf0e10cSrcweir /** This class is the viewable representation of a draw 56*cdf0e10cSrcweir document's applet object, associated to a specific View 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir The class is able to render the associated applet on View 59*cdf0e10cSrcweir implementations. 60*cdf0e10cSrcweir */ 61*cdf0e10cSrcweir class ViewAppletShape : private boost::noncopyable 62*cdf0e10cSrcweir { 63*cdf0e10cSrcweir public: 64*cdf0e10cSrcweir /** Create a ViewAppletShape for the given View 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir @param rViewLayer 67*cdf0e10cSrcweir The associated View object. 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir @param rxShape 70*cdf0e10cSrcweir The associated Shape 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir @param rServiceName 73*cdf0e10cSrcweir The service name to use, when actually creating the 74*cdf0e10cSrcweir viewer component 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir @param pPropCopyTable 77*cdf0e10cSrcweir Table of plain ASCII property names, to copy from 78*cdf0e10cSrcweir xShape to applet. 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir @param nNumPropEntries 81*cdf0e10cSrcweir Number of property table entries (in pPropCopyTable) 82*cdf0e10cSrcweir */ 83*cdf0e10cSrcweir ViewAppletShape( const ViewLayerSharedPtr& rViewLayer, 84*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 85*cdf0e10cSrcweir ::com::sun::star::drawing::XShape >& rxShape, 86*cdf0e10cSrcweir const ::rtl::OUString& rServiceName, 87*cdf0e10cSrcweir const char** pPropCopyTable, 88*cdf0e10cSrcweir sal_Size nNumPropEntries, 89*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 90*cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext >& rxContext ); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir /** destroy the object 93*cdf0e10cSrcweir */ 94*cdf0e10cSrcweir virtual ~ViewAppletShape(); 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir /** Query the associated view layer of this shape 97*cdf0e10cSrcweir */ 98*cdf0e10cSrcweir ViewLayerSharedPtr getViewLayer() const; 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir // animation methods 101*cdf0e10cSrcweir //------------------------------------------------------------------ 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir /** Notify the ViewShape that an animation starts now 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir This method enters animation mode on the associate 106*cdf0e10cSrcweir target view. The shape can be animated in parallel on 107*cdf0e10cSrcweir different views. 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir @param rBounds 110*cdf0e10cSrcweir The current applet shape bounds 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir @return whether the mode change finished successfully. 113*cdf0e10cSrcweir */ 114*cdf0e10cSrcweir bool startApplet( const ::basegfx::B2DRectangle& rBounds ); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir /** Notify the ViewShape that it is no longer animated 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir This methods ends animation mode on the associate 119*cdf0e10cSrcweir target view 120*cdf0e10cSrcweir */ 121*cdf0e10cSrcweir void endApplet(); 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir // render methods 124*cdf0e10cSrcweir //------------------------------------------------------------------ 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir /** Render the ViewShape 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir This method renders the ViewAppletShape on the associated view. 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir @param rBounds 131*cdf0e10cSrcweir The current applet shape bounds 132*cdf0e10cSrcweir 133*cdf0e10cSrcweir @return whether the rendering finished successfully. 134*cdf0e10cSrcweir */ 135*cdf0e10cSrcweir bool render( const ::basegfx::B2DRectangle& rBounds ) const; 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir /** Resize the ViewShape 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir This method resizes the ViewAppletShape on the 140*cdf0e10cSrcweir associated view. It does not render. 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir @param rBounds 143*cdf0e10cSrcweir The current applet shape bounds 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir @return whether the resize finished successfully. 146*cdf0e10cSrcweir */ 147*cdf0e10cSrcweir bool resize( const ::basegfx::B2DRectangle& rBounds ) const; 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir private: 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir ViewLayerSharedPtr mpViewLayer; 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir /// the actual viewer component for this applet 154*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 155*cdf0e10cSrcweir ::com::sun::star::frame::XSynchronousFrameLoader> mxViewer; 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir /// the frame containing the applet 158*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 159*cdf0e10cSrcweir ::com::sun::star::frame::XFrame> mxFrame; 160*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 161*cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext> mxComponentContext; 162*cdf0e10cSrcweir }; 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir typedef ::boost::shared_ptr< ViewAppletShape > ViewAppletShapeSharedPtr; 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir } 167*cdf0e10cSrcweir } 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_VIEWAPPLETSHAPE_HXX */ 170