1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX
29 #define INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX
30 
31 #include "shapemanager.hxx"
32 #include "intrinsicanimationeventhandler.hxx"
33 #include <boost/shared_ptr.hpp>
34 
35 /* Definition of SubsettableShapeManager interface */
36 
37 namespace slideshow
38 {
39     namespace internal
40     {
41         class DocTreeNode;
42         class AttributableShape;
43 
44         /** SubsettableShapeManager interface
45 
46             Implementers of this interface manage creation and
47             revocation of shape subsets. Shape subsets are shapes that
48             represent (and animate) only parts of an original's shape
49             content.
50          */
51         class SubsettableShapeManager : public ShapeManager
52         {
53         public:
54             /** Query a subset of the given original shape
55 
56 				This method queries a new (but not necessarily unique)
57 				shape, which displays only the given subset of the
58 				original one. Calling this method multiple times with
59 				the same original shape and DocTreeNode content always
60 				returns the same shape.
61 
62                 Requesting a subset from an original shape leads to
63                 the original shape ceasing to display the subsetted
64                 content. In other words, shape content is always
65                 displayed in exactly one shape.
66 
67                 @param rOrigShape
68                 The shape the subset is to be created for
69 
70                 @param rSubsetShape
71                 The subset to display in the generated shape.
72              */
73             virtual boost::shared_ptr<AttributableShape> getSubsetShape(
74                 const boost::shared_ptr<AttributableShape>& rOrigShape,
75                 const DocTreeNode&                          rTreeNode ) = 0;
76 
77             /** Revoke a previously queried subset shape.
78 
79             	With this method, a previously requested subset shape
80             	is revoked again. If the last client revokes a given
81             	subset, it will cease to be displayed, and the
82             	original shape will again show the subset data.
83 
84                 @param rOrigShape
85                 The shape the subset was created from
86 
87                 @param rSubsetShape
88                 The subset created from rOrigShape
89              */
90             virtual void revokeSubset(
91                 const boost::shared_ptr<AttributableShape>& rOrigShape,
92                 const boost::shared_ptr<AttributableShape>& rSubsetShape ) = 0;
93 
94             // Evil hackish way of getting intrinsic animation slide-wise
95 
96             /** Register an event handler that will be called when
97                 user paint parameters change.
98 
99                 @param rHandler
100                 Handler to call when a shape listener changes
101             */
102             virtual void addIntrinsicAnimationHandler( const IntrinsicAnimationEventHandlerSharedPtr& rHandler ) = 0;
103             virtual void removeIntrinsicAnimationHandler( const IntrinsicAnimationEventHandlerSharedPtr& rHandler ) = 0;
104 
105             /** Notify that shape-intrinsic animations are now enabled.
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 notifyIntrinsicAnimationsEnabled() = 0;
112 
113             /** Notify that shape-intrinsic animations are now disabled.
114 
115                 @return true, if this event was processed by
116                 anybody. If false is returned, no handler processed
117                 this event (and probably, nothing will happen at all)
118             */
119             virtual bool notifyIntrinsicAnimationsDisabled() = 0;
120         };
121 
122         typedef ::boost::shared_ptr< SubsettableShapeManager > SubsettableShapeManagerSharedPtr;
123     }
124 }
125 
126 #endif /* INCLUDED_SLIDESHOW_SUBSETTABLESHAPEMANAGER_HXX */
127