1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _html.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13enum 14{ 15 wxPAGE_ODD, 16 wxPAGE_EVEN, 17 wxPAGE_ALL 18}; 19 20class wxHtmlDCRenderer : wxObject 21{ 22 %Docstring 23 HtmlDCRenderer() 24 25 This class can render HTML document into a specified area of a DC. 26 %End 27 %TypeHeaderCode 28 #include <wx/html/htmprint.h> 29 %End 30 31public: 32 wxHtmlDCRenderer(); 33 %PreMethodCode 34 if (!wxPyCheckForApp()) return NULL; 35 %End 36 37 int GetTotalWidth() const; 38 %Docstring 39 GetTotalWidth() -> int 40 41 Returns the width of the HTML text in pixels. 42 %End 43 44 int GetTotalHeight() const; 45 %Docstring 46 GetTotalHeight() -> int 47 48 Returns the height of the HTML text in pixels. 49 %End 50 51 int Render( 52 int x, 53 int y, 54 wxArrayInt & known_pagebreaks, 55 int from_ = 0, 56 int dont_render = false, 57 int to_ = INT_MAX 58 ); 59 %Docstring 60 Render(x, y, known_pagebreaks, from_=0, dont_render=False, to_=INT_MAX) -> int 61 62 Renders HTML text to the DC. 63 %End 64 65 void SetDC( 66 wxDC * dc, 67 double pixel_scale = 1.0 68 ); 69 %Docstring 70 SetDC(dc, pixel_scale=1.0) 71 72 Assign DC instance to the renderer. 73 %End 74 75 void SetFonts( 76 const wxString & normal_face, 77 const wxString & fixed_face, 78 const wxArrayInt& sizes 79 ); 80 %Docstring 81 SetFonts(normal_face, fixed_face, sizes) 82 83 This function sets font sizes and faces. 84 %End 85 %MethodCode 86 PyErr_Clear(); 87 Py_BEGIN_ALLOW_THREADS 88 _wxHtmlDCRenderer_SetFonts(sipCpp, normal_face, fixed_face, sizes); 89 Py_END_ALLOW_THREADS 90 if (PyErr_Occurred()) sipIsErr = 1; 91 %End 92 %TypeCode 93 void _wxHtmlDCRenderer_SetFonts(wxHtmlDCRenderer* self, const wxString * normal_face, const wxString * fixed_face, const wxArrayInt* sizes) 94 { 95 if (sizes->GetCount() != 7) { 96 wxPyErr_SetString(PyExc_ValueError, "Sequence of 7 integers expected."); 97 return; 98 } 99 self->SetFonts(*normal_face, *fixed_face, &sizes->Item(0)); 100 } 101 %End 102 103 void SetStandardFonts( 104 int size = -1, 105 const wxString & normal_face = wxEmptyString, 106 const wxString & fixed_face = wxEmptyString 107 ); 108 %Docstring 109 SetStandardFonts(size=-1, normal_face=wx.EmptyString, fixed_face=wx.EmptyString) 110 111 Sets font sizes to be relative to the given size or the system default 112 size; use either specified or default font. 113 %End 114 115 void SetHtmlText( 116 const wxString & html, 117 const wxString & basepath = wxEmptyString, 118 bool isdir = true 119 ); 120 %Docstring 121 SetHtmlText(html, basepath=wx.EmptyString, isdir=True) 122 123 Assign text to the renderer. 124 %End 125 126 void SetSize( 127 int width, 128 int height 129 ); 130 %Docstring 131 SetSize(width, height) 132 133 Set size of output rectangle, in pixels. 134 %End 135 136 private: 137 wxHtmlDCRenderer(const wxHtmlDCRenderer&); 138 139 140 public: 141 142 143 %Property(name=TotalHeight, get=GetTotalHeight) 144 %Property(name=TotalWidth, get=GetTotalWidth) 145}; // end of class wxHtmlDCRenderer 146 147 148class wxHtmlEasyPrinting : wxObject 149{ 150 %Docstring 151 HtmlEasyPrinting(name="Printing", parentWindow=None) 152 153 This class provides very simple interface to printing architecture. 154 %End 155 %TypeHeaderCode 156 #include <wx/html/htmprint.h> 157 %End 158 159public: 160 wxHtmlEasyPrinting( 161 const wxString & name = "Printing", 162 wxWindow * parentWindow = NULL 163 ); 164 %PreMethodCode 165 if (!wxPyCheckForApp()) return NULL; 166 %End 167 168 const wxString & GetName() const; 169 %Docstring 170 GetName() -> String 171 172 Returns the current name being used for preview frames and setup 173 dialogs. 174 %End 175 176 wxPageSetupDialogData * GetPageSetupData(); 177 %Docstring 178 GetPageSetupData() -> wx.PageSetupDialogData 179 180 Returns a pointer to wxPageSetupDialogData instance used by this 181 class. 182 %End 183 184 wxWindow * GetParentWindow() const; 185 %Docstring 186 GetParentWindow() -> wx.Window 187 188 Gets the parent window for dialogs. 189 %End 190 191 wxPrintData * GetPrintData(); 192 %Docstring 193 GetPrintData() -> wx.PrintData 194 195 Returns pointer to wxPrintData instance used by this class. 196 %End 197 198 void PageSetup(); 199 %Docstring 200 PageSetup() 201 202 Display page setup dialog and allows the user to modify settings. 203 %End 204 205 bool PreviewFile( 206 const wxString & htmlfile 207 ); 208 %Docstring 209 PreviewFile(htmlfile) -> bool 210 211 Preview HTML file. 212 %End 213 214 bool PreviewText( 215 const wxString & htmltext, 216 const wxString & basepath = wxEmptyString 217 ); 218 %Docstring 219 PreviewText(htmltext, basepath=wx.EmptyString) -> bool 220 221 Preview HTML text (not file!). 222 %End 223 224 bool PrintFile( 225 const wxString & htmlfile 226 ); 227 %Docstring 228 PrintFile(htmlfile) -> bool 229 230 Print HTML file. 231 %End 232 233 bool PrintText( 234 const wxString & htmltext, 235 const wxString & basepath = wxEmptyString 236 ); 237 %Docstring 238 PrintText(htmltext, basepath=wx.EmptyString) -> bool 239 240 Print HTML text (not file!). 241 %End 242 243 void SetFonts( 244 const wxString & normal_face, 245 const wxString & fixed_face, 246 const wxArrayInt& sizes 247 ); 248 %Docstring 249 SetFonts(normal_face, fixed_face, sizes) 250 251 Sets fonts. 252 %End 253 %MethodCode 254 PyErr_Clear(); 255 Py_BEGIN_ALLOW_THREADS 256 _wxHtmlEasyPrinting_SetFonts(sipCpp, normal_face, fixed_face, sizes); 257 Py_END_ALLOW_THREADS 258 if (PyErr_Occurred()) sipIsErr = 1; 259 %End 260 %TypeCode 261 void _wxHtmlEasyPrinting_SetFonts(wxHtmlEasyPrinting* self, const wxString * normal_face, const wxString * fixed_face, const wxArrayInt* sizes) 262 { 263 if (sizes->GetCount() != 7) { 264 wxPyErr_SetString(PyExc_ValueError, "Sequence of 7 integers expected."); 265 return; 266 } 267 self->SetFonts(*normal_face, *fixed_face, &sizes->Item(0)); 268 } 269 %End 270 271 void SetName( 272 const wxString & name 273 ); 274 %Docstring 275 SetName(name) 276 277 Sets the name used for preview frames and setup dialogs. 278 %End 279 280 void SetStandardFonts( 281 int size = -1, 282 const wxString & normal_face = wxEmptyString, 283 const wxString & fixed_face = wxEmptyString 284 ); 285 %Docstring 286 SetStandardFonts(size=-1, normal_face=wx.EmptyString, fixed_face=wx.EmptyString) 287 288 Sets default font sizes and/or default font size. 289 %End 290 291 void SetFooter( 292 const wxString & footer, 293 int pg = wxPAGE_ALL 294 ); 295 %Docstring 296 SetFooter(footer, pg=PAGE_ALL) 297 298 Set page footer. 299 %End 300 301 void SetHeader( 302 const wxString & header, 303 int pg = wxPAGE_ALL 304 ); 305 %Docstring 306 SetHeader(header, pg=PAGE_ALL) 307 308 Set page header. 309 %End 310 311 void SetParentWindow( 312 wxWindow * window 313 ); 314 %Docstring 315 SetParentWindow(window) 316 317 Sets the parent window for dialogs. 318 %End 319 320 private: 321 wxHtmlEasyPrinting(const wxHtmlEasyPrinting&); 322 323 324 public: 325 326 327 %Property(name=Name, get=GetName, set=SetName) 328 %Property(name=PageSetupData, get=GetPageSetupData) 329 %Property(name=ParentWindow, get=GetParentWindow, set=SetParentWindow) 330 %Property(name=PrintData, get=GetPrintData) 331}; // end of class wxHtmlEasyPrinting 332 333 334class wxHtmlPrintout : wxPrintout 335{ 336 %Docstring 337 HtmlPrintout(title="Printout") 338 339 This class serves as printout class for HTML documents. 340 %End 341 %TypeHeaderCode 342 #include <wx/html/htmprint.h> 343 %End 344 345public: 346 wxHtmlPrintout( 347 const wxString & title = "Printout" 348 ); 349 %PreMethodCode 350 if (!wxPyCheckForApp()) return NULL; 351 %End 352 353 void SetFonts( 354 const wxString & normal_face, 355 const wxString & fixed_face, 356 const wxArrayInt& sizes 357 ); 358 %Docstring 359 SetFonts(normal_face, fixed_face, sizes) 360 361 This function sets font sizes and faces. 362 %End 363 %MethodCode 364 PyErr_Clear(); 365 Py_BEGIN_ALLOW_THREADS 366 _wxHtmlPrintout_SetFonts(sipCpp, normal_face, fixed_face, sizes); 367 Py_END_ALLOW_THREADS 368 if (PyErr_Occurred()) sipIsErr = 1; 369 %End 370 %TypeCode 371 void _wxHtmlPrintout_SetFonts(wxHtmlPrintout* self, const wxString * normal_face, const wxString * fixed_face, const wxArrayInt* sizes) 372 { 373 if (sizes->GetCount() != 7) { 374 wxPyErr_SetString(PyExc_ValueError, "Sequence of 7 integers expected."); 375 return; 376 } 377 self->SetFonts(*normal_face, *fixed_face, &sizes->Item(0)); 378 } 379 %End 380 381 void SetFooter( 382 const wxString & footer, 383 int pg = wxPAGE_ALL 384 ); 385 %Docstring 386 SetFooter(footer, pg=PAGE_ALL) 387 388 Set page footer. 389 %End 390 391 void SetHeader( 392 const wxString & header, 393 int pg = wxPAGE_ALL 394 ); 395 %Docstring 396 SetHeader(header, pg=PAGE_ALL) 397 398 Set page header. 399 %End 400 401 void SetHtmlFile( 402 const wxString & htmlfile 403 ); 404 %Docstring 405 SetHtmlFile(htmlfile) 406 407 Prepare the class for printing this HTML file. 408 %End 409 410 void SetHtmlText( 411 const wxString & html, 412 const wxString & basepath = wxEmptyString, 413 bool isdir = true 414 ); 415 %Docstring 416 SetHtmlText(html, basepath=wx.EmptyString, isdir=True) 417 418 Prepare the class for printing this HTML text. 419 %End 420 421 void SetMargins( 422 float top = 25.2, 423 float bottom = 25.2, 424 float left = 25.2, 425 float right = 25.2, 426 float spaces = 5 427 ); 428 %Docstring 429 SetMargins(top=25.2, bottom=25.2, left=25.2, right=25.2, spaces=5) 430 431 Sets margins in millimeters. 432 %End 433 434 static 435 void AddFilter( 436 wxHtmlFilter * filter 437 ); 438 %Docstring 439 AddFilter(filter) 440 441 Adds a filter to the static list of filters for wxHtmlPrintout. 442 %End 443 444 private: 445 wxHtmlPrintout(const wxHtmlPrintout&); 446 447 448 bool OnPrintPage(int page); 449 bool HasPage(int page); 450 void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); 451 bool OnBeginDocument(int startPage, int endPage); 452 void OnPreparePrinting(); 453 454 455 public: 456 457 458}; // end of class wxHtmlPrintout 459 460 461 462//--------------------------------------------------------------------------- 463 464