]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/HiiString.h
Fix doxygen comment for structure and macro
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiString.h
index 06ff124b24ca624daeedd2629671de7c583d2646..79dc934acbd447ce0ff5b08e0c2d059676bb3b22 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The file provides services to manipulate string data.\r
   \r
-  Copyright (c) 2006 - 2007, Intel Corporation\r
+  Copyright (c) 2006 - 2008, Intel Corporation\r
   All rights reserved. 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
@@ -10,8 +10,6 @@
   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: HiiString.h\r
-\r
 **/\r
 \r
 #ifndef __HII_STRING_H__\r
 #define EFI_HII_STRING_PROTOCOL_GUID \\r
   { 0xfd96974, 0x23aa, 0x4cdc, { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } }\r
 \r
-\r
-typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL;\r
+#include <Protocol/HiiDatabase.h>\r
+#include <Protocol/HiiFont.h>\r
 \r
 \r
+typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL;\r
 \r
 /**\r
-  This function adds the string String to the group of strings\r
-  owned by PackageList, with the specified font information\r
-  StringFontInfo and returns a new string id.\r
-\r
-  @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
-\r
-  @param PackageList  Handle of the package list where this\r
-                      string will be added.\r
-\r
-  @param Language Points to the language for the new string.\r
-\r
-  @param String   Points to the new null-terminated string.\r
-\r
-  @param StringFontInfo Points to the new string's font\r
-                        information or NULL if the string should\r
-                        have the default system font, size and\r
-                        style. StringId On return, contains the\r
-                        new strings id, which is unique within\r
-                        PackageList.\r
-\r
-  @retval EFI_SUCCESS The new string was added successfully\r
-  \r
-  @retval EFI_OUT_OF_RESOURCES  Could not add the string.\r
-  \r
-  @retval EFI_INVALID_PARAMETER String is NULL or StringId is\r
-                                NULL or Language is NULL.\r
-\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
+\r
+  @param  This                   A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
+  @param  PackageList            Handle of the package list where this string will\r
+                                 be added.\r
+  @param  StringId               On return, contains the new strings id, which is\r
+                                 unique within PackageList.\r
+  @param  Language               Points to the language for the new string.\r
+  @param  LanguageName           Points to the printable language name to associate\r
+                                 with the passed in  Language field.If LanguageName\r
+                                 is not NULL and the string package header's\r
+                                 LanguageName  associated with a given Language is\r
+                                 not zero, the LanguageName being passed  in will\r
+                                 be ignored.\r
+  @param  String                 Points to the new null-terminated string.\r
+  @param  StringFontInfo         Points to the new string's font information or\r
+                                 NULL if the string should have the default system\r
+                                 font, size and style.\r
+\r
+  @retval EFI_SUCCESS            The new string was added successfully.\r
+  @retval EFI_NOT_FOUND          The specified PackageList could not be found in\r
+                                 database.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not add the string due to lack of resources.\r
+  @retval EFI_INVALID_PARAMETER  String is NULL or StringId is NULL or Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER  The specified StringFontInfo does not exist in\r
+                                 current database.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_NEW_STRING) (\r
+(EFIAPI *EFI_HII_NEW_STRING)(\r
   IN CONST  EFI_HII_STRING_PROTOCOL   *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageList,\r
-  OUT       EFI_STRING_ID             *StringId\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
+  IN CONST  EFI_FONT_INFO             *StringFontInfo OPTIONAL\r
 );\r
 \r
 \r
 /**\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
+  @param  This                   A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
+  @param  Language               Points to the language for the retrieved string.\r
+  @param  PackageList            The package list in the HII database to search for\r
+                                 the  specified string.\r
+  @param  StringId               The string's id, which is unique within\r
+                                 PackageList.\r
+  @param  String                 Points to the new null-terminated string.\r
+  @param  StringSize             On entry, points to the size of the buffer pointed\r
+                                 to by  String, in bytes. On return, points to the\r
+                                 length of the string, in bytes.\r
+  @param  StringFontInfo         If not NULL, points to the string's font\r
+                                 information.  It's caller's responsibility to free\r
+                                 this buffer.\r
+\r
+  @retval EFI_SUCCESS            The string was returned successfully.\r
+  @retval EFI_NOT_FOUND          The string specified by StringId is not available.\r
+  @retval EFI_NOT_FOUND          The string specified by StringId is available but\r
+                                 not in the specified language.\r
+                                 The specified PackageList is not in the database.\r
+  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by StringSize is too small to\r
+                                 hold the string.\r
+  @retval EFI_INVALID_PARAMETER  The String or Language or StringSize was NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   There were insufficient resources to complete the\r
+                                 request.\r
 \r
-  This function retrieves the string specified by StringId which\r
-  is associated with the specified PackageList in the language\r
-  Language and copies it into the buffer specified by String. If\r
-  the string specified by StringId is not present in the\r
-  specified PackageList, then EFI_NOT_FOUND is returned. If the\r
-  string specified by StringId is present, but not in the\r
-  specified language then EFI_INVALID_LANGUAGE is returned. If\r
-  the buffer specified by StringSize is too small to hold the\r
-  string, then EFI_BUFFER_TOO_SMALL will be returned. StringSize\r
-  will be updated to the size of buffer actually required to\r
-  hold the string.\r
-\r
-  @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
-  \r
-  @param PackageList  The package list in the HII database to\r
-                      search for the specified string.\r
-  \r
-  @param Language   Points to the language for the retrieved\r
-                    string.\r
-  \r
-  @param StringId   The string's id, which is unique within\r
-                    PackageList.\r
-  \r
-  @param String   Points to the new null-terminated string.\r
-  \r
-  @param StringSize On entry, points to the size of the buffer\r
-                    pointed to by String, in bytes. On return,\r
-                    points to the length of the string, in\r
-                    bytes.\r
-  \r
-  @param StringFontInfo   Points to the string's font\r
-                          information or NULL if the string font\r
-                          information is not desired.\r
-  \r
-  @retval EFI_SUCCESS The string was returned successfully.\r
-  \r
-  @retval EFI_NOT_FOUND The string specified by StringId is not\r
-                        available.\r
-  \r
-  @retval EFI_INVALID_LANGUAGE  The string specified by StringId\r
-                                is available but not in the\r
-                                specified language.\r
-  \r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer specified by\r
-                                StringLength is too small to\r
-                                hold the string.\r
-  \r
-  @retval EFI_INVALID_PARAMETER The String or Language was NULL.\r
-  \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_STRING) (\r
+(EFIAPI *EFI_HII_GET_STRING)(\r
   IN CONST  EFI_HII_STRING_PROTOCOL *This,\r
   IN CONST  CHAR8                   *Language,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
-  IN CONST  EFI_STRING_ID           StringId,\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
+  IN OUT    UINTN                   *StringSize,\r
+  OUT       EFI_FONT_INFO           **StringFontInfo OPTIONAL\r
 );\r
 \r
 /**\r
-  This function updates the string specified by StringId in the\r
-  specified PackageList to the text specified by String and,\r
-  optionally, the font information specified by StringFontInfo.\r
-  There is no way to change the font information without changing\r
-  the string text.\r
-\r
-  @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
-\r
-  @param PackageList  The package list containing the strings.\r
-\r
-  @param Language Points to the language for the updated string.\r
-\r
-  @param StringId The string id, which is unique within\r
-                  PackageList.\r
-\r
-  @param String   Points to the new null-terminated string.\r
-\r
-  @param StringFontInfo Points to the string's font information\r
-                        or NULL if the string font information\r
-                        is not changed.\r
-\r
-  @retval EFI_SUCCESS   The string was successfully updated.\r
-  \r
-  @retval EFI_NOT_FOUND The string specified by StringId is not\r
-                        in the database.\r
-  \r
-  @retval EFI_INVALID_PARAMETER The String or Language was NULL.\r
-  \r
-  @retval EFI_OUT_OF_RESOURCES  The system is out of resources\r
-                                to accomplish the task.\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
+  @param  This                   A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
+  @param  PackageList            The package list containing the strings.\r
+  @param  StringId               The string's id, which is unique within\r
+                                 PackageList.\r
+  @param  Language               Points to the language for the updated string.\r
+  @param  String                 Points to the new null-terminated string.\r
+  @param  StringFontInfo         Points to the string's font information or NULL if\r
+                                 the  string font information is not changed.\r
+\r
+  @retval EFI_SUCCESS            The string was updated successfully.\r
+  @retval EFI_NOT_FOUND          The string specified by StringId is not in the\r
+                                 database.\r
+  @retval EFI_INVALID_PARAMETER  The String or Language was NULL.\r
+  @retval EFI_INVALID_PARAMETER  The specified StringFontInfo does not exist in\r
+                                 current database.\r
+  @retval EFI_OUT_OF_RESOURCES   The system is out of resources to accomplish the\r
+                                 task.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_SET_STRING) (\r
+(EFIAPI *EFI_HII_SET_STRING)(\r
   IN CONST  EFI_HII_STRING_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
-  IN CONST  EFI_STRING_ID           StringId,\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        EFI_STRING              String,\r
   IN CONST  EFI_FONT_INFO           *StringFontInfo OPTIONAL\r
 );\r
 \r
 \r
 /**\r
-\r
   This function returns the list of supported languages.\r
 \r
-  @param This A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
-\r
-  @param PackageList  The package list to examine.\r
-\r
-  @param Languages  Points to the buffer to hold the returned\r
-                    string.\r
-\r
-  @param LanguageSize   On entry, points to the size of the\r
-                        buffer pointed to by Languages, in\r
-                        bytes. On return, points to the length\r
-                        of Languages, in bytes.\r
-\r
-\r
-  @retval EFI_SUCCESS The languages were returned successfully.\r
-  \r
-  @retval EFI_BUFFER_TOO_SMALL  The LanguagesSize is too small\r
-                                to hold the list of supported\r
-                                languages. LanguageSize is\r
-                                updated to contain the required\r
-                                size.\r
-  \r
-  @retval EFI_INVALID_PARAMETER Languages is NULL.\r
-\r
+  @param  This                   A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
+  @param  PackageList            The package list to examine.\r
+  @param  Languages              Points to the buffer to hold the returned string.\r
+  @param  LanguagesSize          On entry, points to the size of the buffer pointed\r
+                                 to by  Languages, in bytes. On  return, points to\r
+                                 the length of Languages, in bytes.\r
+\r
+  @retval EFI_SUCCESS            The languages were returned successfully.\r
+  @retval EFI_INVALID_PARAMETER  The Languages or LanguagesSize was NULL.\r
+  @retval 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
+  @retval EFI_NOT_FOUND          Could not find string package in specified\r
+                                 packagelist.\r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_LANGUAGES) (\r
-  IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageList,\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
+  IN OUT    UINTN                     *LanguagesSize\r
 );\r
 \r
 \r
 /**\r
-\r
-  Each string package has associated with it a single primary\r
-  language and zero or more secondary languages. This routine\r
-  returns the secondary languages associated with a package list.\r
-\r
-  @param This   A pointer to the EFI_HII_STRING_PROTOCOL\r
-                instance.\r
-\r
-  @param PackageList  The package list to examine.\r
-\r
-  @param FirstLanguage  Points to the primary language.\r
-\r
-  @param Languages  are specified in the format specified in\r
-                    Appendix M of the UEFI 2.0 specification.\r
-\r
-  @param SecondaryLanguages Points to the buffer to hold the\r
-                            returned list of secondary languages\r
-                            for the specified FirstLanguage. If\r
-                            there are no secondary languages,\r
-                            the function returns successfully,\r
-                            but this is set to NULL.\r
-\r
-  @param SecondaryLanguageSize  On entry, points to the size of\r
-                                the buffer pointed to by\r
-                                Languages, in bytes. On return,\r
-                                points to the length of\r
-                                Languages in bytes.\r
-\r
-  @retval EFI_SUCCESS   Secondary languages correctly returned\r
-\r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer specified by\r
-                                SecondLanguagesSize is too small\r
-                                to hold the returned\r
-                                information. SecondLanguageSize\r
-                                is updated to hold the size of\r
-                                the buffer required.\r
-\r
-  @retval EFI_INVALID_LANGUAGE  The language specified by\r
-                                FirstLanguage is not present in\r
-                                the specified package list.\r
-\r
-  @retval EFI_INVALID_PARAMETER FirstLanguage is NULL or\r
-                                SecondLanguage is NULL.\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
+  @param  This                   A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
+  @param  PackageList            The package list to examine.\r
+  @param  FirstLanguage          Points to the primary language.\r
+  @param  SecondaryLanguages     Points to the buffer to hold the returned list of\r
+                                 secondary languages for the specified\r
+                                 FirstLanguage. If there are no secondary\r
+                                 languages, the function  returns successfully, but\r
+                                 this is set to NULL.\r
+  @param  SecondaryLanguagesSize On entry, points to the size of the buffer pointed\r
+                                 to  by SecondaryLanguages, in bytes. On return,\r
+                                 points to the length of SecondaryLanguages in bytes.\r
+\r
+  @retval EFI_SUCCESS            Secondary languages were correctly returned.\r
+  @retval EFI_INVALID_PARAMETER  FirstLanguage or SecondaryLanguages or\r
+                                 SecondaryLanguagesSize was NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by SecondaryLanguagesSize is\r
+                                 too small to hold the returned information.\r
+                                 SecondLanguageSize is updated to hold the size of\r
+                                 the buffer required.\r
+  @retval EFI_INVALID_LANGUAGE   The language specified by FirstLanguage is not\r
+                                 present in the specified package list.\r
+  @retval EFI_NOT_FOUND          The specified PackageList is not in the Database.                                \r
 \r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_GET_2ND_LANGUAGES) (\r
-  IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageList,\r
-  IN CONST  CHAR8                     *FirstLanguage;\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
+  IN OUT    UINTN                     *SecondLanguagesSize\r
 );\r
 \r
 \r
 /**\r
+  @par Protocol Description:\r
   Services to manipulate the string.\r
-   \r
-  @param NewString  Add a new string. GetString Retrieve a\r
-                    string and related string information.\r
-\r
-  @param SetString  Change a string. \r
-\r
-  @param GetLanguages   List the languages for a particular\r
-                        package list.\r
-\r
-  @param GetSecondaryLanguages  List supported secondary\r
-                                languages for a particular\r
-                                primary language.\r
-\r
 **/\r
 struct _EFI_HII_STRING_PROTOCOL {\r
   EFI_HII_NEW_STRING        NewString;\r
@@ -301,3 +231,4 @@ extern EFI_GUID gEfiHiiStringProtocolGuid;
 \r
 #endif\r
 \r
+\r