Update ooo320-m1
[ooovba.git] / slideshow / source / engine / shapes / viewappletshape.hxx
blob359d49e86fb0d619ffa3e2537b481f59eeeaae5e
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: viewappletshape.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_VIEWAPPLETSHAPE_HXX
32 #define INCLUDED_SLIDESHOW_VIEWAPPLETSHAPE_HXX
34 #include <basegfx/range/b2drectangle.hxx>
35 #include <com/sun/star/awt/Point.hpp>
37 #include <boost/utility.hpp>
38 #include <boost/shared_ptr.hpp>
40 #include "viewlayer.hxx"
42 namespace com { namespace sun { namespace star {
43 namespace frame {
44 class XSynchronousFrameLoader;
45 class XFrame;
47 namespace uno {
48 class XComponentContext;
50 namespace drawing {
51 class XShape;
52 }}}}
54 namespace slideshow
56 namespace internal
58 /** This class is the viewable representation of a draw
59 document's applet object, associated to a specific View
61 The class is able to render the associated applet on View
62 implementations.
64 class ViewAppletShape : private boost::noncopyable
66 public:
67 /** Create a ViewAppletShape for the given View
69 @param rViewLayer
70 The associated View object.
72 @param rxShape
73 The associated Shape
75 @param rServiceName
76 The service name to use, when actually creating the
77 viewer component
79 @param pPropCopyTable
80 Table of plain ASCII property names, to copy from
81 xShape to applet.
83 @param nNumPropEntries
84 Number of property table entries (in pPropCopyTable)
86 ViewAppletShape( const ViewLayerSharedPtr& rViewLayer,
87 const ::com::sun::star::uno::Reference<
88 ::com::sun::star::drawing::XShape >& rxShape,
89 const ::rtl::OUString& rServiceName,
90 const char** pPropCopyTable,
91 sal_Size nNumPropEntries,
92 const ::com::sun::star::uno::Reference<
93 ::com::sun::star::uno::XComponentContext >& rxContext );
95 /** destroy the object
97 virtual ~ViewAppletShape();
99 /** Query the associated view layer of this shape
101 ViewLayerSharedPtr getViewLayer() const;
103 // animation methods
104 //------------------------------------------------------------------
106 /** Notify the ViewShape that an animation starts now
108 This method enters animation mode on the associate
109 target view. The shape can be animated in parallel on
110 different views.
112 @param rBounds
113 The current applet shape bounds
115 @return whether the mode change finished successfully.
117 bool startApplet( const ::basegfx::B2DRectangle& rBounds );
119 /** Notify the ViewShape that it is no longer animated
121 This methods ends animation mode on the associate
122 target view
124 void endApplet();
126 // render methods
127 //------------------------------------------------------------------
129 /** Render the ViewShape
131 This method renders the ViewAppletShape on the associated view.
133 @param rBounds
134 The current applet shape bounds
136 @return whether the rendering finished successfully.
138 bool render( const ::basegfx::B2DRectangle& rBounds ) const;
140 /** Resize the ViewShape
142 This method resizes the ViewAppletShape on the
143 associated view. It does not render.
145 @param rBounds
146 The current applet shape bounds
148 @return whether the resize finished successfully.
150 bool resize( const ::basegfx::B2DRectangle& rBounds ) const;
152 private:
154 ViewLayerSharedPtr mpViewLayer;
156 /// the actual viewer component for this applet
157 ::com::sun::star::uno::Reference<
158 ::com::sun::star::frame::XSynchronousFrameLoader> mxViewer;
160 /// the frame containing the applet
161 ::com::sun::star::uno::Reference<
162 ::com::sun::star::frame::XFrame> mxFrame;
163 ::com::sun::star::uno::Reference<
164 ::com::sun::star::uno::XComponentContext> mxComponentContext;
167 typedef ::boost::shared_ptr< ViewAppletShape > ViewAppletShapeSharedPtr;
172 #endif /* INCLUDED_SLIDESHOW_VIEWAPPLETSHAPE_HXX */