25#include <com/sun/star/awt/FontUnderline.hpp>
26#include <com/sun/star/awt/FontWeight.hpp>
27#include <com/sun/star/animations/AnimationAdditiveMode.hpp>
67 bool bThisInstanceValid,
74 const bool bChildInstanceValueValid(
haveChild() && (
mpChild.get()->*pIsValid)() );
76 if( bThisInstanceValid )
78 if( bChildInstanceValueValid )
85 case animations::AnimationAdditiveMode::NONE:
87 case animations::AnimationAdditiveMode::BASE:
89 case animations::AnimationAdditiveMode::REPLACE:
97 case animations::AnimationAdditiveMode::SUM:
98 return rCurrValue + ((*mpChild).*pGetValue)();
100 case animations::AnimationAdditiveMode::MULTIPLY:
101 return rCurrValue * ((*mpChild).*pGetValue)();
113 return bChildInstanceValueValid ?
114 ((*mpChild).*pGetValue)() :
122 mpChild( rChildLayer ),
137 meFillStyle( drawing::FillStyle_NONE ),
138 meLineStyle( drawing::LineStyle_NONE ),
139 meCharPosture( awt::FontSlant_NONE ),
147 mnTransformationState( rChildLayer ? rChildLayer->getTransformationState() : 0 ),
148 mnClipState( rChildLayer ? rChildLayer->getClipState() : 0),
149 mnAlphaState( rChildLayer ? rChildLayer->getAlphaState() : 0),
150 mnPositionState( rChildLayer ? rChildLayer->getPositionState() : 0 ),
151 mnContentState( rChildLayer ? rChildLayer->getContentState() : 0 ),
152 mnVisibilityState( rChildLayer ? rChildLayer->getVisibilityState() : 0 ),
154 mnAdditiveMode( animations::AnimationAdditiveMode::
BASE ),
156 mbVisibility( false ),
158 mbWidthValid( false ),
159 mbHeightValid( false ),
160 mbPosXValid( false ),
161 mbPosYValid( false ),
162 mbClipValid( false ),
164 mbFontFamilyValid( false ),
166 mbRotationAngleValid( false ),
167 mbShearXAngleValid( false ),
168 mbShearYAngleValid( false ),
170 mbAlphaValid( false ),
172 mbCharScaleValid( false ),
174 mbDimColorValid( false ),
175 mbFillColorValid( false ),
176 mbLineColorValid( false ),
177 mbCharColorValid( false ),
179 mbFillStyleValid( false ),
180 mbLineStyleValid( false ),
181 mbCharWeightValid( false ),
182 mbUnderlineModeValid( false ),
183 mbCharPostureValid( false ),
184 mbVisibilityValid( false )
191 "ShapeAttributeLayer::revokeChildLayer(): Will not remove NULL child" );
199 mpChild = rChildLayer->getChildLayer();
219 if( !
mpChild->revokeChildLayer( rChildLayer ) )
261 return calcValue< double >(
271 "ShapeAttributeLayer::setWidth(): Invalid width" );
285 return calcValue< double >(
295 "ShapeAttributeLayer::setHeight(): Invalid height" );
305 std::isfinite(rNewSize.getHeight()),
306 "ShapeAttributeLayer::setSize(): Invalid size" );
320 return calcValue< double >(
330 "ShapeAttributeLayer::setPosX(): Invalid position" );
344 return calcValue< double >(
354 "ShapeAttributeLayer::setPosY(): Invalid position" );
375 return calcValue< double >(
385 "ShapeAttributeLayer::setRotationAngle(): Invalid angle" );
408 "ShapeAttributeLayer::setShearXAngle(): Invalid angle" );
431 "ShapeAttributeLayer::setShearYAngle(): Invalid angle" );
454 "ShapeAttributeLayer::setAlpha(): Invalid alpha" );
474 return ::basegfx::B2DPolyPolygon();
554 return sal::static_int_cast<sal_Int16>(
meFillStyle);
556 return sal::static_int_cast<sal_Int16>(
mpChild->getFillStyle());
558 return sal::static_int_cast<sal_Int16>(drawing::FillStyle_SOLID);
564 meFillStyle =
static_cast<drawing::FillStyle
>(rStyle);
579 return sal::static_int_cast<sal_Int16>(
meLineStyle);
581 return sal::static_int_cast<sal_Int16>(
mpChild->getLineStyle());
583 return sal::static_int_cast<sal_Int16>(drawing::LineStyle_SOLID);
589 meLineStyle =
static_cast<drawing::LineStyle
>(rStyle);
606 return mpChild->getVisibility();
650 return mpChild->getCharWeight();
652 return awt::FontWeight::NORMAL;
675 return mpChild->getUnderlineMode();
677 return awt::FontUnderline::NONE;
700 return mpChild->getFontFamily();
724 return sal::static_int_cast<sal_Int16>(
mpChild->getCharPosture());
726 return sal::static_int_cast<sal_Int16>(awt::FontSlant_NONE);
753 "ShapeAttributeLayer::setCharScale(): Invalid height" );
764 mpChild->getTransformationState() ) :
788 mpChild->getPositionState() ) :
804 mpChild->getVisibilityState() ) :
geometry::RealPoint2D maPosition
geometry::RealSize2D maSize
void setHeight(TYPE const &rHeight)
void setWidth(TYPE const &rWidth)
Encapsulates all modifiable attributes of a shape.
void setCharPosture(const sal_Int16 &rStyle)
Set the italic style globally for the whole shape.
bool revokeChildLayer(const ShapeAttributeLayerSharedPtr &rChildLayer)
Revoke the given layer.
void setWidth(const double &rNewWidth)
Set the new width of the shape.
OUString getFontFamily() const
Get the current text font family for the whole shape.
State::StateId mnAlphaState
double getShearYAngle() const
Query the current shear angle at the y axis of the shape.
State::StateId mnContentState
::basegfx::B2DSize maSize
void setVisibility(const bool &bVisible)
Set the shape visibility.
void setShearYAngle(const double &rNewAngle)
Set the new shear angle at the y axis of the shape.
RGBColor getFillColor() const
Get the fill color for the whole shape.
RGBColor getDimColor() const
Get the dim color for the whole shape.
bool isUnderlineModeValid() const
Query whether the underline mode attribute is valid.
bool isShearXAngleValid() const
Query whether the shear x angle attribute is valid.
void setFontFamily(const OUString &rName)
Set the text font family name globally for the whole shape.
void setPosX(const double &rNewX)
Set the new x position of the shape.
T calcValue(const T &rCurrValue, bool bThisInstanceValid, bool(ShapeAttributeLayer::*pIsValid)() const, T(ShapeAttributeLayer::*pGetValue)() const) const
Calc attribute value.
void setLineStyle(const sal_Int16 &rStyle)
Set line style for the whole shape.
State::StateId getContentState() const
void setSize(const ::basegfx::B2DSize &rNewSize)
Set the new size of the shape.
bool isShearYAngleValid() const
Query whether the shear y angle attribute is valid.
double getCharWeight() const
Get the current char weight value for the whole shape.
void updateStateIds()
Update state ids.
bool mbUnderlineModeValid
sal_Int16 mnUnderlineMode
void setCharWeight(const double &rStyle)
Set the char weight globally for the whole shape.
State::StateId getVisibilityState() const
State::StateId mnClipState
void setAlpha(const double &rNewValue)
Set the new alpha value of the shape.
State::StateId mnPositionState
bool isCharPostureValid() const
Query whether the italic mode attribute is valid.
State::StateId getClipState() const
bool mbRotationAngleValid
void setPosition(const ::basegfx::B2DPoint &rNewPos)
Set the new position of the shape.
void setFillStyle(const sal_Int16 &rStyle)
Changes polygon fillings.
bool isFillColorValid() const
Query whether the fill color attribute is valid.
void setUnderlineMode(const sal_Int16 &bUnderline)
Set the underline status globally for the whole shape.
void setHeight(const double &rNewHeight)
Set the new height of the shape.
bool isLineColorValid() const
Query whether the line color attribute is valid.
bool isFontFamilyValid() const
Query whether the font family attribute is valid.
bool isVisibilityValid() const
Query whether the visibility state attribute is valid.
const ShapeAttributeLayerSharedPtr & getChildLayer() const
Query the child layer of this object.
bool isRotationAngleValid() const
Query whether the rotation angle attribute is valid.
RGBColor getCharColor() const
Get the text color for the whole shape.
State::StateId getPositionState() const
double getPosY() const
Query the current y position of the shape.
void setRotationAngle(const double &rNewAngle)
Set the new rotation angle of the shape.
css::drawing::LineStyle meLineStyle
bool isCharColorValid() const
Query whether the char color attribute is valid.
State::StateId getTransformationState() const
sal_Int16 getLineStyle() const
Get the current line mode for line drawing.
void setCharColor(const RGBColor &nNewColor)
Set the text color globally for the whole shape.
bool isCharScaleValid() const
Query whether the char scaling attribute is valid.
bool isPosXValid() const
Query whether the x position attribute is valid.
bool isDimColorValid() const
Query whether the dim color attribute is valid.
double getShearXAngle() const
Query the current shear angle at the x axis of the shape.
ShapeAttributeLayerSharedPtr mpChild
void setAdditiveMode(sal_Int16 nMode)
Set the additive mode for possible child attributes.
ShapeAttributeLayer(const ShapeAttributeLayerSharedPtr &rChildLayer)
Create a ShapeAttributeLayer instance, with all attributes set to default.
sal_Int16 getFillStyle() const
Get the current fill mode for polygon fillings.
double getAlpha() const
Query the current alpha value of the shape.
bool isWidthValid() const
Query whether the width attribute is valid.
void setFillColor(const RGBColor &nNewColor)
Set the fill color globally for the whole shape.
void setCharScale(const double &rNewScale)
Set the new char scale globally for the shape.
css::drawing::FillStyle meFillStyle
bool isPosYValid() const
Query whether the y position attribute is valid.
State::StateId mnTransformationState
bool isAlphaValid() const
Query whether the alpha attribute is valid.
double getRotationAngle() const
Query the current rotation angle of the shape.
void setDimColor(const RGBColor &nNewColor)
Set the dim color globally for the whole shape.
bool isLineStyleValid() const
Query whether the line mode attribute is valid.
bool isClipValid() const
Query whether the clip attribute is valid.
css::awt::FontSlant meCharPosture
void setClip(const ::basegfx::B2DPolyPolygon &rNewClip)
Set the new clip polygon of the shape.
double getHeight() const
Query the current height of the shape.
double getWidth() const
Query the current width of the shape.
sal_Int16 getUnderlineMode() const
Get the current text underline status for the whole shape.
bool isFillStyleValid() const
Query whether the fill mode attribute is valid.
State::StateId mnVisibilityState
sal_Int16 getCharPosture() const
Get the current text italic style for the whole shape.
::basegfx::B2DPolyPolygon getClip() const
Query the current clip polygon of the shape.
bool isCharWeightValid() const
Query whether the char weight attribute is valid.
bool getVisibility() const
Get the current shape visibility.
double getPosX() const
Query the current x position of the shape.
void setShearXAngle(const double &rNewAngle)
Set the new shear angle at the x axis of the shape.
double getCharScale() const
Query the current char scaling attribute globally for the shape.
State::StateId getAlphaState() const
void setLineColor(const RGBColor &nNewColor)
Set the line color globally for the whole shape.
RGBColor getLineColor() const
Get the line color for the whole shape.
bool isHeightValid() const
Query whether the height attribute is valid.
::basegfx::B2DPoint maPosition
::basegfx::B2DPolyPolygon maClip
void setPosY(const double &rNewY)
Set the new y position of the shape.
::std::size_t StateId
Abstract, numerically encoded state ID.
#define ENSURE_OR_RETURN_FALSE(c, m)
#define ENSURE_OR_THROW(c, m)
::std::shared_ptr< ShapeAttributeLayer > ShapeAttributeLayerSharedPtr
uno::Sequence< double > maFillColor
basegfx::B2DPolyPolygon maClip
Current clip polygon in user coordinates.