1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_SOURCE_ENGINE_SHAPES_VIEWAPPLETSHAPE_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWAPPLETSHAPE_HXX
23 #include <basegfx/range/b2drectangle.hxx>
24 #include <com/sun/star/awt/Point.hpp>
28 #include <viewlayer.hxx>
30 namespace com
{ namespace sun
{ namespace star
{
32 class XSynchronousFrameLoader
;
36 class XComponentContext
;
46 /** This class is the viewable representation of a draw
47 document's applet object, associated to a specific View
49 The class is able to render the associated applet on View
52 class ViewAppletShape final
55 /** Create a ViewAppletShape for the given View
58 The associated View object.
64 The service name to use, when actually creating the
68 Table of plain ASCII property names, to copy from
71 @param nNumPropEntries
72 Number of property table entries (in pPropCopyTable)
74 ViewAppletShape( const ViewLayerSharedPtr
& rViewLayer
,
75 const css::uno::Reference
< css::drawing::XShape
>& rxShape
,
76 const OUString
& rServiceName
,
77 const char** pPropCopyTable
,
78 std::size_t nNumPropEntries
,
79 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
81 /** destroy the object
85 /// Forbid copy construction
86 ViewAppletShape(const ViewAppletShape
&) = delete;
87 /// Forbid copy assignment
88 ViewAppletShape
& operator=(const ViewAppletShape
&) = delete;
90 /** Query the associated view layer of this shape
92 const ViewLayerSharedPtr
& getViewLayer() const;
97 /** Notify the ViewShape that an animation starts now
99 This method enters animation mode on the associate
100 target view. The shape can be animated in parallel on
104 The current applet shape bounds
106 void startApplet( const ::basegfx::B2DRectangle
& rBounds
);
108 /** Notify the ViewShape that it is no longer animated
110 This methods ends animation mode on the associate
118 /** Render the ViewShape
120 This method renders the ViewAppletShape on the associated view.
123 The current applet shape bounds
125 @return whether the rendering finished successfully.
127 bool render( const ::basegfx::B2DRectangle
& rBounds
) const;
129 /** Resize the ViewShape
131 This method resizes the ViewAppletShape on the
132 associated view. It does not render.
135 The current applet shape bounds
137 @return whether the resize finished successfully.
139 bool resize( const ::basegfx::B2DRectangle
& rBounds
) const;
143 ViewLayerSharedPtr mpViewLayer
;
145 /// the actual viewer component for this applet
147 css::frame::XSynchronousFrameLoader
> mxViewer
;
149 /// the frame containing the applet
151 css::frame::XFrame2
> mxFrame
;
153 css::uno::XComponentContext
> mxComponentContext
;
156 typedef ::std::shared_ptr
< ViewAppletShape
> ViewAppletShapeSharedPtr
;
161 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWAPPLETSHAPE_HXX
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */