]>
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 | ||
1b62f00d | 42 | |
2f90df85 RD |
43 | //--------------------------------------------------------------------------- |
44 | ||
45 | class wxHtmlBookRecord { | |
46 | public: | |
47 | wxHtmlBookRecord(const wxString& basepath, const wxString& title, | |
48 | const wxString& start); | |
49 | ||
50 | wxString GetTitle(); | |
51 | wxString GetStart(); | |
52 | wxString GetBasePath(); | |
53 | ||
54 | void SetContentsRange(int start, int end); | |
55 | int GetContentsStart(); | |
56 | int GetContentsEnd(); | |
57 | }; | |
58 | ||
59 | //--------------------------------------------------------------------------- | |
60 | ||
61 | typedef struct | |
62 | { | |
63 | short int m_Level; | |
64 | int m_ID; | |
65 | char* m_Name; | |
66 | char* m_Page; | |
67 | wxHtmlBookRecord *m_Book; | |
68 | } wxHtmlContentsItem; | |
69 | ||
70 | //--------------------------------------------------------------------------- | |
71 | ||
72 | class wxHtmlSearchStatus | |
73 | { | |
74 | public: | |
75 | //wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword, | |
76 | // const wxString& book = wxEmptyString); | |
77 | bool Search(); | |
78 | bool IsActive(); | |
79 | int GetCurIndex(); | |
80 | int GetMaxIndex(); | |
81 | const wxString& GetName(); | |
82 | wxHtmlContentsItem* GetContentsItem(); | |
83 | }; | |
0f66a9f3 | 84 | |
2f90df85 | 85 | //--------------------------------------------------------------------------- |
0f66a9f3 | 86 | |
2f90df85 RD |
87 | class wxHtmlHelpData { |
88 | public: | |
89 | wxHtmlHelpData(); | |
90 | ~wxHtmlHelpData(); | |
0f66a9f3 RD |
91 | |
92 | void SetTempDir(const wxString& path); | |
2f90df85 | 93 | bool AddBook(const wxString& book); |
eec92d76 RD |
94 | // bool AddBookParam(const wxString& title, const wxString& contfile, |
95 | // const wxString& indexfile=wxEmptyString, | |
96 | // const wxString& deftopic=wxEmptyString, | |
97 | // const wxString& path=wxEmptyString); | |
0f66a9f3 | 98 | |
2f90df85 RD |
99 | wxString FindPageByName(const wxString& page); |
100 | wxString FindPageById(int id); | |
0f66a9f3 | 101 | |
13806c7d | 102 | // TODO: this one needs fixed... |
2f90df85 | 103 | const wxHtmlBookRecArray& GetBookRecArray(); |
0f66a9f3 | 104 | |
2f90df85 RD |
105 | wxHtmlContentsItem* GetContents(); |
106 | int GetContentsCnt(); | |
107 | wxHtmlContentsItem* GetIndex(); | |
108 | int GetIndexCnt(); | |
109 | }; | |
0f66a9f3 | 110 | |
2f90df85 | 111 | //--------------------------------------------------------------------------- |
0f66a9f3 | 112 | |
2f90df85 RD |
113 | class wxHtmlHelpFrame : public wxFrame { |
114 | public: | |
115 | wxHtmlHelpFrame(wxWindow* parent, int wxWindowID, | |
116 | const wxString& title = wxEmptyString, | |
117 | int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL); | |
0f66a9f3 | 118 | |
0122b7e3 RD |
119 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
120 | ||
2f90df85 RD |
121 | wxHtmlHelpData* GetData(); |
122 | void SetTitleFormat(const wxString& format); | |
123 | void Display(const wxString& x); | |
124 | %name(DisplayID) void Display(int id); | |
125 | void DisplayContents(); | |
126 | void DisplayIndex(); | |
127 | bool KeywordSearch(const wxString& keyword); | |
0f66a9f3 | 128 | void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); |
2f90df85 RD |
129 | void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); |
130 | void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); | |
131 | }; | |
0f66a9f3 | 132 | |
2f90df85 RD |
133 | |
134 | //--------------------------------------------------------------------------- | |
135 | ||
13806c7d RD |
136 | |
137 | enum { | |
138 | wxHF_TOOLBAR, | |
139 | wxHF_FLATTOOLBAR, | |
140 | wxHF_CONTENTS, | |
141 | wxHF_INDEX, | |
142 | wxHF_SEARCH, | |
143 | wxHF_BOOKMARKS, | |
144 | wxHF_OPENFILES, | |
145 | wxHF_PRINT, | |
146 | wxHF_DEFAULTSTYLE, | |
147 | }; | |
148 | ||
149 | ||
2f90df85 RD |
150 | class wxHtmlHelpController : public wxEvtHandler { |
151 | public: | |
13806c7d | 152 | wxHtmlHelpController(int style = wxHF_DEFAULTSTYLE); |
2f90df85 RD |
153 | ~wxHtmlHelpController(); |
154 | ||
0122b7e3 RD |
155 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
156 | ||
2f90df85 RD |
157 | void SetTitleFormat(const wxString& format); |
158 | void SetTempDir(const wxString& path); | |
159 | bool AddBook(const wxString& book, int show_wait_msg = FALSE); | |
160 | void Display(const wxString& x); | |
161 | %name(DisplayID) void Display(int id); | |
162 | void DisplayContents(); | |
163 | void DisplayIndex(); | |
164 | bool KeywordSearch(const wxString& keyword); | |
165 | void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); | |
0f66a9f3 | 166 | void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); |
0f66a9f3 | 167 | void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); |
2f90df85 | 168 | wxHtmlHelpFrame* GetFrame(); |
0f66a9f3 RD |
169 | }; |
170 | ||
2f90df85 | 171 | //--------------------------------------------------------------------------- |
0f66a9f3 | 172 | //--------------------------------------------------------------------------- |