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