1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 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_SOURCE_ENGINE_SHAPES_EXTERNALSHAPEBASE_HXX
#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_EXTERNALSHAPEBASE_HXX
#include <vector>
#include "iexternalmediashapebase.hxx"
#include "unoview.hxx"
#include "subsettableshapemanager.hxx"
#include "slideshowexceptions.hxx"
#include "slideshowcontext.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 IExternalMediaShapeBase
{
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() SAL_OVERRIDE;
virtual void stop() SAL_OVERRIDE;
virtual void pause() SAL_OVERRIDE;
virtual bool isPlaying() const SAL_OVERRIDE;
virtual void setMediaTime(double) SAL_OVERRIDE;
// 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_SOURCE_ENGINE_SHAPES_EXTERNALSHAPEBASE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|