Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / shapes / viewappletshape.hxx
blob2a3dafa0058847faea37c8af1aee08503fc57390
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
26 #include <memory>
28 #include <viewlayer.hxx>
30 namespace com { namespace sun { namespace star {
31 namespace frame {
32 class XSynchronousFrameLoader;
33 class XFrame2;
35 namespace uno {
36 class XComponentContext;
38 namespace drawing {
39 class XShape;
40 }}}}
42 namespace slideshow
44 namespace internal
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
50 implementations.
52 class ViewAppletShape final
54 public:
55 /** Create a ViewAppletShape for the given View
57 @param rViewLayer
58 The associated View object.
60 @param rxShape
61 The associated Shape
63 @param rServiceName
64 The service name to use, when actually creating the
65 viewer component
67 @param pPropCopyTable
68 Table of plain ASCII property names, to copy from
69 xShape to applet.
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
83 ~ViewAppletShape();
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;
94 // animation methods
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
101 different views.
103 @param rBounds
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
111 target view
113 void endApplet();
115 // render methods
118 /** Render the ViewShape
120 This method renders the ViewAppletShape on the associated view.
122 @param rBounds
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.
134 @param rBounds
135 The current applet shape bounds
137 @return whether the resize finished successfully.
139 bool resize( const ::basegfx::B2DRectangle& rBounds ) const;
141 private:
143 ViewLayerSharedPtr mpViewLayer;
145 /// the actual viewer component for this applet
146 css::uno::Reference<
147 css::frame::XSynchronousFrameLoader> mxViewer;
149 /// the frame containing the applet
150 css::uno::Reference<
151 css::frame::XFrame2> mxFrame;
152 css::uno::Reference<
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: */