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