+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- HiiString.h\r
- \r
-Abstract:\r
-\r
- EFI_HII_STRING_PROTOCOL from UEFI 2.1 specification.\r
- \r
- This protocol provides interfaces to manipulate string data.\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-#ifndef __EFI_HII_STRING_PROTOCOL_H__\r
-#define __EFI_HII_STRING_PROTOCOL_H__\r
-\r
-#include EFI_PROTOCOL_DEFINITION (HiiFont)\r
-\r
-//\r
-// Global ID for the Hii String Protocol.\r
-//\r
-#define EFI_HII_STRING_PROTOCOL_GUID \\r
- { \\r
- 0xfd96974, 0x23aa, 0x4cdc, {0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a} \\r
- }\r
-\r
-EFI_FORWARD_DECLARATION (EFI_HII_STRING_PROTOCOL);\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_NEW_STRING) (\r
- IN CONST EFI_HII_STRING_PROTOCOL *This,\r
- IN EFI_HII_HANDLE PackageList,\r
- OUT EFI_STRING_ID *StringId,\r
- IN CONST CHAR8 *Language,\r
- IN CONST CHAR16 *LanguageName, OPTIONAL \r
- IN CONST EFI_STRING String,\r
- IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function adds the string String to the group of strings owned by PackageList, with the\r
- specified font information StringFontInfo and returns a new string id. \r
- The new string identifier is guaranteed to be unique within the package list. \r
- That new string identifier is reserved for all languages in the package list. \r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
- PackageList - Handle of the package list where this string will be added. \r
- StringId - On return, contains the new strings id, which is unique within PackageList. \r
- Language - Points to the language for the new string.\r
- LanguageName - Points to the printable language name to associate with the passed in \r
- Language field.If LanguageName is not NULL and the string package header's LanguageName \r
- associated with a given Language is not zero, the LanguageName being passed \r
- in will be ignored. \r
- String - Points to the new null-terminated string. \r
- StringFontInfo - Points to the new string's font information or NULL if the string should have the\r
- default system font, size and style. \r
-\r
- Returns:\r
- EFI_SUCCESS - The new string was added successfully.\r
- EFI_NOT_FOUND - The specified PackageList could not be found in database.\r
- EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.\r
- EFI_INVALID_PARAMETER - String is NULL or StringId is NULL or Language is NULL. \r
- \r
---*/ \r
-;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_STRING) (\r
- IN CONST EFI_HII_STRING_PROTOCOL *This,\r
- IN CONST CHAR8 *Language,\r
- IN EFI_HII_HANDLE PackageList,\r
- IN EFI_STRING_ID StringId,\r
- OUT EFI_STRING String,\r
- IN OUT UINTN *StringSize,\r
- OUT EFI_FONT_INFO **StringFontInfo OPTIONAL\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function retrieves the string specified by StringId which is associated \r
- with the specified PackageList in the language Language and copies it into \r
- the buffer specified by String.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
- Language - Points to the language for the retrieved string.\r
- PackageList - The package list in the HII database to search for the \r
- specified string. \r
- StringId - The string's id, which is unique within PackageList. \r
- String - Points to the new null-terminated string. \r
- StringSize - On entry, points to the size of the buffer pointed to by \r
- String, in bytes. On return,\r
- points to the length of the string, in bytes.\r
- StringFontInfo - Points to a buffer that will be callee allocated and will \r
- have the string's font information into this buffer. \r
- The caller is responsible for freeing this buffer. \r
- If the parameter is NULL a buffer will not be allocated \r
- and the string font information will not be returned.\r
-\r
- Returns:\r
- EFI_SUCCESS - The string was returned successfully.\r
- EFI_NOT_FOUND - The string specified by StringId is not available.\r
- The specified PackageList is not in the database.\r
- EFI_INVALID_LANGUAGE - The string specified by StringId is available but\r
- not in the specified language. \r
- EFI_BUFFER_TOO_SMALL - The buffer specified by StringSize is too small to \r
- hold the string. \r
- EFI_INVALID_PARAMETER - The String or Language or StringSize was NULL.\r
- EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the \r
- request.\r
- \r
---*/ \r
-;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_SET_STRING) (\r
- IN CONST EFI_HII_STRING_PROTOCOL *This,\r
- IN EFI_HII_HANDLE PackageList,\r
- IN EFI_STRING_ID StringId,\r
- IN CONST CHAR8 *Language,\r
- IN CONST EFI_STRING String,\r
- IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function updates the string specified by StringId in the specified PackageList to the text \r
- specified by String and, optionally, the font information specified by StringFontInfo. \r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
- PackageList - The package list containing the strings.\r
- StringId - The string's id, which is unique within PackageList. \r
- Language - Points to the language for the updated string.\r
- String - Points to the new null-terminated string. \r
- StringFontInfo - Points to the string's font information or NULL if the string font information is not\r
- changed. \r
-\r
- Returns:\r
- EFI_SUCCESS - The string was updated successfully.\r
- EFI_NOT_FOUND - The string specified by StringId is not in the database.\r
- The specified PackageList is not in the database.\r
- EFI_INVALID_PARAMETER - The String or Language was NULL.\r
- EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.\r
- \r
---*/ \r
-;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_LANGUAGES) (\r
- IN CONST EFI_HII_STRING_PROTOCOL *This,\r
- IN EFI_HII_HANDLE PackageList,\r
- IN OUT CHAR8 *Languages,\r
- IN OUT UINTN *LanguagesSize\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function returns the list of supported languages, in the format specified\r
- in Appendix M of UEFI 2.1 spec.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
- PackageList - The package list to examine.\r
- Languages - Points to the buffer to hold the returned string.\r
- LanguagesSize - On entry, points to the size of the buffer pointed to by \r
- Languages, in bytes. On \r
- return, points to the length of Languages, in bytes.\r
- \r
- Returns:\r
- EFI_SUCCESS - The languages were returned successfully. \r
- EFI_INVALID_PARAMETER - The Languages or LanguagesSize was NULL.\r
- EFI_BUFFER_TOO_SMALL - The LanguagesSize is too small to hold the list of \r
- supported languages. LanguageSize is updated to\r
- contain the required size.\r
- EFI_NOT_FOUND - The specified PackageList is not in the database.\r
- \r
---*/\r
-;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) (\r
- IN CONST EFI_HII_STRING_PROTOCOL *This,\r
- IN EFI_HII_HANDLE PackageList,\r
- IN CONST CHAR8 *FirstLanguage,\r
- IN OUT CHAR8 *SecondLanguages,\r
- IN OUT UINTN *SecondLanguagesSize\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- Each string package has associated with it a single primary language and zero\r
- or more secondary languages. This routine returns the secondary languages\r
- associated with a package list.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
- PackageList - The package list to examine.\r
- FirstLanguage - Points to the primary language.\r
- SecondaryLanguages - Points to the buffer to hold the returned list of \r
- secondary languages for the specified FirstLanguage.\r
- If there are no secondary languages, the function \r
- returns successfully, but this is set to NULL.\r
- SecondaryLanguageSize - On entry, points to the size of the buffer pointed to \r
- by SecondLanguages, in bytes. On return, points to\r
- the length of SecondLanguages in bytes.\r
- \r
- Returns:\r
- EFI_SUCCESS - Secondary languages were correctly returned.\r
- EFI_INVALID_PARAMETER - FirstLanguage or SecondLanguages or SecondLanguagesSize was NULL. \r
- EFI_BUFFER_TOO_SMALL - The buffer specified by SecondLanguagesSize is \r
- too small to hold the returned information. \r
- SecondLanguageSize is updated to hold the size of\r
- the buffer required.\r
- EFI_INVALID_LANGUAGE - The language specified by FirstLanguage is not\r
- present in the specified package list.\r
- EFI_NOT_FOUND - The specified PackageList is not in the Database. \r
- \r
---*/\r
-;\r
-//\r
-// Interface structure for the EFI_HII_STRING_PROTOCOL\r
-//\r
-struct _EFI_HII_STRING_PROTOCOL {\r
- EFI_HII_NEW_STRING NewString;\r
- EFI_HII_GET_STRING GetString;\r
- EFI_HII_SET_STRING SetString;\r
- EFI_HII_GET_LANGUAGES GetLanguages;\r
- EFI_HII_GET_2ND_LANGUAGES GetSecondaryLanguages;\r
-};\r
-\r
-extern EFI_GUID gEfiHiiStringProtocolGuid;\r
-\r
-#endif\r