Fixed some issues found by winapi_check.
[wine] / programs / winhelp / hlpfile.h
1 /*
2  * Help Viewer
3  *
4  * Copyright    1996 Ulrich Schmid
5  *              2002 Eric Pouech
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 struct tagHelpFile;
23
24 typedef struct
25 {
26     LPCSTR                      lpszPath;
27     LONG                        lHash;
28     BOOL                        bPopup;
29 } HLPFILE_LINK;
30
31 enum para_type {para_normal_text, para_debug_text, para_image};
32
33 typedef struct tagHlpFileParagraph
34 {
35     enum para_type              cookie;
36
37     union
38     {
39         struct
40         {
41             LPSTR                       lpszText;
42             unsigned                    wFont;
43             unsigned                    wIndent;
44             unsigned                    wHSpace;
45             unsigned                    wVSpace;
46         } text;
47         struct
48         {
49             HBITMAP                     hBitmap;
50             unsigned                    pos;    /* 0: center, 1: left, 2: right */
51         } image;
52     } u;
53
54     HLPFILE_LINK*               link;
55
56     struct tagHlpFileParagraph* next;
57 } HLPFILE_PARAGRAPH;
58
59 typedef struct tagHlpFilePage
60 {
61     LPSTR                       lpszTitle;
62     HLPFILE_PARAGRAPH*          first_paragraph;
63
64     unsigned                    wNumber;
65     unsigned                    offset;
66     struct tagHlpFilePage*      next;
67     struct tagHlpFilePage*      prev;
68     struct tagHlpFileFile*      file;
69 } HLPFILE_PAGE;
70
71 typedef struct
72 {
73     LONG                        lHash;
74     unsigned long               offset;
75 } HLPFILE_CONTEXT;
76
77 typedef struct tagHlpFileMacro
78 {
79     LPCSTR                      lpszMacro;
80     struct tagHlpFileMacro*     next;
81 } HLPFILE_MACRO;
82
83 typedef struct
84 {
85     LOGFONT                     LogFont;
86     HFONT                       hFont;
87     COLORREF                    color;
88 } HLPFILE_FONT;
89
90 typedef struct tagHlpFileFile
91 {
92     LPSTR                       lpszPath;
93     LPSTR                       lpszTitle;
94     HLPFILE_PAGE*               first_page;
95     HLPFILE_MACRO*              first_macro;
96     unsigned                    wContextLen;
97     HLPFILE_CONTEXT*            Context;
98     struct tagHlpFileFile*      prev;
99     struct tagHlpFileFile*      next;
100
101     unsigned                    wRefCount;
102
103     unsigned short              version;
104     unsigned short              flags;
105     unsigned                    hasPhrases; /* Phrases or PhrIndex/PhrImage */
106
107     unsigned                    numFonts;
108     HLPFILE_FONT*               fonts;
109 } HLPFILE;
110
111 HLPFILE      *HLPFILE_ReadHlpFile(LPCSTR lpszPath);
112 HLPFILE_PAGE *HLPFILE_Contents(LPCSTR lpszPath);
113 HLPFILE_PAGE *HLPFILE_PageByHash(LPCSTR lpszPath, LONG wNum);
114 LONG          HLPFILE_Hash(LPCSTR lpszContext);
115 VOID          HLPFILE_FreeHlpFilePage(HLPFILE_PAGE*);
116 VOID          HLPFILE_FreeHlpFile(HLPFILE*);