LibreOffice Module oox (master)  1
vmlformatting.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_VML_VMLFORMATTING_HXX
21 #define INCLUDED_OOX_VML_VMLFORMATTING_HXX
22 
23 #include <sal/config.h>
24 
25 #include <string_view>
26 #include <utility>
27 #include <vector>
28 
29 #include <com/sun/star/drawing/PolygonFlags.hpp>
30 #include <com/sun/star/uno/Reference.hxx>
31 #include <oox/dllapi.h>
32 #include <oox/helper/helper.hxx>
33 #include <rtl/ustring.hxx>
34 #include <sal/types.h>
35 #include <tools/degree.hxx>
36 
37 namespace com::sun::star {
38  namespace awt { struct Point; }
39  namespace drawing { class XShape; }
40 }
41 
42 namespace oox {
43  class GraphicHelper;
44  namespace drawingml { class Color; }
45  namespace drawingml { class ShapePropertyMap; }
46 }
47 
48 namespace oox::vml {
49 
50 
51 typedef ::std::pair< sal_Int32, sal_Int32 > Int32Pair;
52 typedef ::std::pair< double, double > DoublePair;
53 
54 
55 namespace ConversionHelper
56 {
60  OUString& orValue1, OUString& orValue2,
61  const OUString& rValue, sal_Unicode cSep );
62 
66  OOX_DLLPUBLIC bool decodeBool( std::u16string_view rValue );
67 
78  const OUString& rValue,
79  double fDefValue );
80 
91  OOX_DLLPUBLIC Degree100 decodeRotation( const OUString& rValue );
92 
112  const GraphicHelper& rGraphicHelper,
113  const OUString& rValue,
114  sal_Int32 nRefValue,
115  bool bPixelX,
116  bool bDefaultAsPixel );
117 
127  const GraphicHelper& rGraphicHelper,
128  const OUString& rValue,
129  sal_Int32 nRefValue,
130  bool bPixelX,
131  bool bDefaultAsPixel );
132 
155  OOX_DLLPUBLIC ::oox::drawingml::Color decodeColor(
156  const GraphicHelper& rGraphicHelper,
157  const OptValue< OUString >& roVmlColor,
158  const OptValue< double >& roVmlOpacity,
159  ::Color nDefaultRgb,
160  ::Color nPrimaryRgb = API_RGB_TRANSPARENT );
161 
175  ::std::vector< ::std::vector< css::awt::Point > >& rPoints,
176  ::std::vector< ::std::vector< css::drawing::PolygonFlags > >& rFlags,
177  const OUString& rPath );
178 }
179 
180 
183 {
187 
188  void assignUsed( const StrokeArrowModel& rSource );
189 };
190 
191 
194 {
205 
206  void assignUsed( const StrokeModel& rSource );
207 
209  void pushToPropMap(
211  const GraphicHelper& rGraphicHelper ) const;
212 };
213 
214 
217 {
230 
231  void assignUsed( const FillModel& rSource );
232 
234  void pushToPropMap(
236  const GraphicHelper& rGraphicHelper ) const;
237 };
238 
239 
242 {
243  bool mbHasShadow;
248 
249  ShadowModel();
250 
252  void pushToPropMap(oox::drawingml::ShapePropertyMap& rPropMap, const GraphicHelper& rGraphicHelper) const;
253 };
254 
257 {
261 
262  TextpathModel();
263 
265  void pushToPropMap(oox::drawingml::ShapePropertyMap& rPropMap, const css::uno::Reference<css::drawing::XShape>& xShape,
266  const GraphicHelper& rGraphicHelper) const;
267 };
268 
269 } // namespace oox::vml
270 
271 #endif
272 
273 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
OOX_DLLPUBLIC sal_Int32 decodeMeasureToHmm(const GraphicHelper &rGraphicHelper, const OUString &rValue, sal_Int32 nRefValue, bool bPixelX, bool bDefaultAsPixel)
Converts the passed VML measure string to 1/100 mm.
OptValue< bool > moTrim
Specifies whether extra space is removed above and below the text.
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.
OptValue< OUString > moColor
Specifies the color of the shadow.
OptValue< OUString > moDashStyle
Line dash (predefined or manually).
void pushToPropMap(oox::drawingml::ShapePropertyMap &rPropMap, const css::uno::Reference< css::drawing::XShape > &xShape, const GraphicHelper &rGraphicHelper) const
Writes the properties to the passed property map.
The stroke model structure contains all shape border properties.
OOX_DLLPUBLIC bool decodeBool(std::u16string_view rValue)
Returns the boolean value from the passed string of a VML attribute.
OptValue< OUString > moStyle
Specifies the style of the textpath.
OptValue< sal_Int32 > moArrowType
OptValue< double > moOpacity
Solid fill color opacity.
exports com.sun.star. awt
OptValue< sal_Int32 > moAngle
Gradient rotation angle.
OOX_DLLPUBLIC Degree100 decodeRotation(const OUString &rValue)
Converts the passed VML rotation value to degrees.
StrokeArrowModel maStartArrow
Start line arrow style.
OptValue< OUString > moColor2
End color of gradient.
OptValue< double > moOpacity
Specifies the opacity of the shadow.
OptValue< sal_Int32 > moType
Fill type.
sal_uInt16 sal_Unicode
OptValue< bool > moStroked
Shape border line on/off.
OptValue< sal_Int32 > moArrowLength
The fill model structure contains all shape fill properties.
exports com.sun.star. drawing
OOX_DLLPUBLIC sal_Int64 decodeMeasureToEmu(const GraphicHelper &rGraphicHelper, const OUString &rValue, sal_Int32 nRefValue, bool bPixelX, bool bDefaultAsPixel)
Converts the passed VML measure string to EMU (English Metric Units).
OptValue< OUString > moBitmapPath
Path to fill bitmap fragment.
::std::pair< double, double > DoublePair
OptValue< double > moOpacity2
End color opacity of gradient.
OOX_DLLPUBLIC bool separatePair(OUString &orValue1, OUString &orValue2, const OUString &rValue, sal_Unicode cSep)
Returns two values contained in rValue separated by cSep.
OptValue< sal_Int32 > moLineStyle
Line style (single, double, ...).
OptValue< DoublePair > moFocusPos
Rectangular gradient focus position of second color.
OptValue< double > moOpacity
Solid line color opacity.
The stroke arrow model structure contains all properties for a line end arrow.
OptValue< OUString > moColor
Solid line color.
StrokeArrowModel maEndArrow
End line arrow style.
OptValue< sal_Int32 > moArrowWidth
OptValue< DoublePair > moFocusSize
Rectangular gradient focus size of second color.
OptValue< OUString > moWeight
Line width.
OOX_DLLPUBLIC::oox::drawingml::Color decodeColor(const GraphicHelper &rGraphicHelper, const OptValue< OUString > &roVmlColor, const OptValue< double > &roVmlOpacity,::Color nDefaultRgb,::Color nPrimaryRgb=API_RGB_TRANSPARENT)
Converts VML color attributes to a DrawingML color.
OOX_DLLPUBLIC void decodeVmlPath(::std::vector< ::std::vector< css::awt::Point > > &rPoints,::std::vector< ::std::vector< css::drawing::PolygonFlags > > &rFlags, const OUString &rPath)
Converts VML path string into point and flag vectors.
void assignUsed(const StrokeModel &rSource)
bool mbHasShadow
Is a v:shadow element seen?
OptValue< OUString > moString
Specifies the string of the textpath.
OptValue< double > moFocus
Linear gradient focus of second color.
The shadow model structure contains all shape shadow properties.
void assignUsed(const StrokeArrowModel &rSource)
OptValue< OUString > moColor
Solid fill color.
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
OptValue< bool > moFilled
Shape fill on/off.
The shadow model structure contains all shape textpath properties.
OptValue< bool > moShadowOn
Is the element turned on?
OOX_DLLPUBLIC double decodePercent(const OUString &rValue, double fDefValue)
Converts the passed VML percentage measure string to a normalized floating-point value.
OptValue< bool > moRotate
True = rotate gradient/bitmap with shape.
OptValue< sal_Int32 > moJoinStyle
Type of line join.
::std::pair< sal_Int32, sal_Int32 > Int32Pair
OptValue< OUString > moOffset
Specifies the shadow's offset from the shape's location.
void pushToPropMap(::oox::drawingml::ShapePropertyMap &rPropMap, const GraphicHelper &rGraphicHelper) const
Writes the properties to the passed property map.
OptValue< sal_Int32 > moEndCap
Type of line end cap.