]>
Commit | Line | Data |
---|---|---|
0f66a9f3 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: htmlhelp.i | |
3 | // Purpose: SWIG definitions of html classes | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
2c8a649d | 7 | // Created: 25-Nov-1998 |
0f66a9f3 RD |
8 | // RCS-ID: $Id$ |
9 | // Copyright: (c) 1998 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | ||
14 | %module htmlhelp | |
15 | ||
16 | %{ | |
1e7ecb7b | 17 | #include "export.h" |
0f66a9f3 | 18 | #include <wx/html/htmlwin.h> |
2f90df85 | 19 | #include <wx/html/helpctrl.h> |
0f66a9f3 RD |
20 | #include <wx/image.h> |
21 | #include <wx/fs_zip.h> | |
22 | #include <wx/fs_inet.h> | |
23 | #include <wx/wfstream.h> | |
0f66a9f3 RD |
24 | %} |
25 | ||
26 | //--------------------------------------------------------------------------- | |
27 | ||
28 | %include typemaps.i | |
29 | %include my_typemaps.i | |
30 | ||
31 | %extern wx.i | |
32 | %extern windows.i | |
2f90df85 | 33 | %extern frames.i |
0f66a9f3 RD |
34 | %extern _defs.i |
35 | %extern events.i | |
36 | %extern controls.i | |
37 | %extern controls2.i | |
38 | ||
39 | %extern utils.i | |
0f66a9f3 RD |
40 | %extern html.i |
41 | ||
c8bc7bb8 RD |
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)); | |
48 | // delete tempStr; | |
49 | // } | |
50 | // #endif | |
1b62f00d | 51 | |
2f90df85 RD |
52 | //--------------------------------------------------------------------------- |
53 | ||
ff42dd66 | 54 | class wxHtmlBookRecord : public wxObject { |
2f90df85 | 55 | public: |
ff42dd66 RD |
56 | wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, |
57 | const wxString& title, const wxString& start); | |
2f90df85 | 58 | |
ff42dd66 | 59 | wxString GetBookFile(); |
2f90df85 RD |
60 | wxString GetTitle(); |
61 | wxString GetStart(); | |
62 | wxString GetBasePath(); | |
63 | ||
64 | void SetContentsRange(int start, int end); | |
65 | int GetContentsStart(); | |
66 | int GetContentsEnd(); | |
ff42dd66 RD |
67 | |
68 | void SetTitle(const wxString& title); | |
69 | void SetBasePath(const wxString& path); | |
70 | void SetStart(const wxString& start); | |
71 | ||
72 | wxString GetFullPath(const wxString &page) const; | |
2f90df85 RD |
73 | }; |
74 | ||
75 | //--------------------------------------------------------------------------- | |
76 | ||
ff42dd66 | 77 | struct wxHtmlContentsItem |
2f90df85 | 78 | { |
c8bc7bb8 | 79 | %readonly |
2f90df85 RD |
80 | short int m_Level; |
81 | int m_ID; | |
c8bc7bb8 RD |
82 | wxChar* m_Name; |
83 | wxChar* m_Page; | |
2f90df85 | 84 | wxHtmlBookRecord *m_Book; |
c8bc7bb8 | 85 | %readwrite |
ff42dd66 | 86 | }; |
2f90df85 RD |
87 | |
88 | //--------------------------------------------------------------------------- | |
89 | ||
90 | class wxHtmlSearchStatus | |
91 | { | |
92 | public: | |
93 | //wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword, | |
94 | // const wxString& book = wxEmptyString); | |
95 | bool Search(); | |
96 | bool IsActive(); | |
97 | int GetCurIndex(); | |
98 | int GetMaxIndex(); | |
99 | const wxString& GetName(); | |
100 | wxHtmlContentsItem* GetContentsItem(); | |
101 | }; | |
0f66a9f3 | 102 | |
2f90df85 | 103 | //--------------------------------------------------------------------------- |
0f66a9f3 | 104 | |
2f90df85 RD |
105 | class wxHtmlHelpData { |
106 | public: | |
107 | wxHtmlHelpData(); | |
108 | ~wxHtmlHelpData(); | |
0f66a9f3 RD |
109 | |
110 | void SetTempDir(const wxString& path); | |
2f90df85 | 111 | bool AddBook(const wxString& book); |
eec92d76 RD |
112 | // bool AddBookParam(const wxString& title, const wxString& contfile, |
113 | // const wxString& indexfile=wxEmptyString, | |
114 | // const wxString& deftopic=wxEmptyString, | |
115 | // const wxString& path=wxEmptyString); | |
0f66a9f3 | 116 | |
2f90df85 RD |
117 | wxString FindPageByName(const wxString& page); |
118 | wxString FindPageById(int id); | |
0f66a9f3 | 119 | |
13806c7d | 120 | // TODO: this one needs fixed... |
2f90df85 | 121 | const wxHtmlBookRecArray& GetBookRecArray(); |
0f66a9f3 | 122 | |
2f90df85 RD |
123 | wxHtmlContentsItem* GetContents(); |
124 | int GetContentsCnt(); | |
125 | wxHtmlContentsItem* GetIndex(); | |
126 | int GetIndexCnt(); | |
127 | }; | |
0f66a9f3 | 128 | |
2f90df85 | 129 | //--------------------------------------------------------------------------- |
0f66a9f3 | 130 | |
2f90df85 RD |
131 | class wxHtmlHelpFrame : public wxFrame { |
132 | public: | |
133 | wxHtmlHelpFrame(wxWindow* parent, int wxWindowID, | |
134 | const wxString& title = wxEmptyString, | |
135 | int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL); | |
0f66a9f3 | 136 | |
0122b7e3 RD |
137 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
138 | ||
2f90df85 RD |
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(); | |
144 | void DisplayIndex(); | |
145 | bool KeywordSearch(const wxString& keyword); | |
0f66a9f3 | 146 | void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); |
2f90df85 RD |
147 | void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); |
148 | void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); | |
149 | }; | |
0f66a9f3 | 150 | |
2f90df85 RD |
151 | |
152 | //--------------------------------------------------------------------------- | |
153 | ||
13806c7d RD |
154 | |
155 | enum { | |
156 | wxHF_TOOLBAR, | |
157 | wxHF_FLATTOOLBAR, | |
158 | wxHF_CONTENTS, | |
159 | wxHF_INDEX, | |
160 | wxHF_SEARCH, | |
161 | wxHF_BOOKMARKS, | |
162 | wxHF_OPENFILES, | |
163 | wxHF_PRINT, | |
164 | wxHF_DEFAULTSTYLE, | |
165 | }; | |
166 | ||
167 | ||
2f90df85 RD |
168 | class wxHtmlHelpController : public wxEvtHandler { |
169 | public: | |
13806c7d | 170 | wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE); |
2f90df85 RD |
171 | ~wxHtmlHelpController(); |
172 | ||
0122b7e3 RD |
173 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
174 | ||
2f90df85 RD |
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(); | |
181 | void DisplayIndex(); | |
182 | bool KeywordSearch(const wxString& keyword); | |
183 | void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); | |
0f66a9f3 | 184 | void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); |
0f66a9f3 | 185 | void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); |
2f90df85 | 186 | wxHtmlHelpFrame* GetFrame(); |
0f66a9f3 RD |
187 | }; |
188 | ||
2f90df85 | 189 | //--------------------------------------------------------------------------- |
0f66a9f3 | 190 | //--------------------------------------------------------------------------- |