Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
[wine] / programs / winhelp / winhelp.h
1 /*
2  * Help Viewer
3  *
4  * Copyright    1996 Ulrich Schmid
5  * Copyright    2002 Sylvain Petreolle <spetreolle@yahoo.fr>
6  *              2002 Eric Pouech
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #define MAX_LANGUAGE_NUMBER     255
24 #define MAX_PATHNAME_LEN        1024
25 #define MAX_STRING_LEN          255
26
27 #define INTERNAL_BORDER_WIDTH   5
28 #define POPUP_YDISTANCE         20
29 #define SHADOW_DX               10
30 #define SHADOW_DY               10
31 #define BUTTON_CX               6
32 #define BUTTON_CY               6
33
34 #ifndef RC_INVOKED
35
36 #include <stdarg.h>
37
38 #include "hlpfile.h"
39 #include "windef.h"
40 #include "winbase.h"
41 #include "macro.h"
42 #include "winhelp_res.h"
43
44 typedef struct tagHelpLinePart
45 {
46     RECT      rect;
47     enum {hlp_line_part_text, hlp_line_part_bitmap, hlp_line_part_metafile} cookie;
48     union
49     {
50         struct
51         {
52             LPCSTR      lpsText;
53             HFONT       hFont;
54             COLORREF    color;
55             WORD        wTextLen;
56             WORD        wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
57         } text;
58         struct
59         {
60             HBITMAP     hBitmap;
61         } bitmap;
62         struct
63         {
64             HMETAFILE   hMetaFile;
65         } metafile;
66     } u;
67     HLPFILE_LINK*       link;
68
69     struct tagHelpLinePart *next;
70 } WINHELP_LINE_PART;
71
72 typedef struct tagHelpLine
73 {
74     RECT                rect;
75     WINHELP_LINE_PART   first_part;
76     struct tagHelpLine* next;
77 } WINHELP_LINE;
78
79 typedef struct tagHelpButton
80 {
81     HWND                hWnd;
82
83     LPCSTR              lpszID;
84     LPCSTR              lpszName;
85     LPCSTR              lpszMacro;
86
87     WPARAM              wParam;
88
89     RECT                rect;
90
91     struct tagHelpButton*next;
92 } WINHELP_BUTTON;
93
94 typedef struct tagWinHelp
95 {
96     LPCSTR              lpszName;
97
98     WINHELP_BUTTON*     first_button;
99     HLPFILE_PAGE*       page;
100     WINHELP_LINE*       first_line;
101
102     HWND                hMainWnd;
103     HWND                hButtonBoxWnd;
104     HWND                hTextWnd;
105     HWND                hShadowWnd;
106     HWND                hHistoryWnd;
107
108     HFONT*              fonts;
109     UINT                fonts_len;
110
111     HCURSOR             hArrowCur;
112     HCURSOR             hHandCur;
113
114     HLPFILE_WINDOWINFO* info;
115
116     /* FIXME: for now it's a fixed size */
117     HLPFILE_PAGE*       history[40];
118     unsigned            histIndex;
119     HLPFILE_PAGE*       back[40];
120     unsigned            backIndex;
121
122     struct tagWinHelp*  next;
123 } WINHELP_WINDOW;
124
125 #define DC_NOMSG     0x00000000
126 #define DC_MINMAX    0x00000001
127 #define DC_INITTERM  0x00000002
128 #define DC_JUMP      0x00000004
129 #define DC_ACTIVATE  0x00000008
130 #define DC_CALLBACKS 0x00000010
131
132 #define DW_NOTUSED    0
133 #define DW_WHATMSG    1
134 #define DW_MINMAX     2
135 #define DW_SIZE       3
136 #define DW_INIT       4
137 #define DW_TERM       5
138 #define DW_STARTJUMP  6
139 #define DW_ENDJUMP    7
140 #define DW_CHGFILE    8
141 #define DW_ACTIVATE   9
142 #define DW_CALLBACKS 10
143
144 typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG);
145
146 typedef struct tagDll
147 {
148     HANDLE              hLib;
149     const char*         name;
150     WINHELP_LDLLHandler handler;
151     DWORD               class;
152     struct tagDll*      next;
153 } WINHELP_DLL;
154
155 typedef struct
156 {
157     UINT                wVersion;
158     HANDLE              hInstance;
159     HWND                hPopupWnd;
160     UINT                wStringTableOffset;
161     BOOL                isBook;
162     WINHELP_WINDOW*     active_win;
163     WINHELP_WINDOW*     win_list;
164     WNDPROC             button_proc;
165     WINHELP_DLL*        dlls;
166 } WINHELP_GLOBALS;
167
168 extern WINHELP_GLOBALS Globals;
169 extern FARPROC         Callbacks[];
170
171 BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
172 BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
173 INT  WINHELP_MessageBoxIDS(UINT, UINT, WORD);
174 INT  WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
175 HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
176 HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
177
178 extern const char MAIN_WIN_CLASS_NAME[];
179 extern const char BUTTON_BOX_WIN_CLASS_NAME[];
180 extern const char TEXT_WIN_CLASS_NAME[];
181 extern const char SHADOW_WIN_CLASS_NAME[];
182 extern const char HISTORY_WIN_CLASS_NAME[];
183 extern const char STRING_BUTTON[];
184 extern const char STRING_MENU_Xx[];
185 extern const char STRING_DIALOG_TEST[];
186 #endif
187
188 /* Buttons */
189 #define WH_FIRST_BUTTON     500