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_INC_SHAPEMANAGER_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_SHAPEMANAGER_HXX
23 #include "disposable.hxx"
24 #include <com/sun/star/uno/Reference.hxx>
26 #include <unordered_map>
29 namespace com::sun::star::drawing
{ class XShape
; }
31 /* Definition of ShapeManager interface */
33 namespace slideshow::internal
36 class AnimatableShape
;
38 typedef std::unordered_map
<
39 css::uno::Reference
< css::drawing::XShape
>,
41 hash
< css::uno::Reference
< css::drawing::XShape
> >
43 typedef ::std::shared_ptr
< AnimatableShape
> AnimatableShapeSharedPtr
;
44 typedef ::std::shared_ptr
< Shape
> ShapeSharedPtr
;
45 typedef std::shared_ptr
< HyperlinkArea
> HyperlinkAreaSharedPtr
;
47 /** ShapeManager interface
49 Implementers of this interface manage appearance and
50 animation of slideshow shapes.
52 class ShapeManager
: public Disposable
55 /** Notify the ShapeManager that the given Shape starts an
58 This method enters animation mode for the Shape. If
59 the shape is already in animation mode, the call is
60 counted, and the shape only leaves animation mode
61 after a corresponding number of leaveAnimationMode()
64 virtual void enterAnimationMode( const AnimatableShapeSharedPtr
& rShape
) = 0;
66 /** Notify the ShapeManager that the given Shape is no
69 When called a corresponding number of times as
70 enterAnimationMode() for a given shape, this methods
71 ends animation mode for the given Shape. It is illegal
72 to call this method more often than
75 virtual void leaveAnimationMode( const AnimatableShapeSharedPtr
& rShape
) = 0;
77 /** Notify that a shape needs an update
79 This method notifies the ShapeManager that a shape
80 update is necessary. Use this if e.g. a running
81 animation changed the shape appearance.
84 Shape which needs an update
86 virtual void notifyShapeUpdate( const ShapeSharedPtr
& rShape
) = 0;
88 /** Lookup a Shape from an XShape model object
90 This method looks up the internal shape map for one
91 representing the given XShape.
94 The XShape object, for which the representing Shape
97 virtual ShapeSharedPtr
lookupShape(
98 css::uno::Reference
< css::drawing::XShape
> const & xShape
) const = 0;
100 /** Get a map that maps all Shapes with their XShape reference as the key
102 * @return an unordered map that contains all shapes in the
103 * current page with their XShape reference as the key
105 virtual const XShapeToShapeMap
& getXShapeToShapeMap() const = 0;
107 /** Register given shape as a hyperlink target
110 Hyperlink sensitive area. Will participate in
111 hyperlink region lookup. Must be in absolute user
114 virtual void addHyperlinkArea( const HyperlinkAreaSharedPtr
& rArea
) = 0;
117 typedef ::std::shared_ptr
< ShapeManager
> ShapeManagerSharedPtr
;
121 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_SHAPEMANAGER_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */