1 #############################################################################
2 ## Name: ext/html/XS/HtmlParser.xsp
3 ## Purpose: XS++ for Wx::HtmlParser and Wx::HtmlWinParser
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: HtmlParser.xsp 2079 2007-07-08 21:18:04Z mbarbon $
8 ## Copyright: (c) 2003, 2006 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
17 #include <wx/html/winpars.h>
20 %name{Wx::HtmlParser} class wxHtmlParser
25 void SetFS(wxFileSystem *fs);
26 wxFileSystem* GetFS() const;
27 wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const;
28 wxObject* Parse(const wxString& source);
29 void InitParser(const wxString& source);
33 ## void DoParsing(int begin_pos, int end_pos);
36 wxHtmlTag *GetCurrentTag() const;
38 wxObject* GetProduct();
40 void AddTagHandler(wxHtmlTagHandler *handler);
42 void PushTagHandler(wxHtmlTagHandler *handler, wxString tags);
45 ## wxString* GetSource();
46 void SetSource(const wxString& src);
48 void SetSourceAndSaveState(const wxString& src);
52 %name{Wx::HtmlWinParser} class wxHtmlWinParser
54 ## wxHtmlWinParser(wxHtmlWindow *wnd = NULL);
55 ## ~wxHtmlWinParser();
57 wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const;
59 void SetDC(wxDC *dc, double pixel_scale = 1.0);
62 double GetPixelScale();
63 int GetCharHeight() const;
64 int GetCharWidth() const;
66 #if WXPERL_W_VERSION_LT( 2, 7, 0 )
67 wxHtmlWindow* GetWindow();
70 %code{% RETVAL = THIS->GetWindowInterface()->GetHTMLWindow(); %};
73 ## void SetFonts(wxString normal_face, wxString fixed_face,
74 ## const int *sizes = NULL);
76 ## static void AddModule(wxHtmlTagsModule *module);
77 ## static void RemoveModule(wxHtmlTagsModule *module);
79 wxHtmlContainerCell *GetContainer() const;
80 wxHtmlContainerCell *OpenContainer();
81 wxHtmlContainerCell *SetContainer(wxHtmlContainerCell *c);
82 wxHtmlContainerCell *CloseContainer();
84 int GetFontSize() const;
85 void SetFontSize(int s);
86 int GetFontBold() const;
87 void SetFontBold(int x);
88 int GetFontItalic() const;
89 void SetFontItalic(int x);
90 int GetFontUnderlined() const;
91 void SetFontUnderlined(int x);
92 int GetFontFixed() const;
93 void SetFontFixed(int x);
94 wxString GetFontFace() const;
95 void SetFontFace(const wxString& face);
99 const wxColour& GetLinkColor() const;
100 void SetLinkColor(const wxColour& clr);
101 const wxColour& GetActualColor() const;
102 void SetActualColor(const wxColour& clr);
103 const wxHtmlLinkInfo& GetLink() const;
104 void SetLink(const wxHtmlLinkInfo& link);
107 void SetInputEncoding(wxFontEncoding enc);
108 wxFontEncoding GetInputEncoding() const;
109 wxFontEncoding GetOutputEncoding() const;
110 wxEncodingConverter *GetEncodingConverter() const;
113 wxFont* CreateCurrentFont();