Handle generic column width changes.
[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     enum {hlp_link_none, hlp_link_link, hlp_link_popup, hlp_link_macro} cookie;
27     LPCSTR    lpszString;
28     LONG      lHash;
29     BOOL      bClrChange;
30 } HLPFILE_LINK;
31
32 enum para_type {para_normal_text, para_debug_text, para_image};
33
34 typedef struct tagHlpFileParagraph
35 {
36     enum para_type              cookie;
37
38     union
39     {
40         struct
41         {
42             LPSTR                       lpszText;
43             unsigned                    wFont;
44             unsigned                    wIndent;
45             unsigned                    wHSpace;
46             unsigned                    wVSpace;
47         } text;
48         struct
49         {
50             HBITMAP                     hBitmap;
51             unsigned                    pos;    /* 0: center, 1: left, 2: right */
52         } image;
53     } u;
54
55     HLPFILE_LINK*               link;
56
57     struct tagHlpFileParagraph* next;
58 } HLPFILE_PARAGRAPH;
59
60 typedef struct tagHlpFilePage
61 {
62     LPSTR                       lpszTitle;
63     HLPFILE_PARAGRAPH*          first_paragraph;
64
65     unsigned                    wNumber;
66     unsigned                    offset;
67     struct tagHlpFilePage*      next;
68     struct tagHlpFilePage*      prev;
69     struct tagHlpFileFile*      file;
70 } HLPFILE_PAGE;
71
72 typedef struct
73 {
74     LONG                        lHash;
75     unsigned long               offset;
76 } HLPFILE_CONTEXT;
77
78 typedef struct tagHlpFileMacro
79 {
80     LPCSTR                      lpszMacro;
81     struct tagHlpFileMacro*     next;
82 } HLPFILE_MACRO;
83
84 typedef struct
85 {
86     LOGFONT                     LogFont;
87     HFONT                       hFont;
88     COLORREF                    color;
89 } HLPFILE_FONT;
90
91 typedef struct tagHlpFileFile
92 {
93     LPSTR                       lpszPath;
94     LPSTR                       lpszTitle;
95     HLPFILE_PAGE*               first_page;
96     HLPFILE_MACRO*              first_macro;
97     unsigned                    wContextLen;
98     HLPFILE_CONTEXT*            Context;
99     struct tagHlpFileFile*      prev;
100     struct tagHlpFileFile*      next;
101
102     unsigned                    wRefCount;
103
104     unsigned short              version;
105     unsigned short              flags;
106     unsigned                    hasPhrases; /* Phrases or PhrIndex/PhrImage */
107
108     unsigned                    numFonts;
109     HLPFILE_FONT*               fonts;
110 } HLPFILE;
111
112 HLPFILE      *HLPFILE_ReadHlpFile(LPCSTR lpszPath);
113 HLPFILE_PAGE *HLPFILE_Contents(LPCSTR lpszPath);
114 HLPFILE_PAGE *HLPFILE_PageByHash(LPCSTR lpszPath, LONG wNum);
115 LONG          HLPFILE_Hash(LPCSTR lpszContext);
116 VOID          HLPFILE_FreeHlpFilePage(HLPFILE_PAGE*);
117 VOID          HLPFILE_FreeHlpFile(HLPFILE*);