1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
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>
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
);
49 Start and end ptr for uri substring (within
50 [sPaintUri,sPaintUri+strlen(sPaintUri)]
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
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
);