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