cleanup: indentation, line length, don't include unneeded headers
[wxWidgets.git] / include / wx / dcsvg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dcsvg.h
3 // Purpose: wxSVGFileDC
4 // Author: Chris Elliott
5 // Modified by:
6 // Created:
7 // Copyright: (c) Chris Elliott
8 // RCS-ID: $Id$
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DCSVG_H_
13 #define _WX_DCSVG_H_
14
15 #include "wx/string.h"
16 #include "wx/dc.h"
17
18 #define wxSVGVersion wxT("v0100")
19
20 #ifdef __BORLANDC__
21 #pragma warn -8008
22 #pragma warn -8066
23 #endif
24
25 class WXDLLIMPEXP_FWD_BASE wxFileOutputStream;
26
27 class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
28 {
29 public:
30 wxSVGFileDC (wxString f);
31 wxSVGFileDC (wxString f, int Width, int Height);
32 wxSVGFileDC (wxString f, int Width, int Height, float dpi);
33
34 virtual ~wxSVGFileDC();
35
36 virtual bool CanDrawBitmap() const { return true; }
37 virtual bool CanGetTextExtent() const { return true; }
38
39 virtual int GetDepth() const
40 {
41 wxFAIL_MSG(wxT("wxSVGFILEDC::GetDepth Call not implemented"));
42 return -1;
43 }
44
45 virtual void Clear()
46 {
47 wxFAIL_MSG(wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?"));
48 }
49
50 virtual void DestroyClippingRegion()
51 {
52 wxFAIL_MSG(wxT("wxSVGFILEDC::void Call not yet implemented"));
53 }
54
55 virtual wxCoord GetCharHeight() const;
56 virtual wxCoord GetCharWidth() const;
57
58 virtual void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
59 wxCoord WXUNUSED(w), wxCoord WXUNUSED(h))
60 {
61 wxFAIL_MSG(wxT("wxSVGFILEDC::SetClippingRegion not implemented"));
62 }
63
64 virtual void SetPalette(const wxPalette& WXUNUSED(palette))
65 {
66 wxFAIL_MSG(wxT("wxSVGFILEDC::SetPalette not implemented"));
67 }
68
69 virtual void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y),
70 wxCoord *WXUNUSED(w), wxCoord *WXUNUSED(h))
71 {
72 wxFAIL_MSG(wxT("wxSVGFILEDC::GetClippingBox not implemented"));
73 }
74
75 virtual void SetLogicalFunction(int WXUNUSED(function))
76 {
77 wxFAIL_MSG(wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented"));
78 }
79
80 virtual int GetLogicalFunction() const
81 {
82 wxFAIL_MSG(wxT("wxSVGFILEDC::GetLogicalFunction() not implemented"));
83 return -1;
84 }
85
86 virtual void SetBackground( const wxBrush &brush );
87 virtual void SetBackgroundMode( int mode );
88 virtual void SetBrush(const wxBrush& brush);
89 virtual void SetFont(const wxFont& font);
90 virtual void SetPen(const wxPen& pen);
91
92 virtual bool IsOk() const {return m_OK;}
93
94 virtual void SetMapMode( int mode );
95 virtual void SetUserScale( double x, double y );
96 virtual void SetLogicalScale( double x, double y );
97 virtual void SetLogicalOrigin( wxCoord x, wxCoord y );
98 virtual void SetDeviceOrigin( wxCoord x, wxCoord y );
99 virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
100
101 private:
102 virtual bool DoGetPixel(wxCoord, wxCoord, wxColour *) const
103 {
104 wxFAIL_MSG(wxT("wxSVGFILEDC::DoGetPixel Call not implemented"));
105 return true;
106 }
107
108 virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, wxDC *,
109 wxCoord, wxCoord, int = wxCOPY,
110 bool = 0, int = -1, int = -1);
111
112 virtual void DoCrossHair(wxCoord, wxCoord)
113 {
114 wxFAIL_MSG(wxT("wxSVGFILEDC::CrossHair Call not implemented"));
115 }
116
117 virtual void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord);
118
119 virtual void DoDrawBitmap(const wxBitmap &, wxCoord, wxCoord, bool = 0);
120
121 virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
122
123 virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
124
125 virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
126 double sa, double ea);
127
128 virtual void DoDrawIcon(const wxIcon &, wxCoord, wxCoord);
129
130 virtual void DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
131
132 virtual void DoDrawLines(int n, wxPoint points[],
133 wxCoord xoffset = 0, wxCoord yoffset = 0);
134
135 virtual void DoDrawPoint(wxCoord, wxCoord);
136
137 virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle);
138
139 virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
140
141 virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
142 double angle);
143
144 virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
145 wxCoord w, wxCoord h,
146 double radius = 20) ;
147
148 virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
149
150 virtual bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
151 const wxColour& WXUNUSED(col),
152 int WXUNUSED(style) = wxFLOOD_SURFACE)
153 {
154 wxFAIL_MSG(wxT("wxSVGFILEDC::DoFloodFill Call not implemented"));
155 return false;
156 }
157
158 virtual void DoGetSize(int * x, int *y) const
159 {
160 if ( x )
161 *x = m_width;
162 if ( y )
163 *y = m_height;
164 }
165
166 virtual void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h,
167 wxCoord *descent = NULL,
168 wxCoord *externalLeading = NULL,
169 const wxFont *font = NULL) const;
170
171 virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region))
172 {
173 wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented"));
174 }
175
176 void Init (wxString f, int Width, int Height, float dpi);
177
178 void NewGraphics();
179
180 void write( const wxString &s );
181
182 private:
183 wxFileOutputStream *m_outfile;
184 wxString m_filename;
185 int m_sub_images; // number of png format images we have
186 bool m_OK;
187 bool m_graphics_changed;
188 int m_width, m_height;
189
190 private:
191 DECLARE_ABSTRACT_CLASS(wxSVGFileDC)
192 };
193
194 #endif // _WX_DCSVG_H_