android: Update app-specific/MIME type icons
[LibreOffice.git] / slideshow / source / engine / shapes / viewappletshape.hxx
blobbc349b950cad33f9d09cd85c2e368cef9f74ebb3
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/frame/XSynchronousFrameLoader.hpp>
26 #include <memory>
28 #include <viewlayer.hxx>
30 namespace com::sun::star {
31 namespace frame {
32 class XSynchronousFrameLoader;
33 class XFrame2;
35 namespace uno {
36 class XComponentContext;
38 namespace drawing {
39 class XShape;
43 namespace slideshow
45 namespace internal
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
51 implementations.
53 class ViewAppletShape final
55 public:
56 /** Create a ViewAppletShape for the given View
58 @param rViewLayer
59 The associated View object.
61 @param rxShape
62 The associated Shape
64 @param rServiceName
65 The service name to use, when actually creating the
66 viewer component
68 @param pPropCopyTable
69 Table of plain ASCII property names, to copy from
70 xShape to applet.
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
84 ~ViewAppletShape();
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;
95 // animation methods
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
102 different views.
104 @param rBounds
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
112 target view
114 void endApplet();
116 // render methods
119 /** Render the ViewShape
121 This method renders the ViewAppletShape on the associated view.
123 @param rBounds
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.
135 @param rBounds
136 The current applet shape bounds
138 @return whether the resize finished successfully.
140 bool resize( const ::basegfx::B2DRectangle& rBounds ) const;
142 private:
144 ViewLayerSharedPtr mpViewLayer;
146 /// the actual viewer component for this applet
147 css::uno::Reference<
148 css::frame::XSynchronousFrameLoader> mxViewer;
150 /// the frame containing the applet
151 css::uno::Reference<
152 css::frame::XFrame2> mxFrame;
153 css::uno::Reference<
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: */