Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / slideshow / source / engine / shapes / externalshapebase.hxx
blob58849e82b87f5cec0bbc19eab5ffd78e9f6ba14b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <vector>
25 #include "externalmediashape.hxx"
26 #include "unoview.hxx"
27 #include "subsettableshapemanager.hxx"
28 #include "slideshowexceptions.hxx"
29 #include "slideshowcontext.hxx"
32 namespace slideshow
34 namespace internal
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
49 public:
50 /** Create a shape for the given XShape for an external shape
52 @param xShape
53 The XShape to represent.
55 @param nPrio
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,
61 double nPrio,
62 const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
63 virtual ~ExternalShapeBase();
65 virtual ::com::sun::star::uno::Reference<
66 ::com::sun::star::drawing::XShape > getXShape() const;
68 // animation methods
69 //------------------------------------------------------------------
71 virtual void play();
72 virtual void stop();
73 virtual void pause();
74 virtual bool isPlaying() const;
75 virtual void setMediaTime(double);
77 // render methods
78 //------------------------------------------------------------------
80 virtual bool update() const;
81 virtual bool render() const;
82 virtual bool isContentChanged() const;
85 // Shape attributes
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;
95 protected:
96 const ::com::sun::star::uno::Reference<
97 ::com::sun::star::uno::XComponentContext> mxComponentContext;
99 private:
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: */