Bump version to 5.0-14
[LibreOffice.git] / filter / source / svg / parserfragments.hxx
blob6d4c3522a1405cf66584ba211cf32b6ca9acb856
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 #ifndef INCLUDED_FILTER_SOURCE_SVG_PARSERFRAGMENTS_HXX
10 #define INCLUDED_FILTER_SOURCE_SVG_PARSERFRAGMENTS_HXX
12 #include <sal/config.h>
13 #include <vector>
14 #include <utility>
15 #include <string>
17 namespace basegfx
19 class B2DHomMatrix;
20 class B2DRange;
22 namespace svgi
24 struct ARGBColor;
26 /// Parse given string for one of the SVG color grammars
27 bool parseColor( const char* sColor, ARGBColor& rColor );
28 bool parseOpacity( const char* sOpacity, ARGBColor& rColor );
30 /// Parse given string for one of the SVG transformation grammars
31 bool parseTransform( const char* sTransform, basegfx::B2DHomMatrix& rTransform );
33 /// Parse given string for the viewBox attribute
34 bool parseViewBox( const char* sViewbox, basegfx::B2DRange& rRect );
36 /// Parse given string for a list of double values, comma-delimited
37 bool parseDashArray( const char* sDashArray, std::vector<double>& rOutputVector );
39 /** Parse paint uri
41 @param o_rPaintUri
42 Start and end ptr for uri substring (within
43 [sPaintUri,sPaintUri+strlen(sPaintUri)]
45 @param io_rColor
46 The optional paint color to use. if o_rPaintUri is empty,
47 parser sets io_rColor.second to false for color="None", to
48 true and keeps current io_rColor.first entry for
49 "currentColor", and to true and sets io_rColor.first to parsed
50 color otherwise.
52 @param sPaintUri
53 String to parse. Permitted to contain the optional paint
54 stuff, like fallback color.
56 @return true, if a paint uri was successfully parsed.
58 bool parsePaintUri( std::pair<const char*,const char*>& o_rPaintUri,
59 std::pair<ARGBColor,bool>& io_rColor,
60 const char* sPaintUri );
62 /// Parse given string for the xlink attribute
63 bool parseXlinkHref( const char* xlink, std::string& data );
65 } // namespace svgi
67 #endif
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */