Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX
21 : #define INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX
22 :
23 : #include "shapemanager.hxx"
24 : #include "intrinsicanimationeventhandler.hxx"
25 : #include <boost/shared_ptr.hpp>
26 :
27 : /* Definition of SubsettableShapeManager interface */
28 :
29 : namespace slideshow
30 : {
31 : namespace internal
32 : {
33 : class DocTreeNode;
34 : class AttributableShape;
35 :
36 : /** SubsettableShapeManager interface
37 :
38 : Implementers of this interface manage creation and
39 : revocation of shape subsets. Shape subsets are shapes that
40 : represent (and animate) only parts of an original's shape
41 : content.
42 : */
43 0 : class SubsettableShapeManager : public ShapeManager
44 : {
45 : public:
46 : /** Query a subset of the given original shape
47 :
48 : This method queries a new (but not necessarily unique)
49 : shape, which displays only the given subset of the
50 : original one. Calling this method multiple times with
51 : the same original shape and DocTreeNode content always
52 : returns the same shape.
53 :
54 : Requesting a subset from an original shape leads to
55 : the original shape ceasing to display the subsetted
56 : content. In other words, shape content is always
57 : displayed in exactly one shape.
58 :
59 : @param rOrigShape
60 : The shape the subset is to be created for
61 :
62 : @param rSubsetShape
63 : The subset to display in the generated shape.
64 : */
65 : virtual boost::shared_ptr<AttributableShape> getSubsetShape(
66 : const boost::shared_ptr<AttributableShape>& rOrigShape,
67 : const DocTreeNode& rTreeNode ) = 0;
68 :
69 : /** Revoke a previously queried subset shape.
70 :
71 : With this method, a previously requested subset shape
72 : is revoked again. If the last client revokes a given
73 : subset, it will cease to be displayed, and the
74 : original shape will again show the subset data.
75 :
76 : @param rOrigShape
77 : The shape the subset was created from
78 :
79 : @param rSubsetShape
80 : The subset created from rOrigShape
81 : */
82 : virtual void revokeSubset(
83 : const boost::shared_ptr<AttributableShape>& rOrigShape,
84 : const boost::shared_ptr<AttributableShape>& rSubsetShape ) = 0;
85 :
86 : // Evil hackish way of getting intrinsic animation slide-wise
87 :
88 : /** Register an event handler that will be called when
89 : user paint parameters change.
90 :
91 : @param rHandler
92 : Handler to call when a shape listener changes
93 : */
94 : virtual void addIntrinsicAnimationHandler( const IntrinsicAnimationEventHandlerSharedPtr& rHandler ) = 0;
95 : virtual void removeIntrinsicAnimationHandler( const IntrinsicAnimationEventHandlerSharedPtr& rHandler ) = 0;
96 :
97 : /** Notify that shape-intrinsic animations are now enabled.
98 :
99 : @return true, if this event was processed by
100 : anybody. If false is returned, no handler processed
101 : this event (and probably, nothing will happen at all)
102 : */
103 : virtual bool notifyIntrinsicAnimationsEnabled() = 0;
104 :
105 : /** Notify that shape-intrinsic animations are now disabled.
106 :
107 : @return true, if this event was processed by
108 : anybody. If false is returned, no handler processed
109 : this event (and probably, nothing will happen at all)
110 : */
111 : virtual bool notifyIntrinsicAnimationsDisabled() = 0;
112 : };
113 :
114 : typedef ::boost::shared_ptr< SubsettableShapeManager > SubsettableShapeManagerSharedPtr;
115 : }
116 : }
117 :
118 : #endif /* INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX */
119 :
120 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|