]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / HiiString / HiiString.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 HiiString.h\r
15 \r
16Abstract:\r
17\r
18 EFI_HII_STRING_PROTOCOL from UEFI 2.1 specification.\r
19 \r
20 This protocol provides interfaces to manipulate string data.\r
21\r
22Revision History\r
23\r
24--*/\r
25\r
26#ifndef __EFI_HII_STRING_PROTOCOL_H__\r
27#define __EFI_HII_STRING_PROTOCOL_H__\r
28\r
29#include EFI_PROTOCOL_DEFINITION (HiiFont)\r
30\r
31//\r
32// Global ID for the Hii String Protocol.\r
33//\r
34#define EFI_HII_STRING_PROTOCOL_GUID \\r
35 { \\r
7ccf38a3 36 0xfd96974, 0x23aa, 0x4cdc, {0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a} \\r
2c40a813 37 }\r
38\r
39EFI_FORWARD_DECLARATION (EFI_HII_STRING_PROTOCOL);\r
40\r
41typedef\r
42EFI_STATUS\r
43(EFIAPI *EFI_HII_NEW_STRING) (\r
44 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
45 IN EFI_HII_HANDLE PackageList,\r
46 OUT EFI_STRING_ID *StringId,\r
47 IN CONST CHAR8 *Language,\r
48 IN CONST CHAR16 *LanguageName, OPTIONAL \r
49 IN CONST EFI_STRING String,\r
50 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
51 )\r
52/*++\r
53\r
54 Routine Description:\r
55 This function adds the string String to the group of strings owned by PackageList, with the\r
56 specified font information StringFontInfo and returns a new string id. \r
3e99020d
LG
57 The new string identifier is guaranteed to be unique within the package list. \r
58 That new string identifier is reserved for all languages in the package list. \r
2c40a813 59 \r
60 Arguments: \r
61 This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
62 PackageList - Handle of the package list where this string will be added. \r
63 StringId - On return, contains the new strings id, which is unique within PackageList. \r
64 Language - Points to the language for the new string.\r
65 LanguageName - Points to the printable language name to associate with the passed in \r
66 Language field.If LanguageName is not NULL and the string package header's LanguageName \r
67 associated with a given Language is not zero, the LanguageName being passed \r
68 in will be ignored. \r
69 String - Points to the new null-terminated string. \r
fd0d281b 70 StringFontInfo - Points to the new string's font information or NULL if the string should have the\r
2c40a813 71 default system font, size and style. \r
72\r
73 Returns:\r
74 EFI_SUCCESS - The new string was added successfully.\r
75 EFI_NOT_FOUND - The specified PackageList could not be found in database.\r
76 EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.\r
77 EFI_INVALID_PARAMETER - String is NULL or StringId is NULL or Language is NULL. \r
78 \r
79--*/ \r
80;\r
81\r
82typedef\r
83EFI_STATUS\r
84(EFIAPI *EFI_HII_GET_STRING) (\r
85 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
86 IN CONST CHAR8 *Language,\r
87 IN EFI_HII_HANDLE PackageList,\r
88 IN EFI_STRING_ID StringId,\r
89 OUT EFI_STRING String,\r
90 IN OUT UINTN *StringSize,\r
91 OUT EFI_FONT_INFO **StringFontInfo OPTIONAL\r
92 )\r
93/*++\r
94\r
95 Routine Description:\r
96 This function retrieves the string specified by StringId which is associated \r
97 with the specified PackageList in the language Language and copies it into \r
98 the buffer specified by String.\r
99 \r
100 Arguments: \r
101 This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
102 Language - Points to the language for the retrieved string.\r
103 PackageList - The package list in the HII database to search for the \r
104 specified string. \r
105 StringId - The string's id, which is unique within PackageList. \r
106 String - Points to the new null-terminated string. \r
107 StringSize - On entry, points to the size of the buffer pointed to by \r
108 String, in bytes. On return,\r
3e99020d
LG
109 points to the length of the string, in bytes.\r
110 StringFontInfo - Points to a buffer that will be callee allocated and will \r
111 have the string's font information into this buffer. \r
112 The caller is responsible for freeing this buffer. \r
113 If the parameter is NULL a buffer will not be allocated \r
114 and the string font information will not be returned.\r
2c40a813 115\r
116 Returns:\r
117 EFI_SUCCESS - The string was returned successfully.\r
118 EFI_NOT_FOUND - The string specified by StringId is not available.\r
3e99020d
LG
119 The specified PackageList is not in the database.\r
120 EFI_INVALID_LANGUAGE - The string specified by StringId is available but\r
121 not in the specified language. \r
2c40a813 122 EFI_BUFFER_TOO_SMALL - The buffer specified by StringSize is too small to \r
123 hold the string. \r
124 EFI_INVALID_PARAMETER - The String or Language or StringSize was NULL.\r
125 EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the \r
126 request.\r
127 \r
128--*/ \r
129;\r
130\r
131typedef\r
132EFI_STATUS\r
133(EFIAPI *EFI_HII_SET_STRING) (\r
134 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
135 IN EFI_HII_HANDLE PackageList,\r
136 IN EFI_STRING_ID StringId,\r
137 IN CONST CHAR8 *Language,\r
138 IN CONST EFI_STRING String,\r
139 IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
140 )\r
141/*++\r
142\r
143 Routine Description:\r
144 This function updates the string specified by StringId in the specified PackageList to the text \r
145 specified by String and, optionally, the font information specified by StringFontInfo. \r
146 \r
147 Arguments: \r
148 This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
149 PackageList - The package list containing the strings.\r
fd0d281b 150 StringId - The string's id, which is unique within PackageList. \r
2c40a813 151 Language - Points to the language for the updated string.\r
152 String - Points to the new null-terminated string. \r
fd0d281b 153 StringFontInfo - Points to the string's font information or NULL if the string font information is not\r
2c40a813 154 changed. \r
155\r
156 Returns:\r
157 EFI_SUCCESS - The string was updated successfully.\r
3e99020d
LG
158 EFI_NOT_FOUND - The string specified by StringId is not in the database.\r
159 The specified PackageList is not in the database.\r
2c40a813 160 EFI_INVALID_PARAMETER - The String or Language was NULL.\r
161 EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.\r
162 \r
163--*/ \r
164;\r
165\r
166typedef\r
167EFI_STATUS\r
168(EFIAPI *EFI_HII_GET_LANGUAGES) (\r
169 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
170 IN EFI_HII_HANDLE PackageList,\r
171 IN OUT CHAR8 *Languages,\r
172 IN OUT UINTN *LanguagesSize\r
173 )\r
174/*++\r
175\r
176 Routine Description:\r
177 This function returns the list of supported languages, in the format specified\r
178 in Appendix M of UEFI 2.1 spec.\r
179 \r
180 Arguments: \r
181 This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
182 PackageList - The package list to examine.\r
183 Languages - Points to the buffer to hold the returned string.\r
184 LanguagesSize - On entry, points to the size of the buffer pointed to by \r
185 Languages, in bytes. On \r
186 return, points to the length of Languages, in bytes.\r
187 \r
188 Returns:\r
189 EFI_SUCCESS - The languages were returned successfully. \r
190 EFI_INVALID_PARAMETER - The Languages or LanguagesSize was NULL.\r
191 EFI_BUFFER_TOO_SMALL - The LanguagesSize is too small to hold the list of \r
192 supported languages. LanguageSize is updated to\r
193 contain the required size.\r
3e99020d 194 EFI_NOT_FOUND - The specified PackageList is not in the database.\r
2c40a813 195 \r
196--*/\r
197;\r
198\r
199typedef\r
200EFI_STATUS\r
201(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) (\r
202 IN CONST EFI_HII_STRING_PROTOCOL *This,\r
203 IN EFI_HII_HANDLE PackageList,\r
204 IN CONST CHAR8 *FirstLanguage,\r
205 IN OUT CHAR8 *SecondLanguages,\r
206 IN OUT UINTN *SecondLanguagesSize\r
207 )\r
208/*++\r
209\r
210 Routine Description:\r
211 Each string package has associated with it a single primary language and zero\r
212 or more secondary languages. This routine returns the secondary languages\r
213 associated with a package list.\r
214 \r
215 Arguments: \r
216 This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
217 PackageList - The package list to examine.\r
218 FirstLanguage - Points to the primary language.\r
219 SecondaryLanguages - Points to the buffer to hold the returned list of \r
220 secondary languages for the specified FirstLanguage.\r
221 If there are no secondary languages, the function \r
222 returns successfully, but this is set to NULL.\r
223 SecondaryLanguageSize - On entry, points to the size of the buffer pointed to \r
224 by SecondLanguages, in bytes. On return, points to\r
225 the length of SecondLanguages in bytes.\r
226 \r
227 Returns:\r
228 EFI_SUCCESS - Secondary languages were correctly returned.\r
229 EFI_INVALID_PARAMETER - FirstLanguage or SecondLanguages or SecondLanguagesSize was NULL. \r
230 EFI_BUFFER_TOO_SMALL - The buffer specified by SecondLanguagesSize is \r
231 too small to hold the returned information. \r
232 SecondLanguageSize is updated to hold the size of\r
3e99020d
LG
233 the buffer required.\r
234 EFI_INVALID_LANGUAGE - The language specified by FirstLanguage is not\r
235 present in the specified package list.\r
236 EFI_NOT_FOUND - The specified PackageList is not in the Database. \r
237 \r
238--*/\r
2c40a813 239;\r
240//\r
241// Interface structure for the EFI_HII_STRING_PROTOCOL\r
242//\r
e5bce275 243struct _EFI_HII_STRING_PROTOCOL {\r
2c40a813 244 EFI_HII_NEW_STRING NewString;\r
245 EFI_HII_GET_STRING GetString;\r
246 EFI_HII_SET_STRING SetString;\r
247 EFI_HII_GET_LANGUAGES GetLanguages;\r
248 EFI_HII_GET_2ND_LANGUAGES GetSecondaryLanguages;\r
e5bce275 249};\r
2c40a813 250\r
251extern EFI_GUID gEfiHiiStringProtocolGuid;\r
252\r
253#endif\r