Port DriverSample.inf, HiiDatabase.inf and SetupBrowser.inf
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / HiiDataBaseDxe / HiiDatabase.h
CommitLineData
103b6520 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 HiiDatabase.h\r
15\r
16Abstract:\r
17\r
18 This file contains global defines and prototype definitions \r
19 for the HII database.\r
20\r
21--*/\r
22\r
23#ifndef _HIIDATABASE_H\r
24#define _HIIDATABASE_H\r
25\r
26//\r
27// Include common header file for this module.\r
28//\r
29#include "CommonHeader.h"\r
30\r
31//\r
32// HII Database Global data\r
33//\r
34#define EFI_HII_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'i', 'P')\r
35\r
36#define MAX_GLYPH_COUNT 65535\r
37#define NARROW_GLYPH_ARRAY_SIZE 19\r
38#define WIDE_GLYPH_ARRAY_SIZE 38\r
39\r
40#define SETUP_MAP_NAME L"Setup"\r
41#define HII_VARIABLE_SUFFIX_USER_DATA L"UserSavedData"\r
42#define HII_VARIABLE_SUFFIX_DEFAULT_OVERRIDE L"DefaultOverride"\r
43#define HII_VARIABLE_SUFFIX_MANUFACTURING_OVERRIDE L"ManufacturingOverride"\r
44\r
45typedef struct _EFI_HII_HANDLE_DATABASE {\r
46 VOID *Buffer; // Actual buffer pointer\r
47 EFI_HII_HANDLE Handle; // Monotonically increasing value to signify the value returned to caller\r
48 UINT32 NumberOfTokens; // The initial number of tokens when first registered\r
49 struct _EFI_HII_HANDLE_DATABASE *NextHandleDatabase;\r
50} EFI_HII_HANDLE_DATABASE;\r
51\r
52typedef struct {\r
53 EFI_NARROW_GLYPH NarrowGlyphs[MAX_GLYPH_COUNT];\r
54 EFI_WIDE_GLYPH WideGlyphs[MAX_GLYPH_COUNT];\r
55 EFI_KEY_DESCRIPTOR SystemKeyboardLayout[106];\r
56 EFI_KEY_DESCRIPTOR OverrideKeyboardLayout[106];\r
57 BOOLEAN SystemKeyboardUpdate; // Has the SystemKeyboard been updated?\r
58} EFI_HII_GLOBAL_DATA;\r
59\r
60typedef struct {\r
61 UINTN Signature;\r
62\r
63 EFI_HII_GLOBAL_DATA *GlobalData;\r
64 EFI_HII_HANDLE_DATABASE *DatabaseHead; // Head of the Null-terminated singly-linked list of handles.\r
65 EFI_HII_PROTOCOL Hii;\r
66} EFI_HII_DATA;\r
67\r
68typedef struct {\r
69 EFI_HII_HANDLE Handle;\r
70 EFI_GUID Guid;\r
71 EFI_HII_HANDLE_PACK HandlePack;\r
72 UINTN IfrSize;\r
73 UINTN StringSize;\r
74 EFI_HII_IFR_PACK *IfrData; // All the IFR data stored here\r
75 EFI_HII_STRING_PACK *StringData; // All the String data stored at &IfrData + IfrSize (StringData is just a label - never referenced)\r
76} EFI_HII_PACKAGE_INSTANCE;\r
77\r
78typedef struct {\r
79 EFI_HII_PACK_HEADER Header;\r
80 EFI_IFR_FORM_SET FormSet;\r
81 EFI_IFR_END_FORM_SET EndFormSet;\r
82} EFI_FORM_SET_STUB;\r
83\r
84#define EFI_HII_DATA_FROM_THIS(a) CR (a, EFI_HII_DATA, Hii, EFI_HII_DATA_SIGNATURE)\r
85\r
86#define NARROW_WIDTH 8\r
87#define WIDE_WIDTH 16\r
88\r
89extern UINT8 mUnknownGlyph[38];\r
90\r
91//\r
92// Prototypes\r
93//\r
94EFI_STATUS\r
95GetPackSize (\r
96 IN VOID *Pack,\r
97 OUT UINTN *PackSize,\r
98 OUT UINT32 *NumberOfTokens\r
99 )\r
100;\r
101\r
102EFI_STATUS\r
103ValidatePack (\r
104 IN EFI_HII_PROTOCOL *This,\r
105 IN EFI_HII_PACKAGE_INSTANCE *PackageInstance,\r
106 OUT EFI_HII_PACKAGE_INSTANCE **StringPackageInstance,\r
107 OUT UINT32 *TotalStringCount\r
108 )\r
109;\r
110\r
111//\r
112// Public Interface Prototypes\r
113//\r
114EFI_STATUS\r
115EFIAPI\r
116InitializeHiiDatabase (\r
117 IN EFI_HANDLE ImageHandle,\r
118 IN EFI_SYSTEM_TABLE *SystemTable\r
119 )\r
120;\r
121\r
122EFI_STATUS\r
123EFIAPI\r
124HiiNewPack (\r
125 IN EFI_HII_PROTOCOL *This,\r
126 IN EFI_HII_PACKAGES *PackageList,\r
127 OUT EFI_HII_HANDLE *Handle\r
128 )\r
129;\r
130\r
131EFI_STATUS\r
132EFIAPI\r
133HiiRemovePack (\r
134 IN EFI_HII_PROTOCOL *This,\r
135 IN EFI_HII_HANDLE Handle\r
136 )\r
137;\r
138\r
139EFI_STATUS\r
140EFIAPI\r
141HiiFindHandles (\r
142 IN EFI_HII_PROTOCOL *This,\r
143 IN OUT UINT16 *HandleBufferLength,\r
144 OUT EFI_HII_HANDLE *Handle\r
145 )\r
146;\r
147\r
148EFI_STATUS\r
149EFIAPI\r
150HiiExportDatabase (\r
151 IN EFI_HII_PROTOCOL *This,\r
152 IN EFI_HII_HANDLE Handle,\r
153 IN OUT UINTN *BufferSize,\r
154 OUT VOID *Buffer\r
155 )\r
156;\r
157\r
158EFI_STATUS\r
159EFIAPI\r
160HiiGetGlyph (\r
161 IN EFI_HII_PROTOCOL *This,\r
162 IN CHAR16 *Source,\r
163 IN OUT UINT16 *Index,\r
164 OUT UINT8 **GlyphBuffer,\r
165 OUT UINT16 *BitWidth,\r
166 IN OUT UINT32 *InternalStatus\r
167 )\r
168;\r
169\r
170EFI_STATUS\r
171EFIAPI\r
172HiiGlyphToBlt (\r
173 IN EFI_HII_PROTOCOL *This,\r
174 IN UINT8 *GlyphBuffer,\r
175 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r
176 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r
177 IN UINTN Count,\r
178 IN UINTN Width,\r
179 IN UINTN Height,\r
180 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r
181 )\r
182;\r
183\r
184EFI_STATUS\r
185EFIAPI\r
186HiiNewString (\r
187 IN EFI_HII_PROTOCOL *This,\r
188 IN CHAR16 *Language,\r
189 IN EFI_HII_HANDLE Handle,\r
190 IN OUT STRING_REF *Reference,\r
191 IN CHAR16 *NewString\r
192 )\r
193;\r
194\r
195EFI_STATUS\r
196EFIAPI\r
197HiiGetString (\r
198 IN EFI_HII_PROTOCOL *This,\r
199 IN EFI_HII_HANDLE Handle,\r
200 IN STRING_REF Token,\r
201 IN BOOLEAN Raw,\r
202 IN CHAR16 *LanguageString,\r
203 IN OUT UINTN *BufferLength,\r
204 OUT EFI_STRING StringBuffer\r
205 )\r
206;\r
207\r
208EFI_STATUS\r
209EFIAPI\r
210HiiResetStrings (\r
211 IN EFI_HII_PROTOCOL *This,\r
212 IN EFI_HII_HANDLE Handle\r
213 )\r
214;\r
215\r
216EFI_STATUS\r
217EFIAPI\r
218HiiTestString (\r
219 IN EFI_HII_PROTOCOL *This,\r
220 IN CHAR16 *StringToTest,\r
221 IN OUT UINT32 *FirstMissing,\r
222 OUT UINT32 *GlyphBufferSize\r
223 )\r
224;\r
225\r
226EFI_STATUS\r
227EFIAPI\r
228HiiGetPrimaryLanguages (\r
229 IN EFI_HII_PROTOCOL *This,\r
230 IN EFI_HII_HANDLE Handle,\r
231 OUT EFI_STRING *LanguageString\r
232 )\r
233;\r
234\r
235EFI_STATUS\r
236EFIAPI\r
237HiiGetSecondaryLanguages (\r
238 IN EFI_HII_PROTOCOL *This,\r
239 IN EFI_HII_HANDLE Handle,\r
240 IN CHAR16 *PrimaryLanguage,\r
241 OUT EFI_STRING *LanguageString\r
242 )\r
243;\r
244\r
245EFI_STATUS\r
246EFIAPI\r
247HiiGetLine (\r
248 IN EFI_HII_PROTOCOL *This,\r
249 IN EFI_HII_HANDLE Handle,\r
250 IN STRING_REF Token,\r
251 IN OUT UINT16 *Index,\r
252 IN UINT16 LineWidth,\r
253 IN CHAR16 *LanguageString,\r
254 IN OUT UINT16 *BufferLength,\r
255 OUT EFI_STRING StringBuffer\r
256 )\r
257;\r
258\r
259EFI_STATUS\r
260EFIAPI\r
261HiiGetForms (\r
262 IN EFI_HII_PROTOCOL *This,\r
263 IN EFI_HII_HANDLE Handle,\r
264 IN EFI_FORM_ID FormId,\r
265 IN OUT UINTN *BufferLength,\r
266 OUT UINT8 *Buffer\r
267 )\r
268;\r
269\r
270EFI_STATUS\r
271EFIAPI\r
272HiiGetDefaultImage (\r
273 IN EFI_HII_PROTOCOL *This,\r
274 IN EFI_HII_HANDLE Handle,\r
275 IN UINTN DefaultMask,\r
276 OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
277 )\r
278;\r
279\r
280EFI_STATUS\r
281EFIAPI\r
282HiiUpdateForm (\r
283 IN EFI_HII_PROTOCOL *This,\r
284 IN EFI_HII_HANDLE Handle,\r
285 IN EFI_FORM_LABEL Label,\r
286 IN BOOLEAN AddData,\r
287 IN EFI_HII_UPDATE_DATA *Data\r
288 )\r
289;\r
290\r
291EFI_STATUS\r
292EFIAPI\r
293HiiGetKeyboardLayout (\r
294 IN EFI_HII_PROTOCOL *This,\r
295 OUT UINT16 *DescriptorCount,\r
296 OUT EFI_KEY_DESCRIPTOR *Descriptor\r
297 )\r
298;\r
299\r
300EFI_STATUS\r
301HiiCompareLanguage (\r
302 IN CHAR16 *LanguageStringLocation,\r
303 IN CHAR16 *Language\r
304 )\r
305;\r
306\r
307#endif\r