1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of html classes
7 // Created: 25-Nov-1998
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/html/htmlwin.h>
19 #include <wx/html/helpctrl.h>
21 #include <wx/fs_zip.h>
22 #include <wx/fs_inet.h>
23 #include <wx/wfstream.h>
26 //---------------------------------------------------------------------------
29 %include my_typemaps.i
42 // #ifdef wxUSE_UNICODE
43 // %typemap(python, memberin) wxChar* {
44 // if ($target) delete [] $target;
45 // wxString *tempStr = new wxString($source);
46 // $target = new wxChar[tempStr->Len()+1];
47 // memcpy($target, tempStr->c_str(), (sizeof(wxChar)*tempStr->Len())+sizeof(wxChar));
52 //---------------------------------------------------------------------------
54 class wxHtmlBookRecord : public wxObject {
56 wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
57 const wxString& title, const wxString& start);
59 wxString GetBookFile();
62 wxString GetBasePath();
64 void SetContentsRange(int start, int end);
65 int GetContentsStart();
68 void SetTitle(const wxString& title);
69 void SetBasePath(const wxString& path);
70 void SetStart(const wxString& start);
72 wxString GetFullPath(const wxString &page) const;
75 //---------------------------------------------------------------------------
77 struct wxHtmlContentsItem
84 wxHtmlBookRecord *m_Book;
88 //---------------------------------------------------------------------------
90 class wxHtmlSearchStatus
93 //wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword,
94 // const wxString& book = wxEmptyString);
99 const wxString& GetName();
100 wxHtmlContentsItem* GetContentsItem();
103 //---------------------------------------------------------------------------
105 class wxHtmlHelpData {
110 void SetTempDir(const wxString& path);
111 bool AddBook(const wxString& book);
112 // bool AddBookParam(const wxString& title, const wxString& contfile,
113 // const wxString& indexfile=wxEmptyString,
114 // const wxString& deftopic=wxEmptyString,
115 // const wxString& path=wxEmptyString);
117 wxString FindPageByName(const wxString& page);
118 wxString FindPageById(int id);
120 // TODO: this one needs fixed...
121 const wxHtmlBookRecArray& GetBookRecArray();
123 wxHtmlContentsItem* GetContents();
124 int GetContentsCnt();
125 wxHtmlContentsItem* GetIndex();
129 //---------------------------------------------------------------------------
131 class wxHtmlHelpFrame : public wxFrame {
133 wxHtmlHelpFrame(wxWindow* parent, int wxWindowID,
134 const wxString& title = wxEmptyString,
135 int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL);
137 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
139 wxHtmlHelpData* GetData();
140 void SetTitleFormat(const wxString& format);
141 void Display(const wxString& x);
142 %name(DisplayID) void Display(int id);
143 void DisplayContents();
145 bool KeywordSearch(const wxString& keyword);
146 void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
147 void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString);
148 void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString);
152 //---------------------------------------------------------------------------
168 class wxHtmlHelpController : public wxEvtHandler {
170 wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE);
171 ~wxHtmlHelpController();
173 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
175 void SetTitleFormat(const wxString& format);
176 void SetTempDir(const wxString& path);
177 bool AddBook(const wxString& book, int show_wait_msg = FALSE);
178 void Display(const wxString& x);
179 %name(DisplayID) void Display(int id);
180 void DisplayContents();
182 bool KeywordSearch(const wxString& keyword);
183 void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);
184 void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString);
185 void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString);
186 wxHtmlHelpFrame* GetFrame();
189 //---------------------------------------------------------------------------
190 //---------------------------------------------------------------------------