ReactOS  0.4.13-dev-687-g023794c
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 "winuser.h"
30 #include "winnls.h"
31 #include "htmlhelp.h"
32 #include "ole2.h"
33 #include "exdisp.h"
34 #include "mshtmhst.h"
35 #include "commctrl.h"
36 
37 #ifdef INIT_GUID
38 #include "initguid.h"
39 #endif
40 
41 #include "wine/itss.h"
42 #include "wine/unicode.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 
54 typedef struct {
57 } ChmPath;
58 
59 typedef struct ContentItem {
61  struct ContentItem *child;
62  struct ContentItem *next;
63 
65 
69 } ContentItem;
70 
71 typedef struct IndexSubItem {
74 } IndexSubItem;
75 
76 typedef struct IndexItem {
77  struct IndexItem *next;
78 
82 
83  int nItems;
84  int itemFlags;
87 } IndexItem;
88 
89 typedef struct SearchItem {
90  struct SearchItem *next;
91 
95 } SearchItem;
96 
97 typedef struct CHMInfo
98 {
102 
104  char **strings;
106 
112 
114 } CHMInfo;
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 
122 typedef struct {
125 } HHTab;
126 
127 typedef struct {
131 } IndexPopup;
132 
133 typedef struct {
138 } SearchTab;
139 
140 typedef struct {
142 } ContentsTab;
143 
156 };
157 
159  char *pszType;
160  char *pszCaption;
161  char *pszToc;
162  char *pszIndex;
163  char *pszFile;
164  char *pszHome;
165  char *pszJump1;
166  char *pszJump2;
167  char *pszUrlJump1;
168  char *pszUrlJump2;
170 };
171 
172 typedef struct {
177 
179 
181  IWebBrowser2 *web_browser;
184 
185 typedef 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 
229 extern struct list window_list DECLSPEC_HIDDEN;
236 
237 void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN;
239 
243 WCHAR *decode_html(const char *html_fragment, int html_fragment_len, UINT code_page) DECLSPEC_HIDDEN;
245 
246 /* memory allocation functions */
247 
248 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
249 {
251 }
252 
253 static inline LPWSTR strdupW(LPCWSTR str)
254 {
255  LPWSTR ret;
256  int size;
257 
258  if(!str)
259  return NULL;
260 
261  size = (strlenW(str)+1)*sizeof(WCHAR);
262  ret = heap_alloc(size);
263  memcpy(ret, str, size);
264 
265  return ret;
266 }
267 
268 static inline LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
269 {
270  LPWSTR ret;
271  DWORD len;
272 
273  if(!str)
274  return NULL;
275 
276  if (lenA > 0)
277  {
278  /* find length of string */
279  LPCSTR eos = memchr(str, 0, lenA);
280  if (eos) lenA = eos - str;
281  }
282 
283  len = MultiByteToWideChar(CP_ACP, 0, str, lenA, NULL, 0)+1; /* +1 for null pad */
284  ret = heap_alloc(len*sizeof(WCHAR));
285  MultiByteToWideChar(CP_ACP, 0, str, lenA, ret, len);
286  ret[len-1] = 0;
287 
288  return ret;
289 }
290 
291 static inline LPWSTR strdupAtoW(LPCSTR str)
292 {
293  return strdupnAtoW(str, -1);
294 }
295 
296 static inline LPSTR strdupWtoA(LPCWSTR str)
297 {
298  LPSTR ret;
299  DWORD len;
300 
301  if(!str)
302  return NULL;
303 
304  len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
305  ret = heap_alloc(len);
307  return ret;
308 }
309 
310 
313 
314 #endif
WebBrowserContainer * web_browser
Definition: hhctrl.h:186
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN
Definition: search.c:222
void InitIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:265
struct IndexItem * next
Definition: hhctrl.h:77
WCHAR * pszCustomTabs
Definition: hhctrl.h:155
ChmPath merge
Definition: hhctrl.h:81
char * pszToc
Definition: hhctrl.h:161
Definition: hhctrl.h:122
IStream * GetChmStream(CHMInfo *, LPCWSTR, ChmPath *) DECLSPEC_HIDDEN
Definition: chm.c:532
IITStorage * pITStorage
Definition: hhctrl.h:99
WCHAR * pszJump1
Definition: hhctrl.h:151
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
char ** strings
Definition: hhctrl.h:104
HTREEITEM id
Definition: hhctrl.h:79
#define WideCharToMultiByte
Definition: compat.h:101
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define memchr(s, c, n)
Definition: mkisofs.h:875
CHMInfo * pCHMInfo
Definition: hhctrl.h:194
WCHAR * pszType
Definition: hhctrl.h:145
#define CP_ACP
Definition: compat.h:99
SearchItem * root
Definition: hhctrl.h:134
#define TAB_FAVORITES
Definition: hhctrl.h:119
char * pszUrlJump1
Definition: hhctrl.h:167
void DoPageAction(WebBrowserContainer *, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:753
IndexItem * index
Definition: hhctrl.h:196
static LPWSTR strdupAtoW(LPCSTR str)
Definition: hhctrl.h:291
static LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
Definition: hhctrl.h:268
struct ContentItem * parent
Definition: hhctrl.h:60
BOOL NavigateToUrl(HHInfo *, LPCWSTR) DECLSPEC_HIDDEN
Definition: help.c:209
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:296
WCHAR * defToc
Definition: hhctrl.h:111
WCHAR * pszJump2
Definition: hhctrl.h:152
void wintype_stringsW_free(struct wintype_stringsW *stringsW) DECLSPEC_HIDDEN
Definition: help.c:1761
LPWSTR local
Definition: hhctrl.h:67
BOOL InitWebBrowser(HHInfo *, HWND) DECLSPEC_HIDDEN
Definition: webbrowser.c:670
static void size_t len
Definition: hhctrl.h:249
char * pszCaption
Definition: hhctrl.h:160
DWORD strings_size
Definition: hhctrl.h:105
HWND hwndPopup
Definition: hhctrl.h:129
char * LPSTR
Definition: xmlstorage.h:182
char * pszJump1
Definition: hhctrl.h:165
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN
Definition: search.c:235
char * pszCustomTabs
Definition: hhctrl.h:169
void InitContent(HHInfo *) DECLSPEC_HIDDEN
Definition: content.c:304
IOleClientSite IOleClientSite_iface
Definition: hhctrl.h:173
LPWSTR chm_index
Definition: hhctrl.h:56
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct SearchItem SearchItem
struct list window_list DECLSPEC_HIDDEN
Definition: hhctrl.h:311
int nItems
Definition: hhctrl.h:83
IOleInPlaceSite IOleInPlaceSite_iface
Definition: hhctrl.h:174
ChmPath merge
Definition: hhctrl.h:68
HWND hwndContainer
Definition: hhctrl.h:137
DWORD current_tab
Definition: hhctrl.h:206
static void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem
HWND hwndTabCtrl
Definition: hhctrl.h:200
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
void ActivateContentTopic(HWND, LPCWSTR, ContentItem *) DECLSPEC_HIDDEN
Definition: content.c:330
struct CHMInfo CHMInfo
void ResizeWebBrowser(HHInfo *, DWORD, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:744
WCHAR * pszToc
Definition: hhctrl.h:147
const WCHAR * str
IWebBrowser2 * web_browser
Definition: hhctrl.h:181
smooth NULL
Definition: ftsmooth.c:416
BOOL hh_process
Definition: hhctrl.c:42
HWND hwndList
Definition: hhctrl.h:136
void ReleaseHelpViewer(HHInfo *) DECLSPEC_HIDDEN
Definition: help.c:1790
const char * LPCSTR
Definition: xmlstorage.h:183
IDocHostUIHandler IDocHostUIHandler_iface
Definition: hhctrl.h:176
void ReleaseContent(HHInfo *) DECLSPEC_HIDDEN
Definition: content.c:325
struct ContentItem ContentItem
WCHAR * defWindow
Definition: hhctrl.h:108
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
Definition: hhctrl.h:97
IStream * strings_stream
Definition: hhctrl.h:103
int indentLevel
Definition: hhctrl.h:85
struct IndexSubItem IndexSubItem
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
__wchar_t WCHAR
Definition: xmlstorage.h:180
char * pszJump2
Definition: hhctrl.h:166
static const WCHAR url[]
Definition: encode.c:1432
WCHAR * pszHome
Definition: hhctrl.h:150
ContentsTab contents
Definition: hhctrl.h:199
LPWSTR chm_file
Definition: hhctrl.h:55
Definition: hhctrl.h:185
IOleInPlaceFrame IOleInPlaceFrame_iface
Definition: hhctrl.h:175
unsigned long DWORD
Definition: ntddk_ex.h:95
HIMAGELIST hImageList
Definition: hhctrl.h:141
void wintype_stringsA_free(struct wintype_stringsA *stringsA) DECLSPEC_HIDDEN
Definition: help.c:1775
void SetChmPath(ChmPath *, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN
Definition: chm.c:496
UINT codePage
Definition: hhctrl.h:113
HWND hwndCallback
Definition: hhctrl.h:130
int ret
char * pszType
Definition: hhctrl.h:159
struct ContentItem * next
Definition: hhctrl.h:62
LPWSTR keyword
Definition: hhctrl.h:80
HH_WINTYPEW WinType
Definition: hhctrl.h:188
struct SearchItem * next
Definition: hhctrl.h:90
uint32_t entry
Definition: isohybrid.c:63
int itemFlags
Definition: hhctrl.h:84
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Definition: _list.h:228
static IHTMLWindow2 * window
Definition: events.c:77
IStorage * pStorage
Definition: hhctrl.h:100
HWND hwndEdit
Definition: hhctrl.h:135
HTREEITEM id
Definition: hhctrl.h:64
struct IndexItem IndexItem
HWND hwnd
Definition: hhctrl.h:123
void MergeChmProperties(HH_WINTYPEW *, HHInfo *, BOOL) DECLSPEC_HIDDEN
Definition: chm.c:253
ContentItem * content
Definition: hhctrl.h:195
HTREEITEM id
Definition: hhctrl.h:92
LPWSTR name
Definition: hhctrl.h:72
LPWSTR local
Definition: hhctrl.h:73
#define HeapReAlloc
Definition: compat.h:393
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
WCHAR * decode_html(const char *html_fragment, int html_fragment_len, UINT code_page) DECLSPEC_HIDDEN
Definition: help.c:1890
WCHAR * pszIndex
Definition: hhctrl.h:148
HWND hwndSizeBar
Definition: hhctrl.h:201
struct ContentItem * child
Definition: hhctrl.h:61
unsigned int UINT
Definition: ndis.h:50
LPWSTR FindContextAlias(CHMInfo *, DWORD) DECLSPEC_HIDDEN
Definition: chm.c:172
IOleObject * ole_obj
Definition: hhctrl.h:180
LPWSTR title
Definition: hhctrl.h:93
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
struct list window_list
Definition: help.c:51
#define MultiByteToWideChar
Definition: compat.h:100
void ReleaseWebBrowser(HHInfo *) DECLSPEC_HIDDEN
Definition: webbrowser.c:720
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: mem.c:156
WCHAR * defTopic
Definition: hhctrl.h:109
LPCWSTR skip_schema(LPCWSTR url) DECLSPEC_HIDDEN
Definition: chm.c:480
void ReleaseIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:288
char * pszUrlJump2
Definition: hhctrl.h:168
IndexSubItem * items
Definition: hhctrl.h:86
CHMInfo * OpenCHM(LPCWSTR szFile) DECLSPEC_HIDDEN
Definition: chm.c:619
SearchTab search
Definition: hhctrl.h:198
BOOL NavigateToChm(HHInfo *, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN
Definition: help.c:253
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HWND hwndList
Definition: hhctrl.h:128
CHMInfo * CloseCHM(CHMInfo *pCHMInfo) DECLSPEC_HIDDEN
Definition: chm.c:663
HHInfo * find_window(const WCHAR *window) DECLSPEC_HIDDEN
Definition: help.c:1955
WCHAR * szFile
Definition: hhctrl.h:101
WCHAR * GetDocumentTitle(CHMInfo *, LPCWSTR) DECLSPEC_HIDDEN
Definition: chm.c:565
int viewer_initialized
Definition: hhctrl.h:205
HFONT hFont
Definition: hhctrl.h:202
DWORD id
Definition: hhctrl.h:124
LPWSTR filename
Definition: hhctrl.h:94
char * pszFile
Definition: hhctrl.h:163
char * pszIndex
Definition: hhctrl.h:162
HHInfo * CreateHelpViewer(HHInfo *, LPCWSTR, HWND) DECLSPEC_HIDDEN
Definition: help.c:1819
WCHAR * defTitle
Definition: hhctrl.h:110
char * pszHome
Definition: hhctrl.h:164
WCHAR * pszFile
Definition: hhctrl.h:149
static LPWSTR strdupW(LPCWSTR str)
Definition: hhctrl.h:253
WCHAR * compiledFile
Definition: hhctrl.h:107
IndexPopup popup
Definition: hhctrl.h:197
BOOL LoadWinTypeFromCHM(HHInfo *info) DECLSPEC_HIDDEN
Definition: chm.c:341
LPWSTR name
Definition: hhctrl.h:66
void UpdateHelpWindow(HHInfo *info) DECLSPEC_HIDDEN
Definition: help.c:1559
WCHAR * pszCaption
Definition: hhctrl.h:146
Definition: hhctrl.h:54