Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / html / XS / HtmlParser.xsp
1 #############################################################################
2 ## Name:        ext/html/XS/HtmlParser.xsp
3 ## Purpose:     XS++ for Wx::HtmlParser and Wx::HtmlWinParser
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     30/11/2003
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 #############################################################################
12
13 %module{Wx};
14
15 %{
16 #include <wx/dc.h>
17 #include <wx/html/winpars.h>
18 %}
19
20 %name{Wx::HtmlParser} class wxHtmlParser
21 {
22 ##    wxHtmlParser();
23 ##    ~wxHtmlParser();
24
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);
30     void DoneParser();
31     void StopParsing();
32
33 ##    void DoParsing(int begin_pos, int end_pos);
34 ##    void DoParsing();
35
36     wxHtmlTag *GetCurrentTag() const;
37
38     wxObject* GetProduct();
39
40     void AddTagHandler(wxHtmlTagHandler *handler);
41
42     void PushTagHandler(wxHtmlTagHandler *handler, wxString tags);
43     void PopTagHandler();
44
45 ##    wxString* GetSource();
46     void SetSource(const wxString& src);
47     
48     void SetSourceAndSaveState(const wxString& src);
49     bool RestoreState();
50 };
51
52 %name{Wx::HtmlWinParser} class wxHtmlWinParser
53 {
54 ##    wxHtmlWinParser(wxHtmlWindow *wnd = NULL);
55 ##    ~wxHtmlWinParser();
56
57     wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const;
58
59     void SetDC(wxDC *dc, double pixel_scale = 1.0);
60
61     wxDC *GetDC();
62     double GetPixelScale();
63     int GetCharHeight() const;
64     int GetCharWidth() const;
65
66 #if WXPERL_W_VERSION_LT( 2, 7, 0 )
67     wxHtmlWindow* GetWindow();
68 #else
69     wxWindow* GetWindow()
70         %code{% RETVAL = THIS->GetWindowInterface()->GetHTMLWindow(); %};
71 #endif
72
73 ##    void SetFonts(wxString normal_face, wxString fixed_face,
74 ##                  const int *sizes = NULL);
75
76 ##    static void AddModule(wxHtmlTagsModule *module);
77 ##    static void RemoveModule(wxHtmlTagsModule *module);
78
79     wxHtmlContainerCell *GetContainer() const;
80     wxHtmlContainerCell *OpenContainer();
81     wxHtmlContainerCell *SetContainer(wxHtmlContainerCell *c);
82     wxHtmlContainerCell *CloseContainer();
83
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);
96
97     int GetAlign() const;
98     void SetAlign(int a);
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);
105
106 #if !wxUSE_UNICODE
107     void SetInputEncoding(wxFontEncoding enc);
108     wxFontEncoding GetInputEncoding() const;
109     wxFontEncoding GetOutputEncoding() const;
110     wxEncodingConverter *GetEncodingConverter() const;
111 #endif
112
113     wxFont* CreateCurrentFont();
114 };