1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX
21 #define INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX
25 #include "externalmediashape.hxx"
26 #include "unoview.hxx"
27 #include "subsettableshapemanager.hxx"
28 #include "slideshowexceptions.hxx"
29 #include "slideshowcontext.hxx"
36 /** Base class for shapes rendered by external engines.
38 Used as the common base for e.g. MediaShape or
39 AppletShape, all of which are rendered by external
40 components (and all employ distinct windows).
42 Please note that this base class indeed assumes the shape
43 does not interfere with the internal shapes in any way
44 (including mutual overdraw). It therefore reports yes for
45 the isBackgroundDetached() question.
47 class ExternalShapeBase
: public ExternalMediaShape
50 /** Create a shape for the given XShape for an external shape
53 The XShape to represent.
56 Externally-determined shape priority (used e.g. for
57 paint ordering). This number _must be_ unique!
59 ExternalShapeBase( const ::com::sun::star::uno::Reference
<
60 ::com::sun::star::drawing::XShape
>& xShape
,
62 const SlideShowContext
& rContext
); // throw ShapeLoadFailedException;
63 virtual ~ExternalShapeBase();
65 virtual ::com::sun::star::uno::Reference
<
66 ::com::sun::star::drawing::XShape
> getXShape() const;
69 //------------------------------------------------------------------
74 virtual bool isPlaying() const;
75 virtual void setMediaTime(double);
78 //------------------------------------------------------------------
80 virtual bool update() const;
81 virtual bool render() const;
82 virtual bool isContentChanged() const;
86 //------------------------------------------------------------------
88 virtual ::basegfx::B2DRectangle
getBounds() const;
89 virtual ::basegfx::B2DRectangle
getDomBounds() const;
90 virtual ::basegfx::B2DRectangle
getUpdateArea() const;
91 virtual bool isVisible() const;
92 virtual double getPriority() const;
93 virtual bool isBackgroundDetached() const;
96 const ::com::sun::star::uno::Reference
<
97 ::com::sun::star::uno::XComponentContext
> mxComponentContext
;
100 class ExternalShapeBaseListener
; friend class ExternalShapeBaseListener
;
102 /// override in derived class to render preview
103 virtual bool implRender( const ::basegfx::B2DRange
& rCurrBounds
) const = 0;
105 /// override in derived class to resize
106 virtual void implViewChanged( const UnoViewSharedPtr
& rView
) = 0;
107 /// override in derived class to resize
108 virtual void implViewsChanged() = 0;
110 /// override in derived class to start external viewer
111 virtual bool implStartIntrinsicAnimation() = 0;
112 /// override in derived class to stop external viewer
113 virtual bool implEndIntrinsicAnimation() = 0;
114 /// override in derived class to pause external viewer
115 virtual bool implPauseIntrinsicAnimation() = 0;
116 /// override in derived class to return status of animation
117 virtual bool implIsIntrinsicAnimationPlaying() const = 0;
118 /// override in derived class to set media time
119 virtual void implSetIntrinsicAnimationTime(double) = 0;
122 /// The associated XShape
123 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> mxShape
;
125 boost::shared_ptr
<ExternalShapeBaseListener
> mpListener
;
127 SubsettableShapeManagerSharedPtr mpShapeManager
;
128 EventMultiplexer
& mrEventMultiplexer
;
130 // The attributes of this Shape
131 const double mnPriority
;
132 ::basegfx::B2DRectangle maBounds
;
137 #endif /* INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX */
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */