summaryrefslogtreecommitdiff
path: root/slideshow/source/inc
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-04-14 16:23:06 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-04-15 21:36:35 +0200
commit2a594eb22bfed62fdbcef51a56c2c180bea0283f (patch)
tree06eaad98336d4cfe132bedff50a1a74e8a8508a6 /slideshow/source/inc
parent81e98150cc04ad764abc668dc12b91d3de90369e (diff)
Slideshow: Remove unneded ExternalMediaShape
ExternalShapeBase is the base class of MediaShape and AppletShape so it's nonsense that ExternalMediaShape to be the base of ExternalShapeBase. Actually this class does nothing, anyway. Change-Id: I8a278c9273a1788f0859205b8f1d0905427179b6
Diffstat (limited to 'slideshow/source/inc')
-rw-r--r--slideshow/source/inc/externalmediashape.hxx85
-rw-r--r--slideshow/source/inc/externalshapebase.hxx139
2 files changed, 139 insertions, 85 deletions
diff --git a/slideshow/source/inc/externalmediashape.hxx b/slideshow/source/inc/externalmediashape.hxx
deleted file mode 100644
index c55d0ba1f570..000000000000
--- a/slideshow/source/inc/externalmediashape.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX
-#define INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX
-
-#include <boost/shared_ptr.hpp>
-
-#include "shape.hxx"
-
-
-namespace slideshow
-{
- namespace internal
- {
- /** Represents a shape containing media (video, sound).
-
- This interface adds media handling methods to a shape. It
- allows starting/stopping and pausing playback.
- */
- class ExternalMediaShape : public Shape
- {
- public:
- // Animation methods
-
-
- /** Notify the Shape that it should start with playback
-
- This method enters playback mode on all registered
- views. It makes the media initially visible (for videos).
- */
- virtual void play() = 0;
-
- /** Notify the Shape that it should stop playback
-
- This method leaves playback mode on all registered
- views. The media is then rewound to the start, and
- removed from screen (for videos)
- */
- virtual void stop() = 0;
-
- /** Notify the Shape that it should pause playback
-
- This method stops playback on all registered
- views. The media stays visible (for videos)
- */
- virtual void pause() = 0;
-
- /** Query whether the media is currently playing.
- */
- virtual bool isPlaying() const = 0;
-
- /** Set media time in seconds.
-
- @param fTime
- Time in seconds of the media time line, that should now be
- presented
- */
- virtual void setMediaTime(double fTime) = 0;
- };
-
- typedef ::boost::shared_ptr< ExternalMediaShape > ExternalMediaShapeSharedPtr;
-
- }
-}
-
-#endif /* INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/inc/externalshapebase.hxx b/slideshow/source/inc/externalshapebase.hxx
new file mode 100644
index 000000000000..811022805270
--- /dev/null
+++ b/slideshow/source/inc/externalshapebase.hxx
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX
+#define INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX
+
+#include <vector>
+
+#include "unoview.hxx"
+#include "subsettableshapemanager.hxx"
+#include "slideshowexceptions.hxx"
+#include "slideshowcontext.hxx"
+#include "shape.hxx"
+
+
+namespace slideshow
+{
+ namespace internal
+ {
+ /** Base class for shapes rendered by external engines.
+
+ Used as the common base for e.g. MediaShape or
+ AppletShape, all of which are rendered by external
+ components (and all employ distinct windows).
+
+ Please note that this base class indeed assumes the shape
+ does not interfere with the internal shapes in any way
+ (including mutual overdraw). It therefore reports yes for
+ the isBackgroundDetached() question.
+ */
+ class ExternalShapeBase : public Shape
+ {
+ public:
+ /** Create a shape for the given XShape for an external shape
+
+ @param xShape
+ The XShape to represent.
+
+ @param nPrio
+ Externally-determined shape priority (used e.g. for
+ paint ordering). This number _must be_ unique!
+ */
+ ExternalShapeBase( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape >& xShape,
+ double nPrio,
+ const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
+ virtual ~ExternalShapeBase();
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > getXShape() const SAL_OVERRIDE;
+
+ // animation methods
+
+
+ virtual void play();
+ virtual void stop();
+ virtual void pause();
+ virtual bool isPlaying() const;
+ virtual void setMediaTime(double);
+
+ // render methods
+
+
+ virtual bool update() const SAL_OVERRIDE;
+ virtual bool render() const SAL_OVERRIDE;
+ virtual bool isContentChanged() const SAL_OVERRIDE;
+
+
+ // Shape attributes
+
+
+ virtual ::basegfx::B2DRectangle getBounds() const SAL_OVERRIDE;
+ virtual ::basegfx::B2DRectangle getDomBounds() const SAL_OVERRIDE;
+ virtual ::basegfx::B2DRectangle getUpdateArea() const SAL_OVERRIDE;
+ virtual bool isVisible() const SAL_OVERRIDE;
+ virtual double getPriority() const SAL_OVERRIDE;
+ virtual bool isBackgroundDetached() const SAL_OVERRIDE;
+
+ protected:
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext> mxComponentContext;
+
+ private:
+ class ExternalShapeBaseListener; friend class ExternalShapeBaseListener;
+
+ /// override in derived class to render preview
+ virtual bool implRender( const ::basegfx::B2DRange& rCurrBounds ) const = 0;
+
+ /// override in derived class to resize
+ virtual void implViewChanged( const UnoViewSharedPtr& rView ) = 0;
+ /// override in derived class to resize
+ virtual void implViewsChanged() = 0;
+
+ /// override in derived class to start external viewer
+ virtual bool implStartIntrinsicAnimation() = 0;
+ /// override in derived class to stop external viewer
+ virtual bool implEndIntrinsicAnimation() = 0;
+ /// override in derived class to pause external viewer
+ virtual bool implPauseIntrinsicAnimation() = 0;
+ /// override in derived class to return status of animation
+ virtual bool implIsIntrinsicAnimationPlaying() const = 0;
+ /// override in derived class to set media time
+ virtual void implSetIntrinsicAnimationTime(double) = 0;
+
+
+ /// The associated XShape
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
+
+ boost::shared_ptr<ExternalShapeBaseListener> mpListener;
+
+ SubsettableShapeManagerSharedPtr mpShapeManager;
+ EventMultiplexer& mrEventMultiplexer;
+
+ // The attributes of this Shape
+ const double mnPriority;
+ ::basegfx::B2DRectangle maBounds;
+ };
+ }
+}
+
+#endif /* INCLUDED_SLIDESHOW_EXTERNALSHAPEBASE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */