]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / HiiDatabase / HiiDatabase.h
CommitLineData
2c40a813 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
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
141 EFI_NOT_FOUND - The specified PackageList could not be found in database.\r
142 EFI_INVALID_PARAMETER - The Handle was not valid.\r
143 \r
144--*/\r
145;\r
146\r
147typedef\r
148EFI_STATUS\r
149(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) (\r
150 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
151 IN EFI_HII_HANDLE Handle,\r
152 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList\r
153 )\r
154/*++\r
155\r
156 Routine Description:\r
157 This function updates the existing package list (which has the specified Handle) \r
158 in the HII databases, using the new package list specified by PackageList.\r
159 \r
160 Arguments: \r
161 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
162 Handle - The handle that was registered to the data that is \r
163 requested to be updated.\r
164 PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER package.\r
165 \r
166 Returns:\r
167 EFI_SUCCESS - The HII database was successfully updated.\r
168 EFI_OUT_OF_RESOURCES - Unable to allocate enough memory for the updated database.\r
169 EFI_INVALID_PARAMETER - Handle or PackageList was NULL.\r
170 EFI_NOT_FOUND - The Handle was not valid or could not be found in database.\r
171 \r
172--*/\r
173;\r
174\r
175typedef\r
176EFI_STATUS\r
177(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) (\r
178 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
179 IN UINT8 PackageType,\r
180 IN CONST EFI_GUID *PackageGuid,\r
181 IN OUT UINTN *HandleBufferLength,\r
182 OUT EFI_HII_HANDLE *Handle\r
183 )\r
184/*++\r
185\r
186 Routine Description:\r
187 This function returns a list of the package handles of the specified type \r
188 that are currently active in the database. The pseudo-type \r
189 EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed.\r
190 \r
191 Arguments: \r
192 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
193 PackageType - Specifies the package type of the packages to list or\r
194 EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed.\r
195 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this \r
196 is the pointer to the GUID which must match the Guid\r
197 field of EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, \r
198 it must be NULL. \r
199 HandleBufferLength - On input, a pointer to the length of the handle buffer. \r
200 On output, the length of the handle buffer that is\r
201 required for the handles found.\r
202 Handle - An array of EFI_HII_HANDLE instances returned.\r
203 \r
204 Returns:\r
205 EFI_SUCCESS - The matching handles are outputed successfully.\r
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
212 \r
213--*/ \r
214;\r
215\r
216typedef\r
217EFI_STATUS\r
218(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) (\r
219 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
220 IN EFI_HII_HANDLE Handle,\r
221 IN OUT UINTN *BufferSize,\r
222 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer\r
223 )\r
224/*++\r
225\r
226 Routine Description:\r
227 This function will export one or all package lists in the database to a buffer. \r
228 For each package list exported, this function will call functions registered \r
229 with EXPORT_PACK and then copy the package list to the buffer. \r
230 \r
231 Arguments: \r
232 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
233 Handle - An EFI_HII_HANDLE that corresponds to the desired package\r
234 list in the HII database to export or NULL to indicate \r
235 all package lists should be exported.\r
236 BufferSize - On input, a pointer to the length of the buffer. \r
237 On output, the length of the buffer that is required for\r
238 the exported data.\r
239 Buffer - A pointer to a buffer that will contain the results of \r
240 the export function.\r
241 \r
242 Returns:\r
243 EFI_SUCCESS - Package exported.\r
244 EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that Handle\r
245 is too small to support the number of handles. \r
246 HandleBufferLength is updated with a value that will\r
247 enable the data to fit.\r
248 EFI_NOT_FOUND - The specifiecd Handle could not be found in the current\r
249 database.\r
250 EFI_INVALID_PARAMETER - Handle or Buffer or BufferSize was NULL.\r
251 \r
252--*/\r
253;\r
254\r
255typedef\r
256EFI_STATUS\r
257(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) (\r
258 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
259 IN UINT8 PackageType,\r
260 IN CONST EFI_GUID *PackageGuid,\r
261 IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,\r
262 IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
263 OUT EFI_HANDLE *NotifyHandle\r
264 )\r
265/*++\r
266\r
267 Routine Description:\r
268 This function registers a function which will be called when specified actions related to packages of\r
269 the specified type occur in the HII database. By registering a function, other HII-related drivers are\r
270 notified when specific package types are added, removed or updated in the HII database.\r
271 Each driver or application which registers a notification should use\r
272 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting. \r
273 \r
274 Arguments: \r
275 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
276 PackageType - Specifies the package type of the packages to list or\r
277 EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed. \r
278 PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to\r
279 the GUID which must match the Guid field of \r
280 EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL. \r
281 PackageNotifyFn - Points to the function to be called when the event specified by \r
282 NotificationType occurs.\r
283 NotifyType - Describes the types of notification which this function will be receiving. \r
284 NotifyHandle - Points to the unique handle assigned to the registered notification. Can be used in\r
285 EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() to stop notifications. \r
286 \r
287 Returns:\r
288 EFI_SUCCESS - Notification registered successfully. \r
289 EFI_OUT_OF_RESOURCES - Unable to allocate necessary data structures \r
290 EFI_INVALID_PARAMETER - NotifyHandle is NULL.\r
291 EFI_INVALID_PARAMETER - PackageGuid is not NULL when PackageType is not\r
292 EFI_HII_PACKAGE_TYPE_GUID. \r
293 EFI_INVALID_PARAMETER - PackageGuid is NULL when PackageType is EFI_HII_PACKAGE_TYPE_GUID.\r
294 \r
295--*/ \r
296;\r
297\r
298typedef\r
299EFI_STATUS\r
300(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) (\r
301 IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
302 IN EFI_HANDLE NotificationHandle\r
303 )\r
304/*++\r
305\r
306 Routine Description:\r
307 Removes the specified HII database package-related notification.\r
308 \r
309 Arguments: \r
310 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
311 NotifyHandle - The handle of the notification function being unregistered. \r
312 \r
313 Returns:\r
314 EFI_SUCCESS - Notification is unregistered successfully. \r
315 EFI_INVALID_PARAMETER - The Handle is invalid.\r
316 \r
317--*/ \r
318; \r
319\r
320typedef\r
321EFI_STATUS\r
322(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS) (\r
323 IN EFI_HII_DATABASE_PROTOCOL *This,\r
324 IN OUT UINT16 *KeyGuidBufferLength,\r
325 OUT EFI_GUID *KeyGuidBuffer\r
326 )\r
327/*++\r
328\r
329 Routine Description:\r
330 This routine retrieves an array of GUID values for each keyboard layout that\r
331 was previously registered in the system.\r
332 \r
333 Arguments: \r
334 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
335 KeyGuidBufferLength - On input, a pointer to the length of the keyboard GUID \r
336 buffer. On output, the length of the handle buffer \r
337 that is required for the handles found.\r
338 KeyGuidBuffer - An array of keyboard layout GUID instances returned.\r
339 \r
340 Returns:\r
341 EFI_SUCCESS - KeyGuidBuffer was updated successfully.\r
342 EFI_BUFFER_TOO_SMALL - The KeyGuidBufferLength parameter indicates \r
343 that KeyGuidBuffer is too small to support the\r
344 number of GUIDs. KeyGuidBufferLength is \r
345 updated with a value that will enable the data to fit.\r
346 EFI_INVALID_PARAMETER - The KeyGuidBuffer or KeyGuidBufferLength was NULL.\r
347 EFI_NOT_FOUND - There was no keyboard layout.\r
348\r
349--*/ \r
350;\r
351\r
352typedef\r
353EFI_STATUS\r
354(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
355 IN EFI_HII_DATABASE_PROTOCOL *This,\r
356 IN EFI_GUID *KeyGuid,\r
357 IN OUT UINT16 *KeyboardLayoutLength,\r
358 OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout\r
359 )\r
360/*++\r
361\r
362 Routine Description:\r
363 This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r
364 on a keyboard and the character(s) that are associated with a particular set of key strokes. \r
365 \r
366 Arguments: \r
367 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
368 KeyGuid - A pointer to the unique ID associated with a given keyboard layout. If KeyGuid is\r
369 NULL then the current layout will be retrieved. \r
370 KeyboardLayoutLength - On input, a pointer to the length of the KeyboardLayout buffer. \r
371 On output, the length of the data placed into KeyboardLayout. \r
372 KeyboardLayout - A pointer to a buffer containing the retrieved keyboard layout. \r
373 \r
374 Returns:\r
375 EFI_SUCCESS - The keyboard layout was retrieved successfully.\r
376 EFI_NOT_FOUND - The requested keyboard layout was not found.\r
377 EFI_INVALID_PARAMETER - The KeyboardLayout or KeyboardLayoutLength was NULL.\r
378 \r
379--*/ \r
380;\r
381\r
382typedef\r
383EFI_STATUS\r
384(EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT) (\r
385 IN EFI_HII_DATABASE_PROTOCOL *This,\r
386 IN EFI_GUID *KeyGuid\r
387 )\r
388/*++\r
389\r
390 Routine Description:\r
391 This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine \r
392 is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID \r
393 group type. This is so that agents which are sensitive to the current keyboard layout being changed\r
394 can be notified of this change. \r
395 \r
396 Arguments: \r
397 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
398 KeyGuid - A pointer to the unique ID associated with a given keyboard layout. \r
399 \r
400 Returns:\r
401 EFI_SUCCESS - The current keyboard layout was successfully set.\r
402 EFI_NOT_FOUND - The referenced keyboard layout was not found, so action was taken. \r
403 EFI_INVALID_PARAMETER - The KeyGuid was NULL.\r
404 \r
405--*/ \r
406;\r
407\r
408typedef\r
409EFI_STATUS\r
410(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) (\r
411 IN EFI_HII_DATABASE_PROTOCOL *This,\r
412 IN EFI_HII_HANDLE PackageListHandle,\r
413 OUT EFI_HANDLE *DriverHandle\r
414 )\r
415/*++\r
416\r
417 Routine Description:\r
418 Return the EFI handle associated with a package list.\r
419 \r
420 Arguments: \r
421 This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. \r
422 PackageListHandle - An EFI_HII_HANDLE that corresponds to the desired package list in the\r
423 HIIdatabase. \r
424 DriverHandle - On return, contains the EFI_HANDLE which was registered with the package list in\r
425 NewPackageList(). \r
426 \r
427 Returns:\r
428 EFI_SUCCESS - The DriverHandle was returned successfully. \r
429 EFI_INVALID_PARAMETER - The PackageListHandle was not valid or DriverHandle was NULL.\r
430 \r
431--*/ \r
432;\r
433\r
e5bce275 434struct _EFI_HII_DATABASE_PROTOCOL {\r
2c40a813 435 EFI_HII_DATABASE_NEW_PACK NewPackageList;\r
436 EFI_HII_DATABASE_REMOVE_PACK RemovePackageList;\r
437 EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList;\r
438 EFI_HII_DATABASE_LIST_PACKS ListPackageLists;\r
439 EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists;\r
440 EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify;\r
441 EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify;\r
442 EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts;\r
443 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
444 EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout;\r
445 EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle;\r
e5bce275 446};\r
2c40a813 447\r
448extern EFI_GUID gEfiHiiDatabaseProtocolGuid;\r
449\r
450#endif\r