1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_SHAPEATTRIBUTELAYER_HXX
29*cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_SHAPEATTRIBUTELAYER_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <com/sun/star/drawing/FillStyle.hpp>
32*cdf0e10cSrcweir #include <com/sun/star/drawing/LineStyle.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/awt/FontSlant.hpp>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <basegfx/vector/b2dsize.hxx>
36*cdf0e10cSrcweir #include <basegfx/point/b2dpoint.hxx>
37*cdf0e10cSrcweir #include <basegfx/range/b2drectangle.hxx>
38*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolypolygon.hxx>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #include "state.hxx"
41*cdf0e10cSrcweir #include "rgbcolor.hxx"
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir #include <stack>
44*cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir namespace slideshow
48*cdf0e10cSrcweir {
49*cdf0e10cSrcweir     namespace internal
50*cdf0e10cSrcweir     {
51*cdf0e10cSrcweir         class ShapeAttributeLayer;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir         typedef ::boost::shared_ptr< ShapeAttributeLayer > ShapeAttributeLayerSharedPtr;
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir         /** Encapsulates all modifiable attributes of a shape.
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir         	This class holds all modifiable attributes of a shape, and
58*cdf0e10cSrcweir         	at the same time provides means to layer attributes on top
59*cdf0e10cSrcweir         	of each other..
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir             And yes, there's a reason why we even pass bools and ints
62*cdf0e10cSrcweir             by const reference. Namely, that makes the set* methods
63*cdf0e10cSrcweir             differ only in the value type, which greatly reduces
64*cdf0e10cSrcweir             template variability (e.g. in AnimationFactory).
65*cdf0e10cSrcweir          */
66*cdf0e10cSrcweir         class ShapeAttributeLayer
67*cdf0e10cSrcweir         {
68*cdf0e10cSrcweir         public:
69*cdf0e10cSrcweir             /** Create a ShapeAttributeLayer instance, with all
70*cdf0e10cSrcweir                 attributes set to default.
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir                 Furthermore, this constructor gets a pointer to a
73*cdf0e10cSrcweir                 child layer, which is used as the fallback (or the
74*cdf0e10cSrcweir                 base value) for all attributes
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir                 @param rChildLayer
77*cdf0e10cSrcweir                 Layer below this one
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir                 @attention
80*cdf0e10cSrcweir                 This method is only supposed to be called from Shape objects
81*cdf0e10cSrcweir              */
82*cdf0e10cSrcweir             explicit ShapeAttributeLayer( const ShapeAttributeLayerSharedPtr& rChildLayer );
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir             // Children management methods
85*cdf0e10cSrcweir             //------------------------------------------------------------------
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir             /** Revoke the given layer.
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir             	This method revokes the given layer from this object
90*cdf0e10cSrcweir             	or one of the children. That is, if this object does
91*cdf0e10cSrcweir             	have children, and the given layer is no direct child,
92*cdf0e10cSrcweir             	it is recursively passed to the children for removal.
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir                 @return true, if removal was successful.
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir                 @attention
97*cdf0e10cSrcweir                 This method is only supposed to be called from Shape objects
98*cdf0e10cSrcweir              */
99*cdf0e10cSrcweir             bool revokeChildLayer( const ShapeAttributeLayerSharedPtr& rChildLayer );
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir             /** Query the child layer of this object.
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir                 @attention
104*cdf0e10cSrcweir                 This method is only supposed to be called from Shape objects
105*cdf0e10cSrcweir              */
106*cdf0e10cSrcweir             ShapeAttributeLayerSharedPtr getChildLayer() const;
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir             /** Set the additive mode for possible child attributes
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir             	This method sets the additive mode for child
111*cdf0e10cSrcweir             	attributes. That is the way underlying attribute
112*cdf0e10cSrcweir             	layers are combined with this one (i.e. to overrule
113*cdf0e10cSrcweir             	lower layers, or how to combine the values). The
114*cdf0e10cSrcweir             	default is
115*cdf0e10cSrcweir             	::com::sun::star::animations::AnimationAdditiveMode::BASE,
116*cdf0e10cSrcweir             	which means, take the value of the underlying layers,
117*cdf0e10cSrcweir             	or from the model shape itself.
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir                 @param nMode
120*cdf0e10cSrcweir                 Must be one of
121*cdf0e10cSrcweir                 ::com::sun::star::animations::AnimationAdditiveMode.
122*cdf0e10cSrcweir              */
123*cdf0e10cSrcweir             void setAdditiveMode( sal_Int16 nMode );
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir             // Attribute methods
126*cdf0e10cSrcweir             //------------------------------------------------------------------
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir             /** Query whether the width attribute is valid.
129*cdf0e10cSrcweir              */
130*cdf0e10cSrcweir             bool isWidthValid() const;
131*cdf0e10cSrcweir             /** Query the current width of the shape
132*cdf0e10cSrcweir              */
133*cdf0e10cSrcweir             double getWidth() const;
134*cdf0e10cSrcweir             /** Set the new width of the shape
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 				@param rNewWidth
137*cdf0e10cSrcweir                 A negative width mirrors the shape.
138*cdf0e10cSrcweir              */
139*cdf0e10cSrcweir             void setWidth( const double& rNewWidth );
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir             /** Query whether the height attribute is valid.
142*cdf0e10cSrcweir              */
143*cdf0e10cSrcweir             bool isHeightValid() const;
144*cdf0e10cSrcweir             /** Query the current height of the shape
145*cdf0e10cSrcweir              */
146*cdf0e10cSrcweir             double getHeight() const;
147*cdf0e10cSrcweir             /** Set the new height of the shape
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 				@param rNewHeight
150*cdf0e10cSrcweir                 A negative height mirrors the shape.
151*cdf0e10cSrcweir              */
152*cdf0e10cSrcweir             void setHeight( const double& rNewHeight );
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir             /** Set the new size of the shape
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir 				@param rNewSize
157*cdf0e10cSrcweir                 A negative size mirrors the shape.
158*cdf0e10cSrcweir              */
159*cdf0e10cSrcweir             void setSize( const ::basegfx::B2DSize& rNewSize );
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir             /** Query whether the x position attribute is valid
162*cdf0e10cSrcweir              */
163*cdf0e10cSrcweir             bool isPosXValid() const;
164*cdf0e10cSrcweir             /** Query the current x position of the shape.
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir             	The current x position of the shape is always relative
167*cdf0e10cSrcweir             	to the <em>center</em> of the shape (in contrast to
168*cdf0e10cSrcweir             	the Shape::getBounds() and Shape::getUpdateArea()
169*cdf0e10cSrcweir             	methods).
170*cdf0e10cSrcweir              */
171*cdf0e10cSrcweir             double getPosX() const;
172*cdf0e10cSrcweir             /** Set the new x position of the shape
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir             	The current x position of the shape is always relative
175*cdf0e10cSrcweir             	to the <em>center</em> of the shape (in contrast to
176*cdf0e10cSrcweir             	the Shape::getBounds() and Shape::getUpdateArea()
177*cdf0e10cSrcweir             	methods).
178*cdf0e10cSrcweir              */
179*cdf0e10cSrcweir             void setPosX( const double& rNewX );
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir             /** Query whether the y position attribute is valid
182*cdf0e10cSrcweir              */
183*cdf0e10cSrcweir             bool isPosYValid() const;
184*cdf0e10cSrcweir             /** Query the current y position of the shape
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir             	The current y position of the shape is always relative
187*cdf0e10cSrcweir             	to the <em>center</em> of the shape (in contrast to
188*cdf0e10cSrcweir             	the Shape::getBounds() and Shape::getUpdateArea()
189*cdf0e10cSrcweir             	methods).
190*cdf0e10cSrcweir              */
191*cdf0e10cSrcweir             double getPosY() const;
192*cdf0e10cSrcweir             /** Set the new y position of the shape
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir             	The current y position of the shape is always relative
195*cdf0e10cSrcweir             	to the <em>center</em> of the shape (in contrast to
196*cdf0e10cSrcweir             	the Shape::getBounds() and Shape::getUpdateArea()
197*cdf0e10cSrcweir             	methods).
198*cdf0e10cSrcweir              */
199*cdf0e10cSrcweir             void setPosY( const double& rNewY );
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir             /** Set the new position of the shape
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir             	The current position of the shape is always relative
204*cdf0e10cSrcweir             	to the <em>center</em> of the shape (in contrast to
205*cdf0e10cSrcweir             	the Shape::getBounds() and Shape::getUpdateArea()
206*cdf0e10cSrcweir             	methods).
207*cdf0e10cSrcweir              */
208*cdf0e10cSrcweir             void setPosition( const ::basegfx::B2DPoint& rNewPos );
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir             /** Query whether the rotation angle attribute is valid
211*cdf0e10cSrcweir              */
212*cdf0e10cSrcweir             bool isRotationAngleValid() const;
213*cdf0e10cSrcweir             /** Query the current rotation angle of the shape
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir             	@return the rotation angle in degrees.
216*cdf0e10cSrcweir              */
217*cdf0e10cSrcweir             double getRotationAngle() const;
218*cdf0e10cSrcweir             /** Set the new rotation angle of the shape
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir             	@param rNewAngle
221*cdf0e10cSrcweir                 New rotation angle in degrees.
222*cdf0e10cSrcweir              */
223*cdf0e10cSrcweir             void setRotationAngle( const double& rNewAngle );
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir             /** Query whether the shear x angle attribute is valid
226*cdf0e10cSrcweir              */
227*cdf0e10cSrcweir             bool isShearXAngleValid() const;
228*cdf0e10cSrcweir             /** Query the current shear angle at the x axis of the shape
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir             	@return the shear angle in degrees.
231*cdf0e10cSrcweir              */
232*cdf0e10cSrcweir             double getShearXAngle() const;
233*cdf0e10cSrcweir             /** Set the new shear angle at the x axis of the shape
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir             	@param rNewAngle
236*cdf0e10cSrcweir                 New shear angle in radians.
237*cdf0e10cSrcweir              */
238*cdf0e10cSrcweir             void setShearXAngle( const double& rNewAngle );
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir             /** Query whether the shear y angle attribute is valid
241*cdf0e10cSrcweir              */
242*cdf0e10cSrcweir             bool isShearYAngleValid() const;
243*cdf0e10cSrcweir             /** Query the current shear angle at the y axis of the shape
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir             	@return the shear angle in degrees.
246*cdf0e10cSrcweir              */
247*cdf0e10cSrcweir             double getShearYAngle() const;
248*cdf0e10cSrcweir             /** Set the new shear angle at the y axis of the shape
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir             	@param rNewAngle
251*cdf0e10cSrcweir                 New shear angle in radians.
252*cdf0e10cSrcweir              */
253*cdf0e10cSrcweir             void setShearYAngle( const double& rNewAngle );
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir             /** Query whether the alpha attribute is valid
256*cdf0e10cSrcweir              */
257*cdf0e10cSrcweir             bool isAlphaValid() const;
258*cdf0e10cSrcweir             /** Query the current alpha value of the shape
259*cdf0e10cSrcweir              */
260*cdf0e10cSrcweir             double getAlpha() const;
261*cdf0e10cSrcweir             /** Set the new alpha value of the shape
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir             	@param rNewValue
264*cdf0e10cSrcweir                 New alpha value, must be in the [0,1] range
265*cdf0e10cSrcweir              */
266*cdf0e10cSrcweir             void setAlpha( const double& rNewValue );
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir             /** Query whether the clip attribute is valid
269*cdf0e10cSrcweir              */
270*cdf0e10cSrcweir             bool isClipValid() const;
271*cdf0e10cSrcweir             /** Query the current clip polygon of the shape
272*cdf0e10cSrcweir              */
273*cdf0e10cSrcweir             ::basegfx::B2DPolyPolygon getClip() const;
274*cdf0e10cSrcweir             /** Set the new clip polygon of the shape
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir             	@param rNewClip
277*cdf0e10cSrcweir                 New clip polygon, is interpreted in shape view coordinates, but
278*cdf0e10cSrcweir                 relative to the shape (i.e. the origin of the shape coincides
279*cdf0e10cSrcweir                 with the origin of the clip polygon).
280*cdf0e10cSrcweir              */
281*cdf0e10cSrcweir             void setClip( const ::basegfx::B2DPolyPolygon& rNewClip );
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir             /** Query whether the dim color attribute is valid
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir             	The dim color globally 'dims' the shape towards that
286*cdf0e10cSrcweir             	color
287*cdf0e10cSrcweir              */
288*cdf0e10cSrcweir             bool isDimColorValid() const;
289*cdf0e10cSrcweir             /** Get the dim color for the whole shape.
290*cdf0e10cSrcweir              */
291*cdf0e10cSrcweir             RGBColor getDimColor() const;
292*cdf0e10cSrcweir             /** Set the dim color globally for the whole shape.
293*cdf0e10cSrcweir              */
294*cdf0e10cSrcweir             void setDimColor( const RGBColor& nNewColor );
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir             /** Query whether the fill color attribute is valid
297*cdf0e10cSrcweir              */
298*cdf0e10cSrcweir             bool isFillColorValid() const;
299*cdf0e10cSrcweir             /** Get the fill color for the whole shape.
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir             	If there's no unique fill color, the color from the
302*cdf0e10cSrcweir             	first filled polygon is returned.
303*cdf0e10cSrcweir              */
304*cdf0e10cSrcweir             RGBColor getFillColor() const;
305*cdf0e10cSrcweir             /** Set the fill color globally for the whole shape.
306*cdf0e10cSrcweir              */
307*cdf0e10cSrcweir             void setFillColor( const RGBColor& nNewColor );
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir             /** Query whether the line color attribute is valid
310*cdf0e10cSrcweir              */
311*cdf0e10cSrcweir             bool isLineColorValid() const;
312*cdf0e10cSrcweir             /** Get the line color for the whole shape.
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir             	If there's no unique line color, the color from the
315*cdf0e10cSrcweir             	first line is returned.
316*cdf0e10cSrcweir              */
317*cdf0e10cSrcweir             RGBColor  getLineColor() const;
318*cdf0e10cSrcweir             /** Set the line color globally for the whole shape.
319*cdf0e10cSrcweir              */
320*cdf0e10cSrcweir             void setLineColor( const RGBColor& nNewColor );
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir             /** Query whether the fill mode attribute is valid
323*cdf0e10cSrcweir              */
324*cdf0e10cSrcweir             bool isFillStyleValid() const;
325*cdf0e10cSrcweir             /** Get the current fill mode for polygon fillings.
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir 				@returns the current style
328*cdf0e10cSrcweir              */
329*cdf0e10cSrcweir             sal_Int16 getFillStyle() const;
330*cdf0e10cSrcweir             /** Changes polygon fillings.
331*cdf0e10cSrcweir              */
332*cdf0e10cSrcweir             void setFillStyle( const sal_Int16& rStyle );
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir             /** Query whether the line mode attribute is valid
335*cdf0e10cSrcweir              */
336*cdf0e10cSrcweir             bool isLineStyleValid() const;
337*cdf0e10cSrcweir             /** Get the current line mode for line drawing.
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir 				@returns the current line style
340*cdf0e10cSrcweir              */
341*cdf0e10cSrcweir             sal_Int16 getLineStyle() const;
342*cdf0e10cSrcweir             /** Set line style for the whole shape
343*cdf0e10cSrcweir              */
344*cdf0e10cSrcweir             void setLineStyle( const sal_Int16& rStyle );
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir             /** Query whether the visibility state attribute is valid
347*cdf0e10cSrcweir              */
348*cdf0e10cSrcweir             bool isVisibilityValid() const;
349*cdf0e10cSrcweir             /** Get the current shape visibility.
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir 				@returns true for visible, false for invisible.
352*cdf0e10cSrcweir              */
353*cdf0e10cSrcweir             bool getVisibility() const;
354*cdf0e10cSrcweir             /** Set the shape visibility
355*cdf0e10cSrcweir              */
356*cdf0e10cSrcweir             void setVisibility( const bool& bVisible );
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir             /** Query whether the char color attribute is valid
359*cdf0e10cSrcweir              */
360*cdf0e10cSrcweir             bool isCharColorValid() const;
361*cdf0e10cSrcweir             /** Get the text color for the whole shape.
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir             	If there's no unique text color, the color from the
364*cdf0e10cSrcweir             	first text drawn is returned.
365*cdf0e10cSrcweir              */
366*cdf0e10cSrcweir             RGBColor getCharColor() const;
367*cdf0e10cSrcweir             /** Set the text color globally for the whole shape.
368*cdf0e10cSrcweir              */
369*cdf0e10cSrcweir             void setCharColor( const RGBColor& nNewColor );
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir             /** Query whether the char rotation angle attribute is valid
372*cdf0e10cSrcweir              */
373*cdf0e10cSrcweir             bool isCharRotationAngleValid() const;
374*cdf0e10cSrcweir             /** Query the current text rotation angle of the shape
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir             	@return the text rotation angle in degrees.
377*cdf0e10cSrcweir              */
378*cdf0e10cSrcweir             double getCharRotationAngle() const;
379*cdf0e10cSrcweir             /** Set the new text rotation angle of the shape
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir             	@param rNewAngle
382*cdf0e10cSrcweir                 New text rotation angle in degrees.
383*cdf0e10cSrcweir              */
384*cdf0e10cSrcweir             void setCharRotationAngle( const double& rNewAngle );
385*cdf0e10cSrcweir 
386*cdf0e10cSrcweir             /** Query whether the char weight attribute is valid
387*cdf0e10cSrcweir              */
388*cdf0e10cSrcweir             bool isCharWeightValid() const;
389*cdf0e10cSrcweir             /** Get the current char weight value for the whole shape.
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir 				@returns the value for the char weight. The value must
392*cdf0e10cSrcweir 				be out of the ::com::sun::star::awt::FontWeight
393*cdf0e10cSrcweir 				constant group.
394*cdf0e10cSrcweir              */
395*cdf0e10cSrcweir             double getCharWeight() const;
396*cdf0e10cSrcweir             /** Set the char weight globally for the whole shape.
397*cdf0e10cSrcweir 
398*cdf0e10cSrcweir             	The value must be out of the
399*cdf0e10cSrcweir             	::com::sun::star::awt::FontWeight constant group.
400*cdf0e10cSrcweir              */
401*cdf0e10cSrcweir             void setCharWeight( const double& rStyle );
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir             /** Query whether the underline mode attribute is valid
404*cdf0e10cSrcweir              */
405*cdf0e10cSrcweir             bool isUnderlineModeValid() const;
406*cdf0e10cSrcweir             /** Get the current text underline status for the whole shape.
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir             	If there is no unique underline status, false is returned.
409*cdf0e10cSrcweir 
410*cdf0e10cSrcweir 				@returns true for underlined text, false for normal.
411*cdf0e10cSrcweir              */
412*cdf0e10cSrcweir             sal_Int16 getUnderlineMode() const;
413*cdf0e10cSrcweir             /** Set the underline status globally for the whole shape
414*cdf0e10cSrcweir              */
415*cdf0e10cSrcweir             void setUnderlineMode( const sal_Int16& bUnderline );
416*cdf0e10cSrcweir 
417*cdf0e10cSrcweir             /** Query whether the font family attribute is valid
418*cdf0e10cSrcweir              */
419*cdf0e10cSrcweir             bool isFontFamilyValid() const;
420*cdf0e10cSrcweir             /** Get the current text font family for the whole shape.
421*cdf0e10cSrcweir 
422*cdf0e10cSrcweir             	If there is no unique font family, the font family of
423*cdf0e10cSrcweir             	the first text of the shape is returned.
424*cdf0e10cSrcweir              */
425*cdf0e10cSrcweir             ::rtl::OUString getFontFamily() const;
426*cdf0e10cSrcweir             /** Set the text font family name globally for the whole shape
427*cdf0e10cSrcweir              */
428*cdf0e10cSrcweir             void setFontFamily( const ::rtl::OUString& rName );
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir             /** Query whether the italic mode attribute is valid
431*cdf0e10cSrcweir              */
432*cdf0e10cSrcweir             bool isCharPostureValid() const;
433*cdf0e10cSrcweir             /** Get the current text italic style for the whole shape.
434*cdf0e10cSrcweir 
435*cdf0e10cSrcweir 				@returns the italic style. The value returned is one
436*cdf0e10cSrcweir 				of the ::com::sun::star::awt::FontSlant enums
437*cdf0e10cSrcweir              */
438*cdf0e10cSrcweir             sal_Int16 getCharPosture() const;
439*cdf0e10cSrcweir             /** Set the italic style globally for the whole shape.
440*cdf0e10cSrcweir 
441*cdf0e10cSrcweir             	The value must be one of the
442*cdf0e10cSrcweir             	::com::sun::star::awt::FontSlant enums.
443*cdf0e10cSrcweir             */
444*cdf0e10cSrcweir             void setCharPosture( const sal_Int16& rStyle );
445*cdf0e10cSrcweir 
446*cdf0e10cSrcweir             /** Query whether the char scaling attribute is valid
447*cdf0e10cSrcweir              */
448*cdf0e10cSrcweir             bool isCharScaleValid() const;
449*cdf0e10cSrcweir             /** Query the current char scaling attribute globally for
450*cdf0e10cSrcweir                 the shape.
451*cdf0e10cSrcweir 
452*cdf0e10cSrcweir                 The char scaling changes the scale of the whole shape
453*cdf0e10cSrcweir                 text (uniformely, i.e. both in x and in y direction).
454*cdf0e10cSrcweir              */
455*cdf0e10cSrcweir             double getCharScale() const;
456*cdf0e10cSrcweir             /** Set the new char scale globally for the shape
457*cdf0e10cSrcweir 
458*cdf0e10cSrcweir             	@param rNewScale
459*cdf0e10cSrcweir                 New char scale
460*cdf0e10cSrcweir              */
461*cdf0e10cSrcweir             void setCharScale( const double& rNewScale );
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir             // State change query methods
464*cdf0e10cSrcweir             // ==========================
465*cdf0e10cSrcweir 
466*cdf0e10cSrcweir             State::StateId getTransformationState() const;
467*cdf0e10cSrcweir             State::StateId getClipState() const;
468*cdf0e10cSrcweir             State::StateId getAlphaState() const;
469*cdf0e10cSrcweir             State::StateId getPositionState() const;
470*cdf0e10cSrcweir             State::StateId getContentState() const;
471*cdf0e10cSrcweir             State::StateId getVisibilityState() const;
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir         private:
474*cdf0e10cSrcweir             // default copy/assignment operator is okay
475*cdf0e10cSrcweir             // ShapeAttributeLayer(const ShapeAttributeLayer&);
476*cdf0e10cSrcweir             // ShapeAttributeLayer& operator=( const ShapeAttributeLayer& );
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir             bool haveChild() const { return mpChild; }
479*cdf0e10cSrcweir             void updateStateIds();
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir             template< typename T > T calcValue( const T& 				   rCurrValue,
482*cdf0e10cSrcweir                                                 bool						   bThisInstanceValid,
483*cdf0e10cSrcweir                                                 bool (ShapeAttributeLayer::*pIsValid)() const,
484*cdf0e10cSrcweir                                                 T 	(ShapeAttributeLayer::*pGetValue)() const ) const;
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir             ShapeAttributeLayerSharedPtr				mpChild; // may be NULL
487*cdf0e10cSrcweir 
488*cdf0e10cSrcweir             ::basegfx::B2DSize 							maSize;
489*cdf0e10cSrcweir             ::basegfx::B2DPoint							maPosition;
490*cdf0e10cSrcweir             ::basegfx::B2DPolyPolygon					maClip;
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir             ::rtl::OUString								maFontFamily;
493*cdf0e10cSrcweir 
494*cdf0e10cSrcweir             double										mnRotationAngle;
495*cdf0e10cSrcweir             double 										mnShearXAngle;
496*cdf0e10cSrcweir             double										mnShearYAngle;
497*cdf0e10cSrcweir             double										mnAlpha;
498*cdf0e10cSrcweir             double										mnCharRotationAngle;
499*cdf0e10cSrcweir             double										mnCharScale;
500*cdf0e10cSrcweir             double										mnCharWeight;
501*cdf0e10cSrcweir 
502*cdf0e10cSrcweir             ::com::sun::star::drawing::FillStyle		meFillStyle;
503*cdf0e10cSrcweir             ::com::sun::star::drawing::LineStyle		meLineStyle;
504*cdf0e10cSrcweir             ::com::sun::star::awt::FontSlant			meCharPosture;
505*cdf0e10cSrcweir             sal_Int16									mnUnderlineMode;
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir             RGBColor									maDimColor;
508*cdf0e10cSrcweir             RGBColor									maFillColor;
509*cdf0e10cSrcweir             RGBColor									maLineColor;
510*cdf0e10cSrcweir             RGBColor									maCharColor;
511*cdf0e10cSrcweir 
512*cdf0e10cSrcweir             State::StateId 								mnTransformationState;
513*cdf0e10cSrcweir             State::StateId 								mnClipState;
514*cdf0e10cSrcweir             State::StateId 								mnAlphaState;
515*cdf0e10cSrcweir             State::StateId 								mnPositionState;
516*cdf0e10cSrcweir             State::StateId 								mnContentState;
517*cdf0e10cSrcweir             State::StateId 								mnVisibilityState;
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir             sal_Int16									mnAdditiveMode;
520*cdf0e10cSrcweir 
521*cdf0e10cSrcweir             bool										mbVisibility 			: 1;
522*cdf0e10cSrcweir 
523*cdf0e10cSrcweir             bool										mbWidthValid 			: 1;
524*cdf0e10cSrcweir             bool										mbHeightValid 			: 1;
525*cdf0e10cSrcweir             bool										mbPosXValid 			: 1;
526*cdf0e10cSrcweir             bool										mbPosYValid 			: 1;
527*cdf0e10cSrcweir             bool										mbClipValid				: 1;
528*cdf0e10cSrcweir 
529*cdf0e10cSrcweir             bool										mbFontFamilyValid 		: 1;
530*cdf0e10cSrcweir 
531*cdf0e10cSrcweir             bool										mbRotationAngleValid	: 1;
532*cdf0e10cSrcweir             bool										mbShearXAngleValid		: 1;
533*cdf0e10cSrcweir             bool										mbShearYAngleValid		: 1;
534*cdf0e10cSrcweir 
535*cdf0e10cSrcweir             bool										mbAlphaValid			: 1;
536*cdf0e10cSrcweir 
537*cdf0e10cSrcweir             bool										mbCharRotationAngleValid: 1;
538*cdf0e10cSrcweir             bool										mbCharScaleValid		: 1;
539*cdf0e10cSrcweir 
540*cdf0e10cSrcweir             bool										mbDimColorValid			: 1;
541*cdf0e10cSrcweir             bool										mbFillColorValid		: 1;
542*cdf0e10cSrcweir             bool										mbLineColorValid		: 1;
543*cdf0e10cSrcweir             bool										mbCharColorValid		: 1;
544*cdf0e10cSrcweir 
545*cdf0e10cSrcweir             bool										mbFillStyleValid		: 1;
546*cdf0e10cSrcweir             bool										mbLineStyleValid		: 1;
547*cdf0e10cSrcweir             bool										mbCharWeightValid		: 1;
548*cdf0e10cSrcweir             bool										mbUnderlineModeValid	: 1;
549*cdf0e10cSrcweir             bool										mbCharPostureValid		: 1;
550*cdf0e10cSrcweir             bool										mbVisibilityValid		: 1;
551*cdf0e10cSrcweir         };
552*cdf0e10cSrcweir 
553*cdf0e10cSrcweir     }
554*cdf0e10cSrcweir }
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_SHAPEATTRIBUTELAYER_HXX */
557