LibreOffice Module oox (master) 1
fillproperties.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_OOX_INC_DRAWINGML_FILLPROPERTIES_HXX
21#define INCLUDED_OOX_INC_DRAWINGML_FILLPROPERTIES_HXX
22
23#include <map>
24
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
27#include <com/sun/star/awt/Size.hpp>
28#include <com/sun/star/uno/Any.hxx>
29#include <com/sun/star/uno/Reference.hxx>
31#include <oox/helper/helper.hxx>
33#include <rtl/ustring.hxx>
34#include <sal/types.h>
35
36namespace com::sun::star {
37 namespace graphic { class XGraphic; }
38}
39
40namespace oox {
41 class GraphicHelper;
42}
43
44namespace oox::drawingml {
45
46class ShapePropertyMap;
47
49{
50 typedef ::std::multimap< double, Color > GradientStopMap;
51
53 std::optional< css::geometry::IntegerRectangle2D > moFillToRect;
54 std::optional< css::geometry::IntegerRectangle2D > moTileRect;
55 std::optional< sal_Int32 > moGradientPath;
56 std::optional< sal_Int32 > moShadeAngle;
57 std::optional< sal_Int32 > moShadeFlip;
58 std::optional< bool > moShadeScaled;
59 std::optional< bool > moRotateWithShape;
60
62 void assignUsed( const GradientFillProperties& rSourceProps );
63};
64
66{
69 std::optional< sal_Int32 > moPattPreset;
70
72 void assignUsed( const PatternFillProperties& rSourceProps );
73};
74
76{
77 OUString msName;
78 std::map< OUString, css::uno::Any >
81
82 bool isEmpty() const;
83
86 css::beans::PropertyValue getEffect();
87
89 void assignUsed( const ArtisticEffectProperties& rSourceProps );
90
92 static OUString getEffectString( sal_Int32 nToken );
93
95 static sal_Int32 getEffectToken( const OUString& sName );
96};
97
99{
100 css::uno::Reference<css::graphic::XGraphic> mxFillGraphic;
101 std::optional< sal_Int32 > moBitmapMode;
102 std::optional< css::geometry::IntegerRectangle2D >
104 std::optional< css::geometry::IntegerRectangle2D >
106 std::optional< sal_Int32 > moTileOffsetX;
107 std::optional< sal_Int32 > moTileOffsetY;
108 std::optional< sal_Int32 > moTileScaleX;
109 std::optional< sal_Int32 > moTileScaleY;
110 std::optional< sal_Int32 > moTileAlign;
111 std::optional< sal_Int32 > moTileFlip;
112 std::optional< bool > moRotateWithShape;
113 // effects
114 std::optional< sal_Int32 > moColorEffect;
115 std::optional< sal_Int32 > moBrightness;
116 std::optional< sal_Int32 > moContrast;
117 std::optional< sal_Int32 > moBiLevelThreshold;
121
123 std::optional<sal_Int32> moAlphaModFix;
124
126 void assignUsed( const BlipFillProperties& rSourceProps );
127};
128
130{
131 std::optional< sal_Int32 > moFillType;
133 std::optional< bool > moUseBgFill;
137
139 void assignUsed( const FillProperties& rSourceProps );
140
143 Color getBestSolidColor() const;
144
146 void pushToPropMap(
147 ShapePropertyMap& rPropMap,
148 const GraphicHelper& rGraphicHelper,
149 sal_Int32 nShapeRotation = 0,
151 const css::awt::Size& rSize = {},
152 sal_Int16 nPhClrTheme = -1,
153 bool bFlipH = false,
154 bool bFlipV = false,
155 bool bIsCustomShape = false ) const;
156};
157
158} // namespace oox::drawingml
159
160#endif
161
162/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
OString sName
Definition: drawingml.cxx:4451
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.
bool isEmpty() const
The original graphic as embedded object.
css::beans::PropertyValue getEffect()
Returns the struct as a PropertyValue with Name = msName and Value = maAttribs as a Sequence< Propert...
void assignUsed(const ArtisticEffectProperties &rSourceProps)
Overwrites all members that are explicitly set in rSourceProps.
::oox::ole::OleObjectInfo mrOleObjectInfo
std::map< OUString, css::uno::Any > maAttribs
static OUString getEffectString(sal_Int32 nToken)
Translate effect tokens to strings.
static sal_Int32 getEffectToken(const OUString &sName)
Translate effect strings to tokens.
std::optional< css::geometry::IntegerRectangle2D > moClipRect
Stretch fill offsets.
Color maColorChangeTo
Start color of color transformation.
std::optional< css::geometry::IntegerRectangle2D > moFillRect
Bitmap tile or stretch.
std::optional< sal_Int32 > moColorEffect
True = rotate bitmap with shape.
std::optional< sal_Int32 > moBitmapMode
The fill graphic.
std::optional< sal_Int32 > moTileFlip
Anchor point inside bitmap.
Color maDuotoneColors[2]
Destination color of color transformation.
std::optional< sal_Int32 > moAlphaModFix
Artistic effect, not supported by core.
std::optional< sal_Int32 > moTileScaleY
Horizontal scaling of bitmap tiles (1/1000 percent).
std::optional< sal_Int32 > moTileOffsetY
Width of bitmap tiles (EMUs).
std::optional< sal_Int32 > moBrightness
XML token for a color effect.
Color maColorChangeFrom
Bi-Level (Black/White) effect threshold (1/1000 percent)
std::optional< bool > moRotateWithShape
Flip mode of bitmap tiles.
std::optional< sal_Int32 > moBiLevelThreshold
Contrast in the range [-100000,100000].
css::uno::Reference< css::graphic::XGraphic > mxFillGraphic
ArtisticEffectProperties maEffect
Duotone Colors.
void assignUsed(const BlipFillProperties &rSourceProps)
Overwrites all members that are explicitly set in rSourceProps.
std::optional< sal_Int32 > moTileAlign
Vertical scaling of bitmap tiles (1/1000 percent).
std::optional< sal_Int32 > moTileScaleX
Height of bitmap tiles (EMUs).
std::optional< sal_Int32 > moTileOffsetX
std::optional< sal_Int32 > moContrast
Brightness in the range [-100000,100000].
PatternFillProperties maPatternProps
Properties for gradient fills.
GradientFillProperties maGradientProps
Whether the background is used as fill type.
BlipFillProperties maBlipProps
Properties for pattern fills.
void pushToPropMap(ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper, sal_Int32 nShapeRotation=0, ::Color nPhClr=API_RGB_TRANSPARENT, const css::awt::Size &rSize={}, sal_Int16 nPhClrTheme=-1, bool bFlipH=false, bool bFlipV=false, bool bIsCustomShape=false) const
Writes the properties to the passed property map.
void assignUsed(const FillProperties &rSourceProps)
Properties for bitmap fills.
Color getBestSolidColor() const
Tries to resolve current settings to a solid color, e.g.
std::optional< bool > moUseBgFill
Solid fill color and transparence.
Color maFillColor
Fill type (OOXML token).
std::optional< sal_Int32 > moFillType
std::optional< css::geometry::IntegerRectangle2D > moFillToRect
Gradient stops (colors/transparence).
std::optional< sal_Int32 > moShadeFlip
Rotation angle of linear gradients.
std::optional< bool > moRotateWithShape
True = scale gradient into shape.
std::optional< sal_Int32 > moGradientPath
void assignUsed(const GradientFillProperties &rSourceProps)
True = rotate gradient with shape.
std::optional< css::geometry::IntegerRectangle2D > moTileRect
std::optional< bool > moShadeScaled
Flip mode of gradient, if not stretched to shape.
std::optional< sal_Int32 > moShadeAngle
If set, gradient follows rectangle, circle, or shape.
::std::multimap< double, Color > GradientStopMap
Color maPattBgColor
Pattern foreground color.
std::optional< sal_Int32 > moPattPreset
Pattern background color.
void assignUsed(const PatternFillProperties &rSourceProps)
Preset pattern type.
Contains generic information about an OLE object.