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/frame/XSynchronousFrameLoader.hpp>
28 #include <viewlayer.hxx>
30 namespace com::sun::star
{
32 class XSynchronousFrameLoader
;
36 class XComponentContext
;
47 /** This class is the viewable representation of a draw
48 document's applet object, associated to a specific View
50 The class is able to render the associated applet on View
53 class ViewAppletShape final
56 /** Create a ViewAppletShape for the given View
59 The associated View object.
65 The service name to use, when actually creating the
69 Table of plain ASCII property names, to copy from
72 @param nNumPropEntries
73 Number of property table entries (in pPropCopyTable)
75 ViewAppletShape( ViewLayerSharedPtr xViewLayer
,
76 const css::uno::Reference
< css::drawing::XShape
>& rxShape
,
77 const OUString
& rServiceName
,
78 const char** pPropCopyTable
,
79 std::size_t nNumPropEntries
,
80 css::uno::Reference
< css::uno::XComponentContext
> xContext
);
82 /** destroy the object
86 /// Forbid copy construction
87 ViewAppletShape(const ViewAppletShape
&) = delete;
88 /// Forbid copy assignment
89 ViewAppletShape
& operator=(const ViewAppletShape
&) = delete;
91 /** Query the associated view layer of this shape
93 const ViewLayerSharedPtr
& getViewLayer() const;
98 /** Notify the ViewShape that an animation starts now
100 This method enters animation mode on the associate
101 target view. The shape can be animated in parallel on
105 The current applet shape bounds
107 void startApplet( const ::basegfx::B2DRectangle
& rBounds
);
109 /** Notify the ViewShape that it is no longer animated
111 This methods ends animation mode on the associate
119 /** Render the ViewShape
121 This method renders the ViewAppletShape on the associated view.
124 The current applet shape bounds
126 @return whether the rendering finished successfully.
128 bool render( const ::basegfx::B2DRectangle
& rBounds
) const;
130 /** Resize the ViewShape
132 This method resizes the ViewAppletShape on the
133 associated view. It does not render.
136 The current applet shape bounds
138 @return whether the resize finished successfully.
140 bool resize( const ::basegfx::B2DRectangle
& rBounds
) const;
144 ViewLayerSharedPtr mpViewLayer
;
146 /// the actual viewer component for this applet
148 css::frame::XSynchronousFrameLoader
> mxViewer
;
150 /// the frame containing the applet
152 css::frame::XFrame2
> mxFrame
;
154 css::uno::XComponentContext
> mxComponentContext
;
157 typedef ::std::shared_ptr
< ViewAppletShape
> ViewAppletShapeSharedPtr
;
162 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWAPPLETSHAPE_HXX
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */