]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h
EdkCompatibilityPkg: Fix typos in comments
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / HiiDatabase / HiiDatabase.h
CommitLineData
2c40a813 1/*++\r
2\r
3e99020d 3Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
f57387d5 4This program and the accompanying materials \r
2c40a813 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 EFI_HII_DATABASE_PROTOCOL from UEFI 2.1 specification.\r
19 \r
20 This protocol is a database manager for HII related data structures.\r
21\r
22Revision History\r
23\r
24--*/\r
25\r
26#ifndef __EFI_HII_DATABASE_PROTOCOL_H__\r
27#define __EFI_HII_DATABASE_PROTOCOL_H__\r
28\r
29#include "EfiHii.h"\r
30\r
31//\r
32// Global ID for the Hii Database Protocol.\r
33//\r
34\r
35#define EFI_HII_DATABASE_PROTOCOL_GUID \\r
36 { \\r
7ccf38a3 37 0xef9fc172, 0xa1b2, 0x4693, {0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42} \\r
2c40a813 38 }\r
39\r
40#define EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID \\r
41 { \\r
7ccf38a3 42 0x14982a4f, 0xb0ed, 0x45b8, {0xa8, 0x11, 0x5a, 0x7a, 0x9b, 0xc2, 0x32, 0xdf} \\r
2c40a813 43 }\r
44\r
45EFI_FORWARD_DECLARATION (EFI_HII_DATABASE_PROTOCOL);\r
46 \r
47typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE;\r
48\r
49#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001\r
50#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002\r
51#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004\r
52#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008\r
53\r
54typedef\r
55EFI_STATUS\r
56(EFIAPI *EFI_HII_DATABASE_NOTIFY) (\r
57 IN UINT8 PackageType,\r
58 IN CONST EFI_GUID *PackageGuid,\r
59 IN CONST EFI_HII_PACKAGE_HEADER *Package,\r
60 IN EFI_HII_HANDLE Handle,\r
61 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType\r
62 )\r
63/*++\r
64\r
65 Routine Description:\r
66 Functions which are registered to receive notification of database events have this prototype. The\r
67 actual event is encoded in NotifyType. The following table describes how PackageType, \r
68 PackageGuid, Handle, and Package are used for each of the notification types. \r
69 \r
70 Arguments: \r
71 PackageType - Package type of the notification.\r
72 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to \r
73 the GUID which must match the Guid field of \r
74 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL. \r
75 Package - Points to the package referred to by the notification. \r
76 Handle - The handle of the package list which contains the specified package.\r
77 NotifyType - The type of change concerning the database.\r
78 \r
79 Returns:\r
80 EFI status code.\r
81 \r
82--*/ \r
83;\r
84\r
85//\r
86// EFI_HII_DATABASE_PROTOCOL protocol prototypes\r
87//\r
88\r
89typedef\r
90EFI_STATUS\r
91(EFIAPI *EFI_HII_DATABASE_NEW_PACK) (\r
92 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
93 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r
94 IN CONST EFI_HANDLE DriverHandle,\r
95 OUT EFI_HII_HANDLE *Handle\r
96 )\r
97/*++\r
98\r
99 Routine Description:\r
100 This function adds the packages in the package list to the database and returns a handle. If there is a\r
101 EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will \r
102 create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list. \r
103 \r
104 Arguments: \r
105 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
106 PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure.\r
107 DriverHandle - Associate the package list with this EFI handle. \r
108 Handle - A pointer to the EFI_HII_HANDLE instance.\r
109 \r
110 Returns:\r
111 EFI_SUCCESS - The package list associated with the Handle\r
112 was added to the HII database. \r
113 EFI_OUT_OF_RESOURCES - Unable to allocate necessary resources for the\r
114 new database contents. \r
115 EFI_INVALID_PARAMETER - PackageList is NULL or Handle is NULL.\r
116 \r
117--*/ \r
118;\r
119\r
120typedef\r
121EFI_STATUS\r
122(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK) (\r
123 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
124 IN EFI_HII_HANDLE Handle\r
125 )\r
126/*++\r
127\r
128 Routine Description:\r
129 This function removes the package list that is associated with a handle Handle \r
130 from the HII database. Before removing the package, any registered functions \r
131 with the notification type REMOVE_PACK and the same package type will be called.\r
132 \r
133 Arguments: \r
134 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
135 Handle - The handle that was registered to the data that is requested \r
136 for removal.\r
137 \r
138 Returns:\r
139 EFI_SUCCESS - The data associated with the Handle was removed from \r
140 the HII database.\r
3e99020d 141 EFI_NOT_FOUND - The specified Handle is not in database.\r
2c40a813 142 \r
143--*/\r
144;\r
145\r
146typedef\r
147EFI_STATUS\r
148(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) (\r
149 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
150 IN EFI_HII_HANDLE Handle,\r
151 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList\r
152 )\r
153/*++\r
154\r
155 Routine Description:\r
156 This function updates the existing package list (which has the specified Handle) \r
157 in the HII databases, using the new package list specified by PackageList.\r
158 \r
159 Arguments: \r
160 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
161 Handle - The handle that was registered to the data that is \r
162 requested to be updated.\r
163 PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER package.\r
164 \r
165 Returns:\r
166 EFI_SUCCESS - The HII database was successfully updated.\r
167 EFI_OUT_OF_RESOURCES - Unable to allocate enough memory for the updated database.\r
3e99020d
LG
168 EFI_INVALID_PARAMETER - PackageList was NULL.\r
169 EFI_NOT_FOUND - The specified Handle is not in database.\r
2c40a813 170 \r
171--*/\r
172;\r
173\r
174typedef\r
175EFI_STATUS\r
176(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) (\r
177 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
178 IN UINT8 PackageType,\r
179 IN CONST EFI_GUID *PackageGuid,\r
180 IN OUT UINTN *HandleBufferLength,\r
181 OUT EFI_HII_HANDLE *Handle\r
182 )\r
183/*++\r
184\r
185 Routine Description:\r
186 This function returns a list of the package handles of the specified type \r
187 that are currently active in the database. The pseudo-type \r
188 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.\r
189 \r
190 Arguments: \r
191 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
192 PackageType - Specifies the package type of the packages to list or\r
193 EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed.\r
194 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this \r
195 is the pointer to the GUID which must match the Guid\r
196 field of EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, \r
197 it must be NULL. \r
198 HandleBufferLength - On input, a pointer to the length of the handle buffer. \r
199 On output, the length of the handle buffer that is\r
200 required for the handles found.\r
201 Handle - An array of EFI_HII_HANDLE instances returned.\r
202 \r
203 Returns:\r
4fc0be87 204 EFI_SUCCESS - The matching handles are outputted successfully.\r
3e99020d 205 HandleBufferLength is updated with the actual length.\r
2c40a813 206 EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that\r
207 Handle is too small to support the number of handles.\r
208 HandleBufferLength is updated with a value that will \r
209 enable the data to fit.\r
210 EFI_NOT_FOUND - No matching handle could not be found in database.\r
211 EFI_INVALID_PARAMETER - Handle or HandleBufferLength was NULL.\r
3e99020d
LG
212 EFI_INVALID_PARAMETER - PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
213 PackageGuid is not NULL, PackageType is a EFI_HII_\r
214 PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
2c40a813 215 \r
216--*/ \r
217;\r
218\r
219typedef\r
220EFI_STATUS\r
221(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) (\r
222 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
223 IN EFI_HII_HANDLE Handle,\r
224 IN OUT UINTN *BufferSize,\r
225 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer\r
226 )\r
227/*++\r
228\r
229 Routine Description:\r
230 This function will export one or all package lists in the database to a buffer. \r
231 For each package list exported, this function will call functions registered \r
232 with EXPORT_PACK and then copy the package list to the buffer. \r
233 \r
234 Arguments: \r
235 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
236 Handle - An EFI_HII_HANDLE that corresponds to the desired package\r
237 list in the HII database to export or NULL to indicate \r
238 all package lists should be exported.\r
239 BufferSize - On input, a pointer to the length of the buffer. \r
240 On output, the length of the buffer that is required for\r
241 the exported data.\r
242 Buffer - A pointer to a buffer that will contain the results of \r
243 the export function.\r
244 \r
245 Returns:\r
246 EFI_SUCCESS - Package exported.\r
247 EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that Handle\r
248 is too small to support the number of handles. \r
249 HandleBufferLength is updated with a value that will\r
250 enable the data to fit.\r
4fc0be87 251 EFI_NOT_FOUND - The specified Handle could not be found in the current\r
2c40a813 252 database.\r
253 EFI_INVALID_PARAMETER - Handle or Buffer or BufferSize was NULL.\r
254 \r
255--*/\r
256;\r
257\r
258typedef\r
259EFI_STATUS\r
260(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) (\r
261 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
262 IN UINT8 PackageType,\r
263 IN CONST EFI_GUID *PackageGuid,\r
264 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,\r
265 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
266 OUT EFI_HANDLE *NotifyHandle\r
267 )\r
268/*++\r
269\r
270 Routine Description:\r
271 This function registers a function which will be called when specified actions related to packages of\r
272 the specified type occur in the HII database. By registering a function, other HII-related drivers are\r
273 notified when specific package types are added, removed or updated in the HII database.\r
274 Each driver or application which registers a notification should use\r
275 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting. \r
276 \r
277 Arguments: \r
278 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
279 PackageType - Specifies the package type of the packages to list or\r
280 EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed. \r
281 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to\r
282 the GUID which must match the Guid field of \r
283 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL. \r
284 PackageNotifyFn - Points to the function to be called when the event specified by \r
285 NotificationType occurs.\r
286 NotifyType - Describes the types of notification which this function will be receiving. \r
287 NotifyHandle - Points to the unique handle assigned to the registered notification. Can be used in\r
288 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() to stop notifications. \r
289 \r
290 Returns:\r
291 EFI_SUCCESS - Notification registered successfully. \r
292 EFI_OUT_OF_RESOURCES - Unable to allocate necessary data structures \r
293 EFI_INVALID_PARAMETER - NotifyHandle is NULL.\r
294 EFI_INVALID_PARAMETER - PackageGuid is not NULL when PackageType is not\r
295 EFI_HII_PACKAGE_TYPE_GUID. \r
296 EFI_INVALID_PARAMETER - PackageGuid is NULL when PackageType is EFI_HII_PACKAGE_TYPE_GUID.\r
297 \r
298--*/ \r
299;\r
300\r
301typedef\r
302EFI_STATUS\r
303(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) (\r
304 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
305 IN EFI_HANDLE NotificationHandle\r
306 )\r
307/*++\r
308\r
309 Routine Description:\r
310 Removes the specified HII database package-related notification.\r
311 \r
312 Arguments: \r
313 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
314 NotifyHandle - The handle of the notification function being unregistered. \r
315 \r
316 Returns:\r
317 EFI_SUCCESS - Notification is unregistered successfully. \r
3e99020d
LG
318 EFI_NOT_FOUND - The incoming notification handle does not exist \r
319 in current hii database.\r
2c40a813 320 \r
321--*/ \r
322; \r
323\r
324typedef\r
325EFI_STATUS\r
326(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS) (\r
327 IN EFI_HII_DATABASE_PROTOCOL *This,\r
328 IN OUT UINT16 *KeyGuidBufferLength,\r
329 OUT EFI_GUID *KeyGuidBuffer\r
330 )\r
331/*++\r
332\r
333 Routine Description:\r
334 This routine retrieves an array of GUID values for each keyboard layout that\r
335 was previously registered in the system.\r
336 \r
337 Arguments: \r
338 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
339 KeyGuidBufferLength - On input, a pointer to the length of the keyboard GUID \r
340 buffer. On output, the length of the handle buffer \r
341 that is required for the handles found.\r
342 KeyGuidBuffer - An array of keyboard layout GUID instances returned.\r
343 \r
344 Returns:\r
345 EFI_SUCCESS - KeyGuidBuffer was updated successfully.\r
346 EFI_BUFFER_TOO_SMALL - The KeyGuidBufferLength parameter indicates \r
347 that KeyGuidBuffer is too small to support the\r
348 number of GUIDs. KeyGuidBufferLength is \r
349 updated with a value that will enable the data to fit.\r
350 EFI_INVALID_PARAMETER - The KeyGuidBuffer or KeyGuidBufferLength was NULL.\r
351 EFI_NOT_FOUND - There was no keyboard layout.\r
352\r
353--*/ \r
354;\r
355\r
356typedef\r
357EFI_STATUS\r
358(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
359 IN EFI_HII_DATABASE_PROTOCOL *This,\r
360 IN EFI_GUID *KeyGuid,\r
361 IN OUT UINT16 *KeyboardLayoutLength,\r
362 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout\r
363 )\r
364/*++\r
365\r
366 Routine Description:\r
367 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r
368 on a keyboard and the character(s) that are associated with a particular set of key strokes. \r
369 \r
370 Arguments: \r
371 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
372 KeyGuid - A pointer to the unique ID associated with a given keyboard layout. If KeyGuid is\r
373 NULL then the current layout will be retrieved. \r
374 KeyboardLayoutLength - On input, a pointer to the length of the KeyboardLayout buffer. \r
375 On output, the length of the data placed into KeyboardLayout. \r
376 KeyboardLayout - A pointer to a buffer containing the retrieved keyboard layout. \r
377 \r
378 Returns:\r
379 EFI_SUCCESS - The keyboard layout was retrieved successfully.\r
380 EFI_NOT_FOUND - The requested keyboard layout was not found.\r
381 EFI_INVALID_PARAMETER - The KeyboardLayout or KeyboardLayoutLength was NULL.\r
382 \r
383--*/ \r
384;\r
385\r
386typedef\r
387EFI_STATUS\r
388(EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT) (\r
389 IN EFI_HII_DATABASE_PROTOCOL *This,\r
390 IN EFI_GUID *KeyGuid\r
391 )\r
392/*++\r
393\r
394 Routine Description:\r
395 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine \r
396 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID \r
397 group type. This is so that agents which are sensitive to the current keyboard layout being changed\r
398 can be notified of this change. \r
399 \r
400 Arguments: \r
401 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
402 KeyGuid - A pointer to the unique ID associated with a given keyboard layout. \r
403 \r
404 Returns:\r
405 EFI_SUCCESS - The current keyboard layout was successfully set.\r
406 EFI_NOT_FOUND - The referenced keyboard layout was not found, so action was taken. \r
407 EFI_INVALID_PARAMETER - The KeyGuid was NULL.\r
408 \r
409--*/ \r
410;\r
411\r
412typedef\r
413EFI_STATUS\r
414(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) (\r
415 IN EFI_HII_DATABASE_PROTOCOL *This,\r
416 IN EFI_HII_HANDLE PackageListHandle,\r
417 OUT EFI_HANDLE *DriverHandle\r
418 )\r
419/*++\r
420\r
421 Routine Description:\r
422 Return the EFI handle associated with a package list.\r
423 \r
424 Arguments: \r
425 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
426 PackageListHandle - An EFI_HII_HANDLE that corresponds to the desired package list in the\r
427 HIIdatabase. \r
428 DriverHandle - On return, contains the EFI_HANDLE which was registered with the package list in\r
429 NewPackageList(). \r
430 \r
431 Returns:\r
432 EFI_SUCCESS - The DriverHandle was returned successfully. \r
433 EFI_INVALID_PARAMETER - The PackageListHandle was not valid or DriverHandle was NULL.\r
434 \r
435--*/ \r
436;\r
437\r
e5bce275 438struct _EFI_HII_DATABASE_PROTOCOL {\r
2c40a813 439 EFI_HII_DATABASE_NEW_PACK NewPackageList;\r
440 EFI_HII_DATABASE_REMOVE_PACK RemovePackageList;\r
441 EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList;\r
442 EFI_HII_DATABASE_LIST_PACKS ListPackageLists;\r
443 EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists;\r
444 EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify;\r
445 EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify;\r
446 EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts;\r
447 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
448 EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout;\r
449 EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle;\r
e5bce275 450};\r
2c40a813 451\r
452extern EFI_GUID gEfiHiiDatabaseProtocolGuid;\r
453\r
454#endif\r