merge the formfield patch from ooo-build
[ooovba.git] / filter / source / svg / parserfragments.hxx
bloba65900eaee5e3937623d4d60816860e17995e30a
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * Author:
6 * Fridrich Strba <fridrich.strba@bluewin.ch>
7 * Thorsten Behrens <tbehrens@novell.com>
9 * Copyright (C) 2008, Novell Inc.
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
14 ************************************************************************/
16 #ifndef INCLUDED_PARSERFRAGMENTS_HXX
17 #define INCLUDED_PARSERFRAGMENTS_HXX
19 #include <sal/config.h>
20 #include <vector>
21 #include <utility>
22 #include <string>
24 namespace basegfx
26 class B2DHomMatrix;
27 class B2DRange;
29 namespace svgi
31 struct ARGBColor;
33 /// Parse given string for one of the SVG color grammars
34 bool parseColor( const char* sColor, ARGBColor& rColor );
35 bool parseOpacity( const char* sOpacity, ARGBColor& rColor );
37 /// Parse given string for one of the SVG transformation grammars
38 bool parseTransform( const char* sTransform, basegfx::B2DHomMatrix& rTransform );
40 /// Parse given string for the viewBox attribute
41 bool parseViewBox( const char* sViewbox, basegfx::B2DRange& rRect );
43 /// Parse given string for a list of double values, comma-delimited
44 bool parseDashArray( const char* sDashArray, std::vector<double>& rOutputVector );
46 /** Parse paint uri
48 @param o_rPaintUri
49 Start and end ptr for uri substring (within
50 [sPaintUri,sPaintUri+strlen(sPaintUri)]
52 @param io_rColor
53 The optional paint color to use. if o_rPaintUri is empty,
54 parser sets io_rColor.second to false for color="None", to
55 true and keeps current io_rColor.first entry for
56 "currentColor", and to true and sets io_rColor.first to parsed
57 color otherwise.
59 @param sPaintUri
60 String to parse. Permitted to contain the optional paint
61 stuff, like fallback color.
63 @return true, if a paint uri was successfully parsed.
65 bool parsePaintUri( std::pair<const char*,const char*>& o_rPaintUri,
66 std::pair<ARGBColor,bool>& io_rColor,
67 const char* sPaintUri );
69 /// Parse given string for the xlink attribute
70 bool parseXlinkHref( const char* xlink, std::string& data );
72 } // namespace svgi
74 #endif