LibreOffice Module slideshow (master) 1
externalshapebase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_EXTERNALSHAPEBASE_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_EXTERNALSHAPEBASE_HXX
22
24#include <unoview.hxx>
25#include <slideshowcontext.hxx>
26
27
28namespace slideshow::internal
29 {
42 {
43 public:
53 ExternalShapeBase( const css::uno::Reference< css::drawing::XShape >& xShape,
54 double nPrio,
55 const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
56 virtual ~ExternalShapeBase() override;
57
58 virtual css::uno::Reference< css::drawing::XShape > getXShape() const override;
59
60 // animation methods
61
62
63 virtual void play() override;
64 virtual void stop() override;
65 virtual void pause() override;
66 virtual bool isPlaying() const override;
67 virtual void setMediaTime(double) override;
68 void setLooping(bool bLooping) override;
69
70 // render methods
71
72
73 virtual bool update() const override;
74 virtual bool render() const override;
75 virtual bool isContentChanged() const override;
76
77
78 // Shape attributes
79
80
81 virtual ::basegfx::B2DRectangle getBounds() const override;
82 virtual ::basegfx::B2DRectangle getDomBounds() const override;
83 virtual ::basegfx::B2DRectangle getUpdateArea() const override;
84 virtual bool isVisible() const override;
85 virtual double getPriority() const override;
86 virtual bool isBackgroundDetached() const override;
87
88 protected:
89 const css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
90
91 private:
93
95 virtual bool implRender( const ::basegfx::B2DRange& rCurrBounds ) const = 0;
96
98 virtual void implViewChanged( const UnoViewSharedPtr& rView ) = 0;
100 virtual void implViewsChanged() = 0;
101
103 virtual bool implStartIntrinsicAnimation() = 0;
105 virtual bool implEndIntrinsicAnimation() = 0;
107 virtual void implPauseIntrinsicAnimation() = 0;
109 virtual bool implIsIntrinsicAnimationPlaying() const = 0;
111 virtual void implSetIntrinsicAnimationTime(double) = 0;
112 virtual void implSetLooping(bool /*bLooping*/) {}
113
114
116 css::uno::Reference< css::drawing::XShape > mxShape;
117
118 std::shared_ptr<ExternalShapeBaseListener> mpListener;
119
122
123 // The attributes of this Shape
124 const double mnPriority;
126 };
127}
128
129#endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_EXTERNALSHAPEBASE_HXX
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class multiplexes user-activated and slide-show global events.
Base class for shapes rendered by external engines.
virtual bool update() const override
Update the shape.
const css::uno::Reference< css::uno::XComponentContext > mxComponentContext
virtual ::basegfx::B2DRectangle getUpdateArea() const override
Get the current shape update area.
virtual void stop() override
Notify the Shape that it should stop playback.
SubsettableShapeManagerSharedPtr mpShapeManager
virtual bool implStartIntrinsicAnimation()=0
override in derived class to start external viewer
css::uno::Reference< css::drawing::XShape > mxShape
The associated XShape.
virtual void implPauseIntrinsicAnimation()=0
override in derived class to pause external viewer
virtual ::basegfx::B2DRectangle getBounds() const override
Get the current shape position and size.
void setLooping(bool bLooping) override
ExternalShapeBase(const css::uno::Reference< css::drawing::XShape > &xShape, double nPrio, const SlideShowContext &rContext)
Create a shape for the given XShape for an external shape.
virtual bool implEndIntrinsicAnimation()=0
override in derived class to stop external viewer
virtual void setMediaTime(double) override
Set media time in seconds.
virtual bool isPlaying() const override
Query whether the media is currently playing.
virtual css::uno::Reference< css::drawing::XShape > getXShape() const override
Get the associated XShape of this shape.
virtual bool isContentChanged() const override
Query whether shape content changed.
virtual bool isVisible() const override
Query whether the shape is visible at all.
virtual void implViewChanged(const UnoViewSharedPtr &rView)=0
override in derived class to resize
virtual void implSetIntrinsicAnimationTime(double)=0
override in derived class to set media time
virtual ::basegfx::B2DRectangle getDomBounds() const override
Get the DOM position and size of the shape.
virtual bool implIsIntrinsicAnimationPlaying() const =0
override in derived class to return status of animation
std::shared_ptr< ExternalShapeBaseListener > mpListener
virtual bool render() const override
Render the shape.
virtual void pause() override
Notify the Shape that it should pause playback.
virtual void implViewsChanged()=0
override in derived class to resize
virtual bool implRender(const ::basegfx::B2DRange &rCurrBounds) const =0
override in derived class to render preview
virtual double getPriority() const override
Get the shape priority.
virtual void play() override
Notify the Shape that it should start with playback.
virtual bool isBackgroundDetached() const override
Query whether the Shape is currently detached from the background.
Represents a shape containing playable content rendered by external engine (e.g.
::std::shared_ptr< SubsettableShapeManager > SubsettableShapeManagerSharedPtr
std::shared_ptr< UnoView > UnoViewSharedPtr
Common arguments for slideshow objects.