LibreOffice Module slideshow (master) 1
viewmediashape.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_VIEWMEDIASHAPE_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWMEDIASHAPE_HXX
22
24#include <com/sun/star/awt/Point.hpp>
25#include <com/sun/star/drawing/XShape.hpp>
26
27#include <memory>
28#include <vcl/vclptr.hxx>
29
30#include <viewlayer.hxx>
31
33
34namespace com::sun::star {
35 namespace drawing {
36 class XShape;
37 }
38 namespace media {
39 class XPlayer;
40 class XPlayerWindow;
41 }
42 namespace uno {
43 class XComponentContext;
44 }
45 namespace beans{
46 class XPropertySet;
47 }
48}
49
50namespace slideshow::internal
51 {
58 class ViewMediaShape final
59 {
60 public:
67 css::uno::Reference< css::drawing::XShape > xShape,
68 css::uno::Reference< css::uno::XComponentContext > xContext );
69
73
78
81 const ViewLayerSharedPtr& getViewLayer() const;
82
83 // animation methods
84
85
92 void startMedia();
93
99 void endMedia();
100
106 void pauseMedia();
107
113 void setMediaTime(double fTime);
114
115 void setLooping(bool bLooping);
116
117 // render methods
118
119
129 bool render( const ::basegfx::B2DRectangle& rBounds ) const;
130
141 bool resize( const ::basegfx::B2DRectangle& rNewBounds ) const;
142
143 private:
144
145 bool implInitialize( const ::basegfx::B2DRectangle& rBounds );
146 void implSetMediaProperties( const css::uno::Reference< css::beans::XPropertySet >& rxProps );
147 void implInitializeMediaPlayer( const OUString& rMediaURL, const OUString& rMimeType );
148 void implInitializePlayerWindow( const ::basegfx::B2DRectangle& rBounds,
149 const css::uno::Sequence< css::uno::Any >& rVCLDeviceParams );
152 mutable css::awt::Point maWindowOffset;
153 mutable ::basegfx::B2DRectangle maBounds;
154
155 css::uno::Reference< css::drawing::XShape > mxShape;
156 css::uno::Reference< css::media::XPlayer > mxPlayer;
157 css::uno::Reference< css::media::XPlayerWindow > mxPlayerWindow;
158 css::uno::Reference< css::uno::XComponentContext> mxComponentContext;
160 };
161
162 typedef ::std::shared_ptr< ViewMediaShape > ViewMediaShapeSharedPtr;
163
164}
165
166#endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWMEDIASHAPE_HXX
167
168/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class is the viewable representation of a draw document's media object, associated to a specific...
void implInitializeMediaPlayer(const OUString &rMediaURL, const OUString &rMimeType)
void setMediaTime(double fTime)
Set current time of media.
void endMedia()
Notify the ViewShape that it is no longer animated.
ViewMediaShape(const ViewMediaShape &)=delete
Forbid copy construction.
const ViewLayerSharedPtr & getViewLayer() const
Query the associated view layer of this shape.
VclPtr< SystemChildWindow > mpMediaWindow
bool implInitialize(const ::basegfx::B2DRectangle &rBounds)
void startMedia()
Notify the ViewShape that an animation starts now.
css::uno::Reference< css::media::XPlayerWindow > mxPlayerWindow
ViewMediaShape(const ViewLayerSharedPtr &rViewLayer, css::uno::Reference< css::drawing::XShape > xShape, css::uno::Reference< css::uno::XComponentContext > xContext)
Create a ViewMediaShape for the given View.
css::uno::Reference< css::media::XPlayer > mxPlayer
mutable::basegfx::B2DRectangle maBounds
ViewMediaShape & operator=(const ViewMediaShape &)=delete
Forbid copy assignment.
void implInitializePlayerWindow(const ::basegfx::B2DRectangle &rBounds, const css::uno::Sequence< css::uno::Any > &rVCLDeviceParams)
void implSetMediaProperties(const css::uno::Reference< css::beans::XPropertySet > &rxProps)
bool resize(const ::basegfx::B2DRectangle &rNewBounds) const
Resize the ViewShape.
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
css::uno::Reference< css::drawing::XShape > mxShape
void pauseMedia()
Notify the ViewShape that it should pause playback.
bool render(const ::basegfx::B2DRectangle &rBounds) const
Render the ViewShape.
class SAL_NO_VTABLE XPropertySet
std::shared_ptr< ViewLayer > ViewLayerSharedPtr
Definition: viewlayer.hxx:168
::std::shared_ptr< ViewMediaShape > ViewMediaShapeSharedPtr