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/uno/Any.hxx>
28#include <com/sun/star/uno/Reference.hxx>
30#include <oox/helper/helper.hxx>
32#include <rtl/ustring.hxx>
33#include <sal/types.h>
34
35namespace com::sun::star {
36 namespace graphic { class XGraphic; }
37}
38
39namespace oox {
40 class GraphicHelper;
41}
42
43namespace oox::drawingml {
44
45class ShapePropertyMap;
46
48{
49 typedef ::std::multimap< double, Color > GradientStopMap;
50
52 std::optional< css::geometry::IntegerRectangle2D > moFillToRect;
53 std::optional< css::geometry::IntegerRectangle2D > moTileRect;
54 std::optional< sal_Int32 > moGradientPath;
55 std::optional< sal_Int32 > moShadeAngle;
56 std::optional< sal_Int32 > moShadeFlip;
57 std::optional< bool > moShadeScaled;
58 std::optional< bool > moRotateWithShape;
59
61 void assignUsed( const GradientFillProperties& rSourceProps );
62};
63
65{
68 std::optional< sal_Int32 > moPattPreset;
69
71 void assignUsed( const PatternFillProperties& rSourceProps );
72};
73
75{
76 OUString msName;
77 std::map< OUString, css::uno::Any >
80
81 bool isEmpty() const;
82
85 css::beans::PropertyValue getEffect();
86
88 void assignUsed( const ArtisticEffectProperties& rSourceProps );
89
91 static OUString getEffectString( sal_Int32 nToken );
92
94 static sal_Int32 getEffectToken( const OUString& sName );
95};
96
98{
99 css::uno::Reference<css::graphic::XGraphic> mxFillGraphic;
100 std::optional< sal_Int32 > moBitmapMode;
101 std::optional< css::geometry::IntegerRectangle2D >
103 std::optional< css::geometry::IntegerRectangle2D >
105 std::optional< sal_Int32 > moTileOffsetX;
106 std::optional< sal_Int32 > moTileOffsetY;
107 std::optional< sal_Int32 > moTileScaleX;
108 std::optional< sal_Int32 > moTileScaleY;
109 std::optional< sal_Int32 > moTileAlign;
110 std::optional< sal_Int32 > moTileFlip;
111 std::optional< bool > moRotateWithShape;
112 // effects
113 std::optional< sal_Int32 > moColorEffect;
114 std::optional< sal_Int32 > moBrightness;
115 std::optional< sal_Int32 > moContrast;
116 std::optional< sal_Int32 > moBiLevelThreshold;
120
122 std::optional<sal_Int32> moAlphaModFix;
123
125 void assignUsed( const BlipFillProperties& rSourceProps );
126};
127
129{
130 std::optional< sal_Int32 > moFillType;
132 std::optional< bool > moUseBgFill;
136
138 void assignUsed( const FillProperties& rSourceProps );
139
142 Color getBestSolidColor() const;
143
145 void pushToPropMap(
146 ShapePropertyMap& rPropMap,
147 const GraphicHelper& rGraphicHelper,
148 sal_Int32 nShapeRotation = 0,
150 sal_Int16 nPhClrTheme = -1,
151 bool bFlipH = false,
152 bool bFlipV = false,
153 bool bIsCustomShape = false ) const;
154};
155
156} // namespace oox::drawingml
157
158#endif
159
160/* 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:4066
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].
void pushToPropMap(ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper, sal_Int32 nShapeRotation=0, ::Color nPhClr=API_RGB_TRANSPARENT, sal_Int16 nPhClrTheme=-1, bool bFlipH=false, bool bFlipV=false, bool bIsCustomShape=false) const
Writes the properties to the passed property map.
PatternFillProperties maPatternProps
Properties for gradient fills.
GradientFillProperties maGradientProps
Whether the background is used as fill type.
BlipFillProperties maBlipProps
Properties for pattern fills.
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.