1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRichTextHTMLHandler
7 // Created: 18-May-2007
9 // Copyright: (c) 2007 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 #include <wx/richtext/richtexthtml.h>
22 //---------------------------------------------------------------------------
25 MAKE_CONST_WXSTRING2(HtmlName, wxT("HTML"));
26 MAKE_CONST_WXSTRING2(HtmlExt, wxT("html"));
28 class wxRichTextHTMLHandler: public wxRichTextFileHandler
31 wxRichTextHTMLHandler(const wxString& name = wxPyHtmlName,
32 const wxString& ext = wxPyHtmlExt,
33 int type = wxRICHTEXT_TYPE_HTML);
36 virtual bool , CanSave() const,
37 "Can we save using this handler?", "");
39 virtual bool , CanLoad() const,
40 "Can we load using this handler?", "");
42 virtual bool , CanHandle(const wxString& filename) const,
43 "Can we handle this filename (if using files)? By default, checks the
48 void , SetTemporaryImageLocations(const wxArrayString& locations),
49 "Set the list of image locations generated by the last operation", "");
51 const wxArrayString& , GetTemporaryImageLocations() const,
52 "Get the list of image locations generated by the last operation", "");
53 %property(TemporaryImageLocations, GetTemporaryImageLocations, SetTemporaryImageLocations);
58 void , ClearTemporaryImageLocations(),
59 "Clear the image locations generated by the last operation", "");
61 bool , DeleteTemporaryImages(),
62 "Delete the in-memory or temporary files generated by the last operation", "");
66 // static bool , DeleteTemporaryImages(int flags, const wxArrayString& imageLocations),
67 // "Delete the in-memory or temporary files generated by the last operation. This
68 // is a static function that can be used to delete the saved locations from an
69 // earlier operation, for example after the user has viewed the HTML file.", "");
73 static void , SetFileCounter(int counter),
74 "Reset the file counter, in case, for example, the same names are required each
79 void , SetTempDir(const wxString& tempDir),
80 "Set the directory for storing temporary files. If empty, the system temporary
81 directory will be used.", "");
83 const wxString& , GetTempDir() const,
84 "Get the directory for storing temporary files. If empty, the system temporary
85 directory will be used.", "");
86 %property(TempDir, GetTempDir, SetTempDir);
90 void , SetFontSizeMapping(const wxArrayInt& fontSizeMapping),
91 "Set mapping from point size to HTML font size. There should be 7 elements, one
92 for each HTML font size, each element specifying the maximum point size for
93 that HTML font size. E.g. 8, 10, 13, 17, 22, 29, 100
96 wxArrayInt , GetFontSizeMapping() const,
97 "Get mapping deom point size to HTML font size.", "");
98 %property(FontSizeMapping, GetFontSizeMapping, SetFontSizeMapping);
102 //---------------------------------------------------------------------------