ReactOS 0.4.17-dev-806-gffa4164
hhctrl.h
Go to the documentation of this file.
1/*
2 * Copyright 2005 James Hawkins
3 * Copyright 2007 Jacek Caban for CodeWeavers
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#ifndef HHCTRL_H
21#define HHCTRL_H
22
23#include <stdarg.h>
24
25#define COBJMACROS
26
27#include "windef.h"
28#include "winbase.h"
29#include "winternl.h"
30#include "winuser.h"
31#include "winnls.h"
32#include "htmlhelp.h"
33#include "ole2.h"
34#include "exdisp.h"
35#include "mshtmhst.h"
36#include "commctrl.h"
37
38#ifdef INIT_GUID
39#include "initguid.h"
40#endif
41
42#include "wine/itss.h"
43#include "wine/list.h"
44
45#define WB_GOBACK 0
46#define WB_GOFORWARD 1
47#define WB_GOHOME 2
48#define WB_SEARCH 3
49#define WB_REFRESH 4
50#define WB_STOP 5
51#define WB_PRINT 6
52
53typedef struct {
56} ChmPath;
57
58typedef struct ContentItem {
62
64
69
70typedef struct IndexSubItem {
74
75typedef struct IndexItem {
76 struct IndexItem *next;
77
81
82 int nItems;
87
88typedef struct SearchItem {
90
95
96typedef struct CHMInfo
97{
101
103 char **strings;
105
111
114
115#define TAB_CONTENTS 0
116#define TAB_INDEX 1
117#define TAB_SEARCH 2
118#define TAB_FAVORITES 3
119#define TAB_NUMTABS TAB_FAVORITES
120
121typedef struct {
124} HHTab;
125
126typedef struct {
130} IndexPopup;
131
132typedef struct {
137} SearchTab;
138
139typedef struct {
142
155};
156
158 char *pszType;
160 char *pszToc;
161 char *pszIndex;
162 char *pszFile;
163 char *pszHome;
164 char *pszJump1;
165 char *pszJump2;
169};
170
171typedef struct {
176
178
180 IWebBrowser2 *web_browser;
183
184typedef struct {
186
188
189 struct wintype_stringsA stringsA;
190 struct wintype_stringsW stringsW;
191
192 struct list entry;
201 HFONT hFont;
202
206} HHInfo;
207
212
213void InitContent(HHInfo*);
216
217void InitIndex(HHInfo*);
218void ReleaseIndex(HHInfo*);
219
220CHMInfo *OpenCHM(LPCWSTR szFile);
222CHMInfo *CloseCHM(CHMInfo *pCHMInfo);
227
228extern struct list window_list;
231#ifdef __REACTOS__
233#endif
238
239void InitSearch(HHInfo *info, const char *needle);
241
243void wintype_stringsA_free(struct wintype_stringsA *stringsA);
244void wintype_stringsW_free(struct wintype_stringsW *stringsW);
245WCHAR *decode_html(const char *html_fragment, int html_fragment_len, UINT code_page);
247
248/* memory allocation functions */
249
250static inline LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
251{
252 LPWSTR ret;
253 DWORD len;
254
255 if(!str)
256 return NULL;
257
258 if (lenA > 0)
259 {
260 /* find length of string */
261 LPCSTR eos = memchr(str, 0, lenA);
262 if (eos) lenA = eos - str;
263 }
264
265 len = MultiByteToWideChar(CP_ACP, 0, str, lenA, NULL, 0)+1; /* +1 for null pad */
266 ret = malloc(len * sizeof(WCHAR));
267 MultiByteToWideChar(CP_ACP, 0, str, lenA, ret, len);
268 ret[len-1] = 0;
269
270 return ret;
271}
272
274{
275 return strdupnAtoW(str, -1);
276}
277
279{
280 LPSTR ret;
281 DWORD len;
282
283 if(!str)
284 return NULL;
285
286 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
287 ret = malloc(len);
289 return ret;
290}
291
292
294extern BOOL hh_process;
295
296#endif
Definition: list.h:37
_Out_opt_ UINT * code_page
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:177
return ret
Definition: mutex.c:147
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: sysinfo.c:13
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1773
void ReleaseWebBrowser(HHInfo *)
Definition: webbrowser.c:720
void InitSearch(HHInfo *info, const char *needle)
Definition: search.c:224
BOOL NavigateToChm(HHInfo *, LPCWSTR, LPCWSTR)
Definition: help.c:257
CHMInfo * CloseCHM(CHMInfo *pCHMInfo)
Definition: chm.c:683
struct list window_list
Definition: help.c:51
void wintype_stringsA_free(struct wintype_stringsA *stringsA)
Definition: help.c:1787
BOOL hh_process
Definition: hhctrl.c:42
LPWSTR FindContextAlias(CHMInfo *, DWORD)
Definition: chm.c:188
void ReleaseIndex(HHInfo *)
Definition: index.c:288
void MergeChmProperties(HH_WINTYPEW *, HHInfo *, BOOL)
Definition: chm.c:269
HHInfo * CreateHelpViewer(HHInfo *, LPCWSTR, HWND)
Definition: help.c:1831
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:278
#define TAB_FAVORITES
Definition: hhctrl.h:118
WCHAR * decode_html(const char *html_fragment, int html_fragment_len, UINT code_page)
Definition: help.c:1902
LPCWSTR skip_schema(LPCWSTR url)
Definition: chm.c:500
void ActivateContentTopic(HWND, LPCWSTR, ContentItem *)
Definition: content.c:328
static LPWSTR strdupAtoW(LPCSTR str)
Definition: hhctrl.h:273
void InitIndex(HHInfo *)
Definition: index.c:265
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:639
void UpdateHelpWindow(HHInfo *info)
Definition: help.c:1563
BOOL NavigateToUrl(HHInfo *, LPCWSTR)
Definition: help.c:213
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
void ResizeWebBrowser(HHInfo *, DWORD, DWORD)
Definition: webbrowser.c:744
void ReleaseHelpViewer(HHInfo *)
Definition: help.c:1802
void InitContent(HHInfo *)
Definition: content.c:302
void ReleaseContent(HHInfo *)
Definition: content.c:323
void DoPageAction(WebBrowserContainer *, DWORD)
Definition: webbrowser.c:753
IStream * GetChmStream(CHMInfo *, LPCWSTR, ChmPath *)
Definition: chm.c:552
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:357
BOOL InitWebBrowser(HHInfo *, HWND)
Definition: webbrowser.c:670
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:250
void ReleaseSearch(HHInfo *info)
Definition: search.c:237
WCHAR * GetDocumentTitle(CHMInfo *, LPCWSTR)
Definition: chm.c:585
void SetChmPath(ChmPath *, LPCWSTR, LPCWSTR)
Definition: chm.c:516
uint32_t entry
Definition: isohybrid.c:63
#define memchr(s, c, n)
Definition: mkisofs.h:875
static const WCHAR url[]
Definition: encode.c:1384
static IHTMLWindow2 * window
Definition: events.c:77
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
const WCHAR * str
Definition: hhctrl.h:97
WCHAR * defTopic
Definition: hhctrl.h:108
IStorage * pStorage
Definition: hhctrl.h:99
UINT codePage
Definition: hhctrl.h:112
DWORD strings_size
Definition: hhctrl.h:104
WCHAR * defTitle
Definition: hhctrl.h:109
char ** strings
Definition: hhctrl.h:103
WCHAR * compiledFile
Definition: hhctrl.h:106
IITStorage * pITStorage
Definition: hhctrl.h:98
WCHAR * defToc
Definition: hhctrl.h:110
IStream * strings_stream
Definition: hhctrl.h:102
WCHAR * szFile
Definition: hhctrl.h:100
WCHAR * defWindow
Definition: hhctrl.h:107
Definition: hhctrl.h:53
LPWSTR chm_file
Definition: hhctrl.h:54
LPWSTR chm_index
Definition: hhctrl.h:55
struct ContentItem * parent
Definition: hhctrl.h:59
struct ContentItem * next
Definition: hhctrl.h:61
struct ContentItem * child
Definition: hhctrl.h:60
LPWSTR local
Definition: hhctrl.h:66
ChmPath merge
Definition: hhctrl.h:67
HTREEITEM id
Definition: hhctrl.h:63
LPWSTR name
Definition: hhctrl.h:65
HIMAGELIST hImageList
Definition: hhctrl.h:140
Definition: hhctrl.h:184
ContentItem * content
Definition: hhctrl.h:194
IndexPopup popup
Definition: hhctrl.h:196
CHMInfo * pCHMInfo
Definition: hhctrl.h:193
int viewer_initialized
Definition: hhctrl.h:204
HWND hwndTabCtrl
Definition: hhctrl.h:199
IndexItem * index
Definition: hhctrl.h:195
HH_WINTYPEW WinType
Definition: hhctrl.h:187
DWORD current_tab
Definition: hhctrl.h:205
HWND hwndSizeBar
Definition: hhctrl.h:200
SearchTab search
Definition: hhctrl.h:197
HFONT hFont
Definition: hhctrl.h:201
ContentsTab contents
Definition: hhctrl.h:198
WebBrowserContainer * web_browser
Definition: hhctrl.h:185
Definition: hhctrl.h:121
HWND hwnd
Definition: hhctrl.h:122
DWORD id
Definition: hhctrl.h:123
int itemFlags
Definition: hhctrl.h:83
int nItems
Definition: hhctrl.h:82
IndexSubItem * items
Definition: hhctrl.h:85
HTREEITEM id
Definition: hhctrl.h:78
struct IndexItem * next
Definition: hhctrl.h:76
ChmPath merge
Definition: hhctrl.h:80
int indentLevel
Definition: hhctrl.h:84
LPWSTR keyword
Definition: hhctrl.h:79
HWND hwndCallback
Definition: hhctrl.h:129
HWND hwndPopup
Definition: hhctrl.h:128
HWND hwndList
Definition: hhctrl.h:127
LPWSTR local
Definition: hhctrl.h:72
LPWSTR name
Definition: hhctrl.h:71
LPWSTR filename
Definition: hhctrl.h:93
HTREEITEM id
Definition: hhctrl.h:91
LPWSTR title
Definition: hhctrl.h:92
struct SearchItem * next
Definition: hhctrl.h:89
HWND hwndContainer
Definition: hhctrl.h:136
HWND hwndList
Definition: hhctrl.h:135
HWND hwndEdit
Definition: hhctrl.h:134
SearchItem * root
Definition: hhctrl.h:133
IWebBrowser2 * web_browser
Definition: hhctrl.h:180
IOleInPlaceSite IOleInPlaceSite_iface
Definition: hhctrl.h:173
IOleInPlaceFrame IOleInPlaceFrame_iface
Definition: hhctrl.h:174
IOleObject * ole_obj
Definition: hhctrl.h:179
IDocHostUIHandler IDocHostUIHandler_iface
Definition: hhctrl.h:175
IOleClientSite IOleClientSite_iface
Definition: hhctrl.h:172
char * pszToc
Definition: hhctrl.h:160
char * pszCustomTabs
Definition: hhctrl.h:168
char * pszHome
Definition: hhctrl.h:163
char * pszType
Definition: hhctrl.h:158
char * pszUrlJump2
Definition: hhctrl.h:167
char * pszIndex
Definition: hhctrl.h:161
char * pszJump1
Definition: hhctrl.h:164
char * pszUrlJump1
Definition: hhctrl.h:166
char * pszJump2
Definition: hhctrl.h:165
char * pszCaption
Definition: hhctrl.h:159
char * pszFile
Definition: hhctrl.h:162
WCHAR * pszUrlJump1
Definition: hhctrl.h:152
WCHAR * pszUrlJump2
Definition: hhctrl.h:153
WCHAR * pszJump1
Definition: hhctrl.h:150
WCHAR * pszHome
Definition: hhctrl.h:149
WCHAR * pszCustomTabs
Definition: hhctrl.h:154
WCHAR * pszToc
Definition: hhctrl.h:146
WCHAR * pszCaption
Definition: hhctrl.h:145
WCHAR * pszFile
Definition: hhctrl.h:148
WCHAR * pszJump2
Definition: hhctrl.h:151
WCHAR * pszType
Definition: hhctrl.h:144
WCHAR * pszIndex
Definition: hhctrl.h:147
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
char * LPSTR
Definition: typedefs.h:51
static HWND find_window()
Definition: wclickat.c:251