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