1 ////////////////////////////////////////////////////////////////////////////// 2 // Name: SVGPaint.h 3 // Author: Alex Thuering 4 // Copyright: (c) 2005 Alex Thuering 5 // Licence: wxWindows licence 6 // Notes: generated by generate.py 7 ////////////////////////////////////////////////////////////////////////////// 8 9 #ifndef WX_SVG_PAINT_H 10 #define WX_SVG_PAINT_H 11 12 #include "SVGColor.h" 13 #include "String_wxsvg.h" 14 15 16 enum wxSVG_PAINTTYPE 17 { 18 wxSVG_PAINTTYPE_UNKNOWN = 0, 19 wxSVG_PAINTTYPE_RGBCOLOR = 1, 20 wxSVG_PAINTTYPE_RGBCOLOR_ICCCOLOR = 2, 21 wxSVG_PAINTTYPE_NONE = 101, 22 wxSVG_PAINTTYPE_CURRENTCOLOR = 102, 23 wxSVG_PAINTTYPE_URI_NONE = 103, 24 wxSVG_PAINTTYPE_URI_CURRENTCOLOR = 104, 25 wxSVG_PAINTTYPE_URI_RGBCOLOR = 105, 26 wxSVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106, 27 wxSVG_PAINTTYPE_URI = 107 28 }; 29 30 class wxSVGPaint: 31 public wxSVGColor 32 { 33 protected: 34 wxSVG_PAINTTYPE m_paintType; 35 wxString m_uri; 36 37 public: GetPaintType()38 inline wxSVG_PAINTTYPE GetPaintType() const { return m_paintType; } SetPaintType(const wxSVG_PAINTTYPE & n)39 inline void SetPaintType(const wxSVG_PAINTTYPE& n) { m_paintType = n; } 40 41 public: wxSVGPaint()42 wxSVGPaint(): m_paintType(wxSVG_PAINTTYPE_NONE) 43 { m_cssValueType = wxCSS_SVG_PAINT; } wxSVGPaint(unsigned char r,unsigned char g,unsigned char b)44 wxSVGPaint(unsigned char r, unsigned char g, unsigned char b): 45 wxSVGColor(r, g, b), m_paintType(wxSVG_PAINTTYPE_RGBCOLOR) 46 { m_cssValueType = wxCSS_SVG_PAINT; } wxSVGPaint(wxRGBColor color)47 wxSVGPaint(wxRGBColor color): 48 wxSVGColor(color), m_paintType(wxSVG_PAINTTYPE_RGBCOLOR) 49 { m_cssValueType = wxCSS_SVG_PAINT; if (!color.Ok()) m_paintType = wxSVG_PAINTTYPE_NONE; } ~wxSVGPaint()50 virtual ~wxSVGPaint() {} Clone()51 wxCSSValue* Clone() const { return new wxSVGPaint(*this); } 52 53 wxString GetCSSText() const; GetUri()54 inline const wxString& GetUri() const { return m_uri; } 55 virtual void SetUri(const wxString& uri); 56 virtual void SetRGBColor(const wxRGBColor& rgbColor); 57 virtual void SetICCColor(const wxSVGICCColor& iccColor); 58 Ok()59 inline bool Ok() const 60 { 61 return m_paintType != wxSVG_PAINTTYPE_UNKNOWN && 62 m_paintType != wxSVG_PAINTTYPE_NONE; 63 } 64 65 virtual void SetPaint(wxSVG_PAINTTYPE paintType, const wxString& uri, const wxString& rgbColor, const wxString& iccColor); 66 }; 67 68 #endif // WX_SVG_PAINT_H 69