ReactOS 0.4.15-dev-7958-gcd0bb1a
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 "wine/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/heap.h"
44#include "wine/list.h"
45
46#define WB_GOBACK 0
47#define WB_GOFORWARD 1
48#define WB_GOHOME 2
49#define WB_SEARCH 3
50#define WB_REFRESH 4
51#define WB_STOP 5
52#define WB_PRINT 6
53
54typedef struct {
57} ChmPath;
58
59typedef struct ContentItem {
63
65
70
71typedef struct IndexSubItem {
75
76typedef struct IndexItem {
77 struct IndexItem *next;
78
82
83 int nItems;
88
89typedef struct SearchItem {
91
96
97typedef struct CHMInfo
98{
102
104 char **strings;
106
112
115
116#define TAB_CONTENTS 0
117#define TAB_INDEX 1
118#define TAB_SEARCH 2
119#define TAB_FAVORITES 3
120#define TAB_NUMTABS TAB_FAVORITES
121
122typedef struct {
125} HHTab;
126
127typedef struct {
131} IndexPopup;
132
133typedef struct {
138} SearchTab;
139
140typedef struct {
143
156};
157
159 char *pszType;
161 char *pszToc;
162 char *pszIndex;
163 char *pszFile;
164 char *pszHome;
165 char *pszJump1;
166 char *pszJump2;
170};
171
172typedef struct {
177
179
181 IWebBrowser2 *web_browser;
184
185typedef struct {
187
189
190 struct wintype_stringsA stringsA;
191 struct wintype_stringsW stringsW;
192
193 struct list entry;
203
207} HHInfo;
208
213
217
220
228
229extern struct list window_list DECLSPEC_HIDDEN;
232#ifdef __REACTOS__
234#endif
239
240void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN;
242
246WCHAR *decode_html(const char *html_fragment, int html_fragment_len, UINT code_page) DECLSPEC_HIDDEN;
248
249/* memory allocation functions */
250
251static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
252{
254}
255
256static inline LPWSTR strdupW(LPCWSTR str)
257{
258 LPWSTR ret;
259 int size;
260
261 if(!str)
262 return NULL;
263
264 size = (lstrlenW(str)+1)*sizeof(WCHAR);
266 memcpy(ret, str, size);
267
268 return ret;
269}
270
271static inline LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
272{
273 LPWSTR ret;
274 DWORD len;
275
276 if(!str)
277 return NULL;
278
279 if (lenA > 0)
280 {
281 /* find length of string */
282 LPCSTR eos = memchr(str, 0, lenA);
283 if (eos) lenA = eos - str;
284 }
285
286 len = MultiByteToWideChar(CP_ACP, 0, str, lenA, NULL, 0)+1; /* +1 for null pad */
287 ret = heap_alloc(len*sizeof(WCHAR));
288 MultiByteToWideChar(CP_ACP, 0, str, lenA, ret, len);
289 ret[len-1] = 0;
290
291 return ret;
292}
293
295{
296 return strdupnAtoW(str, -1);
297}
298
300{
301 LPSTR ret;
302 DWORD len;
303
304 if(!str)
305 return NULL;
306
307 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
308 ret = heap_alloc(len);
310 return ret;
311}
312
313
316
317#endif
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
Definition: list.h:37
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapReAlloc
Definition: compat.h:734
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrlenW
Definition: compat.h:750
struct list window_list
Definition: help.c:51
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:177
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
BOOL hh_process
Definition: hhctrl.c:42
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
void ReleaseWebBrowser(HHInfo *) DECLSPEC_HIDDEN
Definition: webbrowser.c:720
BOOL NavigateToUrl(HHInfo *, LPCWSTR) DECLSPEC_HIDDEN
Definition: help.c:213
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN
Definition: search.c:235
LPCWSTR skip_schema(LPCWSTR url) DECLSPEC_HIDDEN
Definition: chm.c:487
IStream * GetChmStream(CHMInfo *, LPCWSTR, ChmPath *) DECLSPEC_HIDDEN
Definition: chm.c:539
void InitIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:265
struct list window_list DECLSPEC_HIDDEN
Definition: hhctrl.h:314
void ActivateContentTopic(HWND, LPCWSTR, ContentItem *) DECLSPEC_HIDDEN
Definition: content.c:330
BOOL LoadWinTypeFromCHM(HHInfo *info) DECLSPEC_HIDDEN
Definition: chm.c:344
void InitContent(HHInfo *) DECLSPEC_HIDDEN
Definition: content.c:304
void wintype_stringsW_free(struct wintype_stringsW *stringsW) DECLSPEC_HIDDEN
Definition: help.c:1773
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:299
CHMInfo * OpenCHM(LPCWSTR szFile) DECLSPEC_HIDDEN
Definition: chm.c:626
#define TAB_FAVORITES
Definition: hhctrl.h:119
static void size_t len
Definition: hhctrl.h:252
void DoPageAction(WebBrowserContainer *, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:753
static LPWSTR strdupAtoW(LPCSTR str)
Definition: hhctrl.h:294
HHInfo * CreateHelpViewer(HHInfo *, LPCWSTR, HWND) DECLSPEC_HIDDEN
Definition: help.c:1831
void MergeChmProperties(HH_WINTYPEW *, HHInfo *, BOOL) DECLSPEC_HIDDEN
Definition: chm.c:256
BOOL NavigateToChm(HHInfo *, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN
Definition: help.c:257
void SetChmPath(ChmPath *, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN
Definition: chm.c:503
void ReleaseContent(HHInfo *) DECLSPEC_HIDDEN
Definition: content.c:325
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN
Definition: search.c:222
WCHAR * decode_html(const char *html_fragment, int html_fragment_len, UINT code_page) DECLSPEC_HIDDEN
Definition: help.c:1902
void ReleaseIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:288
void wintype_stringsA_free(struct wintype_stringsA *stringsA) DECLSPEC_HIDDEN
Definition: help.c:1787
WCHAR * GetDocumentTitle(CHMInfo *, LPCWSTR) DECLSPEC_HIDDEN
Definition: chm.c:572
void ResizeWebBrowser(HHInfo *, DWORD, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:744
LPWSTR FindContextAlias(CHMInfo *, DWORD) DECLSPEC_HIDDEN
Definition: chm.c:175
CHMInfo * CloseCHM(CHMInfo *pCHMInfo) DECLSPEC_HIDDEN
Definition: chm.c:670
void ReleaseHelpViewer(HHInfo *) DECLSPEC_HIDDEN
Definition: help.c:1802
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:271
static LPWSTR strdupW(LPCWSTR str)
Definition: hhctrl.h:256
BOOL InitWebBrowser(HHInfo *, HWND) DECLSPEC_HIDDEN
Definition: webbrowser.c:670
void UpdateHelpWindow(HHInfo *info) DECLSPEC_HIDDEN
Definition: help.c:1563
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memchr(s, c, n)
Definition: mkisofs.h:875
static const WCHAR url[]
Definition: encode.c:1432
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static IHTMLWindow2 * window
Definition: events.c:77
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
const WCHAR * str
Definition: hhctrl.h:98
WCHAR * defTopic
Definition: hhctrl.h:109
IStorage * pStorage
Definition: hhctrl.h:100
UINT codePage
Definition: hhctrl.h:113
DWORD strings_size
Definition: hhctrl.h:105
WCHAR * defTitle
Definition: hhctrl.h:110
char ** strings
Definition: hhctrl.h:104
WCHAR * compiledFile
Definition: hhctrl.h:107
IITStorage * pITStorage
Definition: hhctrl.h:99
WCHAR * defToc
Definition: hhctrl.h:111
IStream * strings_stream
Definition: hhctrl.h:103
WCHAR * szFile
Definition: hhctrl.h:101
WCHAR * defWindow
Definition: hhctrl.h:108
Definition: hhctrl.h:54
LPWSTR chm_file
Definition: hhctrl.h:55
LPWSTR chm_index
Definition: hhctrl.h:56
struct ContentItem * parent
Definition: hhctrl.h:60
struct ContentItem * next
Definition: hhctrl.h:62
struct ContentItem * child
Definition: hhctrl.h:61
LPWSTR local
Definition: hhctrl.h:67
ChmPath merge
Definition: hhctrl.h:68
HTREEITEM id
Definition: hhctrl.h:64
LPWSTR name
Definition: hhctrl.h:66
HIMAGELIST hImageList
Definition: hhctrl.h:141
Definition: hhctrl.h:185
ContentItem * content
Definition: hhctrl.h:195
IndexPopup popup
Definition: hhctrl.h:197
CHMInfo * pCHMInfo
Definition: hhctrl.h:194
int viewer_initialized
Definition: hhctrl.h:205
HWND hwndTabCtrl
Definition: hhctrl.h:200
IndexItem * index
Definition: hhctrl.h:196
HH_WINTYPEW WinType
Definition: hhctrl.h:188
DWORD current_tab
Definition: hhctrl.h:206
HWND hwndSizeBar
Definition: hhctrl.h:201
SearchTab search
Definition: hhctrl.h:198
HFONT hFont
Definition: hhctrl.h:202
ContentsTab contents
Definition: hhctrl.h:199
WebBrowserContainer * web_browser
Definition: hhctrl.h:186
Definition: hhctrl.h:122
HWND hwnd
Definition: hhctrl.h:123
DWORD id
Definition: hhctrl.h:124
int itemFlags
Definition: hhctrl.h:84
int nItems
Definition: hhctrl.h:83
IndexSubItem * items
Definition: hhctrl.h:86
HTREEITEM id
Definition: hhctrl.h:79
struct IndexItem * next
Definition: hhctrl.h:77
ChmPath merge
Definition: hhctrl.h:81
int indentLevel
Definition: hhctrl.h:85
LPWSTR keyword
Definition: hhctrl.h:80
HWND hwndCallback
Definition: hhctrl.h:130
HWND hwndPopup
Definition: hhctrl.h:129
HWND hwndList
Definition: hhctrl.h:128
LPWSTR local
Definition: hhctrl.h:73
LPWSTR name
Definition: hhctrl.h:72
LPWSTR filename
Definition: hhctrl.h:94
HTREEITEM id
Definition: hhctrl.h:92
LPWSTR title
Definition: hhctrl.h:93
struct SearchItem * next
Definition: hhctrl.h:90
HWND hwndContainer
Definition: hhctrl.h:137
HWND hwndList
Definition: hhctrl.h:136
HWND hwndEdit
Definition: hhctrl.h:135
SearchItem * root
Definition: hhctrl.h:134
IWebBrowser2 * web_browser
Definition: hhctrl.h:181
IOleInPlaceSite IOleInPlaceSite_iface
Definition: hhctrl.h:174
IOleInPlaceFrame IOleInPlaceFrame_iface
Definition: hhctrl.h:175
IOleObject * ole_obj
Definition: hhctrl.h:180
IDocHostUIHandler IDocHostUIHandler_iface
Definition: hhctrl.h:176
IOleClientSite IOleClientSite_iface
Definition: hhctrl.h:173
Definition: mem.c:156
char * pszToc
Definition: hhctrl.h:161
char * pszCustomTabs
Definition: hhctrl.h:169
char * pszHome
Definition: hhctrl.h:164
char * pszType
Definition: hhctrl.h:159
char * pszUrlJump2
Definition: hhctrl.h:168
char * pszIndex
Definition: hhctrl.h:162
char * pszJump1
Definition: hhctrl.h:165
char * pszUrlJump1
Definition: hhctrl.h:167
char * pszJump2
Definition: hhctrl.h:166
char * pszCaption
Definition: hhctrl.h:160
char * pszFile
Definition: hhctrl.h:163
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
WCHAR * pszJump1
Definition: hhctrl.h:151
WCHAR * pszHome
Definition: hhctrl.h:150
WCHAR * pszCustomTabs
Definition: hhctrl.h:155
WCHAR * pszToc
Definition: hhctrl.h:147
WCHAR * pszCaption
Definition: hhctrl.h:146
WCHAR * pszFile
Definition: hhctrl.h:149
WCHAR * pszJump2
Definition: hhctrl.h:152
WCHAR * pszType
Definition: hhctrl.h:145
WCHAR * pszIndex
Definition: hhctrl.h:148
static HWND find_window()
Definition: wclickat.c:251
int ret
#define __WINE_ALLOC_SIZE(x)
Definition: winnt_old.h:84
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185