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