1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX
25 #define INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX
26 
27 #include "shapemanager.hxx"
28 #include "intrinsicanimationeventhandler.hxx"
29 #include <boost/shared_ptr.hpp>
30 
31 /* Definition of SubsettableShapeManager interface */
32 
33 namespace slideshow
34 {
35     namespace internal
36     {
37         class DocTreeNode;
38         class AttributableShape;
39 
40         /** SubsettableShapeManager interface
41 
42             Implementers of this interface manage creation and
43             revocation of shape subsets. Shape subsets are shapes that
44             represent (and animate) only parts of an original's shape
45             content.
46          */
47         class SubsettableShapeManager : public ShapeManager
48         {
49         public:
50             /** Query a subset of the given original shape
51 
52 				This method queries a new (but not necessarily unique)
53 				shape, which displays only the given subset of the
54 				original one. Calling this method multiple times with
55 				the same original shape and DocTreeNode content always
56 				returns the same shape.
57 
58                 Requesting a subset from an original shape leads to
59                 the original shape ceasing to display the subsetted
60                 content. In other words, shape content is always
61                 displayed in exactly one shape.
62 
63                 @param rOrigShape
64                 The shape the subset is to be created for
65 
66                 @param rSubsetShape
67                 The subset to display in the generated shape.
68              */
69             virtual boost::shared_ptr<AttributableShape> getSubsetShape(
70                 const boost::shared_ptr<AttributableShape>& rOrigShape,
71                 const DocTreeNode&                          rTreeNode ) = 0;
72 
73             /** Revoke a previously queried subset shape.
74 
75             	With this method, a previously requested subset shape
76             	is revoked again. If the last client revokes a given
77             	subset, it will cease to be displayed, and the
78             	original shape will again show the subset data.
79 
80                 @param rOrigShape
81                 The shape the subset was created from
82 
83                 @param rSubsetShape
84                 The subset created from rOrigShape
85              */
86             virtual void revokeSubset(
87                 const boost::shared_ptr<AttributableShape>& rOrigShape,
88                 const boost::shared_ptr<AttributableShape>& rSubsetShape ) = 0;
89 
90             // Evil hackish way of getting intrinsic animation slide-wise
91 
92             /** Register an event handler that will be called when
93                 user paint parameters change.
94 
95                 @param rHandler
96                 Handler to call when a shape listener changes
97             */
98             virtual void addIntrinsicAnimationHandler( const IntrinsicAnimationEventHandlerSharedPtr& rHandler ) = 0;
99             virtual void removeIntrinsicAnimationHandler( const IntrinsicAnimationEventHandlerSharedPtr& rHandler ) = 0;
100 
101             /** Notify that shape-intrinsic animations are now enabled.
102 
103                 @return true, if this event was processed by
104                 anybody. If false is returned, no handler processed
105                 this event (and probably, nothing will happen at all)
106             */
107             virtual bool notifyIntrinsicAnimationsEnabled() = 0;
108 
109             /** Notify that shape-intrinsic animations are now disabled.
110 
111                 @return true, if this event was processed by
112                 anybody. If false is returned, no handler processed
113                 this event (and probably, nothing will happen at all)
114             */
115             virtual bool notifyIntrinsicAnimationsDisabled() = 0;
116         };
117 
118         typedef ::boost::shared_ptr< SubsettableShapeManager > SubsettableShapeManagerSharedPtr;
119     }
120 }
121 
122 #endif /* INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX */
123