]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/HiiLib.h
dc557af31b5a58415e670d2ca29a735efe5dcb68
[mirror_edk2.git] / MdePkg / Include / Library / HiiLib.h
1 /** @file
2 Public include file for the HII Library
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __HII_LIB_H__
16 #define __HII_LIB_H__
17
18 //#include <PiDxe.h>
19
20 //
21 // Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
22 // (42 characters plus a NULL terminator)
23 //
24 #define RFC_3066_ENTRY_SIZE (42 + 1)
25
26 /**
27 This function allocates pool for an EFI_HII_PACKAGE_LIST structure
28 with additional space that is big enough to host all packages described by the variable
29 argument list of package pointers. The allocated structure is initialized using NumberOfPackages,
30 GuidId, and the variable length argument list of package pointers.
31
32 Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The
33 Handle to the newly registered Package List is returned throught HiiHandle.
34
35 @param NumberOfPackages The number of HII packages to register.
36 @param GuidId Package List GUID ID.
37 @param HiiHandle The ID used to retrieve the Package List later.
38 @param ... The variable argument list describing all HII Package.
39
40 @return
41 The allocated and initialized packages.
42
43 **/
44
45 EFI_STATUS
46 EFIAPI
47 HiiLibAddPackagesToHiiDatabase (
48 IN UINTN NumberOfPackages,
49 IN CONST EFI_GUID *GuidId,
50 IN EFI_HANDLE DriverHandle, OPTIONAL
51 OUT EFI_HII_HANDLE *HiiHandle, OPTIONAL
52 ...
53 )
54 ;
55
56 EFI_STATUS
57 EFIAPI
58 HiiLibAddFontPackageToHiiDatabase (
59 IN UINTN FontSize,
60 IN CONST UINT8 *FontBinary,
61 IN CONST EFI_GUID *GuidId,
62 OUT EFI_HII_HANDLE *HiiHandle OPTIONAL
63 )
64 ;
65
66 EFI_STATUS
67 EFIAPI
68 HiiLibRemovePackagesFromHiiDatabase (
69 IN EFI_HII_HANDLE HiiHandle
70 )
71 ;
72
73 /**
74 This function adds the string into String Package of each language.
75
76 @param PackageList Handle of the package list where this string will
77 be added.
78 @param StringId On return, contains the new strings id, which is
79 unique within PackageList.
80 @param String Points to the new null-terminated string.
81
82 @retval EFI_SUCCESS The new string was added successfully.
83 @retval EFI_NOT_FOUND The specified PackageList could not be found in
84 database.
85 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
86 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL.
87
88 **/
89 EFI_STATUS
90 EFIAPI
91 HiiLibCreateString (
92 IN EFI_HII_HANDLE PackageList,
93 OUT EFI_STRING_ID *StringId,
94 IN CONST EFI_STRING String
95 )
96 ;
97
98 /**
99 This function update the specified string in String Package of each language.
100
101 @param PackageList Handle of the package list where this string will
102 be added.
103 @param StringId Ths String Id to be updated.
104 @param String Points to the new null-terminated string.
105
106 @retval EFI_SUCCESS The new string was added successfully.
107 @retval EFI_NOT_FOUND The specified PackageList could not be found in
108 database.
109 @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources.
110 @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL.
111
112 **/
113 EFI_STATUS
114 EFIAPI
115 HiiLibUpdateString (
116 IN EFI_HII_HANDLE PackageList,
117 IN EFI_STRING_ID StringId,
118 IN CONST EFI_STRING String
119 )
120 ;
121
122
123
124 //
125 // Just use the UEFI prototype
126 //
127 EFI_STATUS
128 EFIAPI
129 HiiLibGetStringFromGuidId (
130 IN EFI_GUID *ProducerGuid,
131 IN EFI_STRING_ID StringId,
132 OUT EFI_STRING *String
133 )
134 ;
135
136 //
137 // This function is Implementation Specifc. HII_VENDOR_DEVICE_PATH
138 // This should be moved to MdeModulepkg.
139 //
140 EFI_STATUS
141 EFIAPI
142 HiiLibCreateHiiDriverHandle (
143 OUT EFI_HANDLE *DriverHandle
144 )
145 ;
146
147 EFI_STATUS
148 EFIAPI
149 HiiLibDestroyHiiDriverHandle (
150 IN EFI_HANDLE DriverHandle
151 )
152 ;
153
154
155 EFI_STATUS
156 HiiLibExtractClassFromHiiHandle (
157 IN EFI_HII_HANDLE Handle,
158 OUT UINT16 *Class,
159 OUT EFI_STRING_ID *FormSetTitle,
160 OUT EFI_STRING_ID *FormSetHelp
161 )
162 /*++
163
164 Routine Description:
165 Extract formset class for given HII handle.
166
167 Arguments:
168 HiiHandle - Hii handle
169 Class - Class of the formset
170 FormSetTitle - Formset title string
171 FormSetHelp - Formset help string
172
173 Returns:
174 EFI_SUCCESS - Successfully extract Class for specified Hii handle.
175
176 --*/
177 ;
178
179 #endif