Update ooo320-m1
[ooovba.git] / slideshow / source / engine / shapes / externalshapebase.hxx
blobe734cd58cd534eaaf8e577cd2b3e51cbff7770f3
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: externalshapebase.hxx,v $
10 * $Revision: 1.3.18.1 $
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_EXTERNALSHAPEBASE_HXX
32 #define INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX
34 #include <vector>
36 #include "externalmediashape.hxx"
37 #include "unoview.hxx"
38 #include "subsettableshapemanager.hxx"
39 #include "slideshowexceptions.hxx"
40 #include "slideshowcontext.hxx"
43 namespace slideshow
45 namespace internal
47 /** Base class for shapes rendered by external engines.
49 Used as the common base for e.g. MediaShape or
50 AppletShape, all of which are rendered by external
51 components (and all employ distinct windows).
53 Please note that this base class indeed assumes the shape
54 does not interfere with the internal shapes in any way
55 (including mutual overdraw). It therefore reports yes for
56 the isBackgroundDetached() question.
58 class ExternalShapeBase : public ExternalMediaShape
60 public:
61 /** Create a shape for the given XShape for an external shape
63 @param xShape
64 The XShape to represent.
66 @param nPrio
67 Externally-determined shape priority (used e.g. for
68 paint ordering). This number _must be_ unique!
70 ExternalShapeBase( const ::com::sun::star::uno::Reference<
71 ::com::sun::star::drawing::XShape >& xShape,
72 double nPrio,
73 const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
74 virtual ~ExternalShapeBase();
76 virtual ::com::sun::star::uno::Reference<
77 ::com::sun::star::drawing::XShape > getXShape() const;
79 // animation methods
80 //------------------------------------------------------------------
82 virtual void play();
83 virtual void stop();
84 virtual void pause();
85 virtual bool isPlaying() const;
86 virtual void setMediaTime(double);
88 // render methods
89 //------------------------------------------------------------------
91 virtual bool update() const;
92 virtual bool render() const;
93 virtual bool isContentChanged() const;
96 // Shape attributes
97 //------------------------------------------------------------------
99 virtual ::basegfx::B2DRectangle getBounds() const;
100 virtual ::basegfx::B2DRectangle getDomBounds() const;
101 virtual ::basegfx::B2DRectangle getUpdateArea() const;
102 virtual bool isVisible() const;
103 virtual double getPriority() const;
104 virtual bool isBackgroundDetached() const;
106 protected:
107 const ::com::sun::star::uno::Reference<
108 ::com::sun::star::uno::XComponentContext> mxComponentContext;
110 private:
111 class ExternalShapeBaseListener; friend class ExternalShapeBaseListener;
113 /// override in derived class to render preview
114 virtual bool implRender( const ::basegfx::B2DRange& rCurrBounds ) const = 0;
116 /// override in derived class to resize
117 virtual void implViewChanged( const UnoViewSharedPtr& rView ) = 0;
118 /// override in derived class to resize
119 virtual void implViewsChanged() = 0;
121 /// override in derived class to start external viewer
122 virtual bool implStartIntrinsicAnimation() = 0;
123 /// override in derived class to stop external viewer
124 virtual bool implEndIntrinsicAnimation() = 0;
125 /// override in derived class to pause external viewer
126 virtual bool implPauseIntrinsicAnimation() = 0;
127 /// override in derived class to return status of animation
128 virtual bool implIsIntrinsicAnimationPlaying() const = 0;
129 /// override in derived class to set media time
130 virtual void implSetIntrinsicAnimationTime(double) = 0;
133 /// The associated XShape
134 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
136 boost::shared_ptr<ExternalShapeBaseListener> mpListener;
138 SubsettableShapeManagerSharedPtr mpShapeManager;
139 EventMultiplexer& mrEventMultiplexer;
141 // The attributes of this Shape
142 const double mnPriority;
143 ::basegfx::B2DRectangle maBounds;
148 #endif /* INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX */