]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/webkit.i
de96d9fb4291f5ecfe625bad7626f3b1002de323
[wxWidgets.git] / wxPython / src / webkit.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: webkit.i
3 // Purpose: Embedding Apple's WebKit in wxWidgets
4 //
5 // Author: Robin Dunn / Kevin Ollivier
6 //
7 // Created: 18-Oct-2004
8 // RCS-ID: $Id$
9 // Copyright: (c) 2004 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 %module webkit
14
15 %{
16
17 #include "wx/wxPython/wxPython.h"
18 #include "wx/wxPython/pyclasses.h"
19 #include "wx/wxPython/pyistream.h"
20
21 #ifdef __WXMAC__ // avoid a bug in Carbon headers
22 #define scalb scalbn
23 #endif
24
25 #if wxUSE_WEBKIT
26 #include "wx/html/webkit.h"
27 #endif
28 %}
29
30 //---------------------------------------------------------------------------
31
32 %import core.i
33 %pythoncode { wx = _core }
34 %pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
35
36
37 %include _webkit_rename.i
38
39 //---------------------------------------------------------------------------
40
41 // Put some wx default wxChar* values into wxStrings.
42 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
43 MAKE_CONST_WXSTRING2(WebKitNameStr, wxT("webkitctrl"))
44
45
46
47
48 %{
49 #if !wxUSE_WEBKIT
50 // a dummy class for ports that don't have wxWebKitCtrl
51 class wxWebKitCtrl : public wxControl
52 {
53 public:
54 wxWebKitCtrl(wxWindow *parent,
55 wxWindowID winID,
56 const wxString& strURL,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize, long style = 0,
59 const wxValidator& validator = wxDefaultValidator,
60 const wxString& name = wxPyWebKitNameStr)
61 { wxPyRaiseNotImplemented(); }
62
63 wxWebKitCtrl() { wxPyRaiseNotImplemented(); }
64
65 bool Create(wxWindow *parent,
66 wxWindowID winID,
67 const wxString& strURL,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize, long style = 0,
70 const wxValidator& validator = wxDefaultValidator,
71 const wxString& name = wxPyWebKitNameStr)
72 { return false; }
73
74 void LoadURL(const wxString &url) {}
75
76 bool CanGoBack() { return false; }
77 bool CanGoForward() { return false; }
78 bool GoBack() { return false; }
79 bool GoForward() { return false; }
80 void Reload() {}
81 void Stop() {}
82 bool CanGetPageSource() { return false; }
83 wxString GetPageSource() { return wxEmptyString; }
84 void SetPageSource(wxString& source, const wxString& baseUrl = wxEmptyString) {}
85 };
86 #endif
87 %}
88
89 // Now define it for SWIG.
90 class wxWebKitCtrl : public wxControl
91 {
92 public:
93 wxWebKitCtrl(wxWindow *parent,
94 wxWindowID winID,
95 const wxString& strURL,
96 const wxPoint& pos = wxDefaultPosition,
97 const wxSize& size = wxDefaultSize, long style = 0,
98 const wxValidator& validator = wxDefaultValidator,
99 const wxString& name = wxPyWebKitNameStr);
100
101 %name(PreWebKitCtrl)wxWebKitCtrl();
102
103
104 bool Create(wxWindow *parent,
105 wxWindowID winID,
106 const wxString& strURL,
107 const wxPoint& pos = wxDefaultPosition,
108 const wxSize& size = wxDefaultSize, long style = 0,
109 const wxValidator& validator = wxDefaultValidator,
110 const wxString& name = wxPyWebKitNameStr);
111
112 void LoadURL(const wxString &url);
113
114 bool CanGoBack();
115 bool CanGoForward();
116 bool GoBack();
117 bool GoForward();
118 void Reload();
119 void Stop();
120 bool CanGetPageSource();
121 wxString GetPageSource();
122 void SetPageSource(wxString& source, const wxString& baseUrl = wxPyEmptyString);
123 };
124
125
126 %init %{
127
128 %}