]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/HiiLib.h
Make use of UefiRuntimeLib for refinement.
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
index 81fdaabd470b5acbdea53e25452b8a8ce75b438e..e39ed8e26044198604d2fde635f1f8fdaf10c5d0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Public include file for the HII Library\r
 \r
-  Copyright (c) 2007 - 2008, Intel Corporation                                                         \r
+  Copyright (c) 2007 - 2009, 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
 /**\r
   Registers a list of packages in the HII Database and returns the HII Handle\r
   associated with that registration.  If an HII Handle has already been registered\r
-  with the same PackageListGuid, then NULL is returned.  If there are not enough \r
-  resources to perform the registration, then NULL is returned.  If an empty list \r
-  of packages is passed in, then NULL is returned.  If the size of the list of \r
-  package is 0, then NULL is returned.\r
+  with the same PackageListGuid and DeviceHandle, then NULL is returned.  If there\r
+  are not enough resources to perform the registration, then NULL is returned.\r
+  If an empty list of packages is passed in, then NULL is returned.  If the size of\r
+  the list of package is 0, then NULL is returned.\r
 \r
-  The variable arguments are pointers which point to package header that defined \r
+  The variable arguments are pointers that point to package headers defined \r
   by UEFI VFR compiler and StringGather tool.\r
 \r
   #pragma pack (push, 1)\r
@@ -67,8 +67,8 @@ HiiAddPackages (
 /**\r
   Removes a package list from the HII database.\r
 \r
-  If HiiHandle is NULL, then ASSERT.\r
-  If HiiHandle is not a valid EFI_HII_HANDLE in the HII database, then ASSERT.\r
+  If HiiHandle is NULL, then ASSERT().\r
+  If HiiHandle is not a valid EFI_HII_HANDLE in the HII database, then ASSERT().\r
 \r
   @param[in]  HiiHandle   The handle that was previously registered in the HII database\r
 \r
@@ -81,7 +81,7 @@ HiiRemovePackages (
 ;\r
 \r
 /**\r
-  This function create a new string in String Package or updates an existing \r
+  This function creates a new string in String Package or updates an existing \r
   string in a String Package.  If StringId is 0, then a new string is added to\r
   a String Package.  If StringId is not zero, then a string in String Package is\r
   updated.  If SupportedLanguages is NULL, then the string is added or updated\r
@@ -97,7 +97,7 @@ HiiRemovePackages (
   @param[in]  StringId            If zero, then a new string is created in the \r
                                   String Package associated with HiiHandle.  If \r
                                   non-zero, then the string specified by StringId \r
-                                  is updated in the String Package  associated \r
+                                  is updated in the String Package associated \r
                                   with HiiHandle. \r
   @param[in]  String              A pointer to the Null-terminated Unicode string \r
                                   to add or update in the String Package associated \r
@@ -107,12 +107,12 @@ HiiRemovePackages (
                                   String is added or updated in the String Package \r
                                   associated with HiiHandle for all the languages \r
                                   that the String Package supports.  If this \r
-                                  parameter is not NULL, then then String is added \r
+                                  parameter is not NULL, then String is added \r
                                   or updated in the String Package associated with \r
-                                  HiiHandle for the set oflanguages specified by \r
+                                  HiiHandle for the set of languages specified by \r
                                   SupportedLanguages.  The format of \r
                                   SupportedLanguages must follow the language \r
-                                  format assumed the HII Database.\r
+                                  format assumed in the HII Database.\r
 \r
   @retval 0      The string could not be added or updated in the String Package.\r
   @retval Other  The EFI_STRING_ID of the newly added or updated string.\r
@@ -138,14 +138,14 @@ HiiSetString (
   for freeing the allocated buffer using FreePool().\r
   \r
   If HiiHandle is NULL, then ASSERT().\r
-  If StringId is 0, then ASSET.\r
+  If StringId is 0, then ASSERT().\r
 \r
   @param[in]  HiiHandle  A handle that was previously registered in the HII Database.\r
   @param[in]  StringId   The identifier of the string to retrieved from the string \r
                          package associated with HiiHandle.\r
   @param[in]  Language   The language of the string to retrieve.  If this parameter \r
                          is NULL, then the current platform language is used.  The \r
-                         format of Language must follow the language format assumed \r
+                         format of Language must follow the language format assumed in\r
                          the HII Database.\r
 \r
   @retval NULL   The string specified by StringId is not present in the string package.\r
@@ -162,7 +162,7 @@ HiiGetString (
 ;\r
 \r
 /**\r
-  Retrieves a string from a string package names by GUID in a specific language.  \r
+  Retrieves a string from a string package named by GUID, in the specified language.  \r
   If the language is not specified, then a string from a string package in the \r
   current platform  language is retrieved.  If the string can not be retrieved \r
   using the specified language or the current platform language, then the string \r
@@ -171,7 +171,7 @@ HiiGetString (
   is responsible for freeing the allocated buffer using FreePool().\r
   \r
   If PackageListGuid is NULL, then ASSERT().\r
-  If StringId is 0, then ASSERT.\r
+  If StringId is 0, then ASSERT().\r
 \r
   @param[in]  PackageListGuid  The GUID of a package list that was previously \r
                                registered in the HII Database.\r
@@ -180,7 +180,7 @@ HiiGetString (
   @param[in]  Language         The language of the string to retrieve.  If this \r
                                parameter is NULL, then the current platform \r
                                language is used.  The format of Language must \r
-                               follow the language format assumed the HII Database.\r
+                               follow the language format assumed in the HII Database.\r
 \r
   @retval NULL   The package list specified by PackageListGuid is not present in the\r
                  HII Database.\r
@@ -198,18 +198,19 @@ HiiGetPackageString (
 ;\r
 \r
 /**\r
-  Retrieves the array of all the HII Handles or the HII handle of a specific\r
-  package list in the HII Database.\r
+  Retrieves the array of all the HII Handles or the HII handles of a specific\r
+  package list GUID in the HII Database.\r
   This array is terminated with a NULL HII Handle.\r
   This function allocates the returned array using AllocatePool().\r
   The caller is responsible for freeing the array with FreePool().\r
 \r
   @param[in]  PackageListGuid  An optional parameter that is used to request \r
-                               an HII Handle that is associatd with a specific\r
-                               Package List GUID.  If this parameter is NULL\r
+                               HII Handles associated with a specific\r
+                               Package List GUID.  If this parameter is NULL,\r
                                then all the HII Handles in the HII Database\r
-                               are returned.  If this parameter is not NULL\r
-                               then at most 1 HII Handle is returned.\r
+                               are returned.  If this parameter is not NULL,\r
+                               then zero or more HII Handles associated with \r
+                               PackageListGuid are returned.\r
 \r
   @retval NULL   No HII handles were found in the HII database\r
   @retval NULL   The array of HII Handles could not be retrieved\r
@@ -224,11 +225,11 @@ HiiGetHiiHandles (
 ;\r
 \r
 /**\r
-  Retrieves a pointer to the a Null-terminated ASCII string containing the list \r
+  Retrieves a pointer to a Null-terminated ASCII string containing the list \r
   of languages that an HII handle in the HII Database supports.  The returned \r
   string is allocated using AllocatePool().  The caller is responsible for freeing\r
   the returned string using FreePool().  The format of the returned string follows\r
-  the language format assumed the HII Database.\r
+  the language format assumed in the HII Database.\r
   \r
   If HiiHandle is NULL, then ASSERT().\r
 \r
@@ -251,7 +252,7 @@ HiiGetSupportedLanguages (
 /**\r
   Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing \r
   information that includes a GUID, an optional Unicode string name, and a device\r
-  path.  The string returned is allocated with AllocatePool().  The caller is \r
+  path. The string returned is allocated with AllocatePool().  The caller is \r
   responsible for freeing the allocated string with FreePool().\r
   \r
   The format of a <ConfigHdr> is as follows:\r
@@ -287,7 +288,7 @@ HiiConstructConfigHdr (
 \r
 /**\r
   Reset the default value specified by DefaultId to the driver\r
-  configuration got by Request string. \r
+  configuration specified by the Request string. \r
 \r
   NULL request string support depends on the ExportConfig interface of\r
   HiiConfigRouting protocol in UEFI specification.\r
@@ -298,25 +299,25 @@ HiiConstructConfigHdr (
                     entirety of the current HII database will be reset.\r
   @param DefaultId  Specifies the type of defaults to retrieve.\r
   \r
-  @retval TURE    The default value is set successfully.\r
-  @retval FALSE   The default value can't be found and set.\r
+  @retval TURE    The default value was set successfully.\r
+  @retval FALSE   The default value was not found.\r
 **/\r
 BOOLEAN\r
 EFIAPI                               \r
 HiiSetToDefaults (     \r
-  IN CONST EFI_STRING  Request,  OPTIONAL\r
-  IN UINT16                                DefaultId\r
+  IN CONST EFI_STRING  Request,  OPTIONAL\r
+  IN UINT16            DefaultId\r
   );\r
 \r
 /**\r
-  Validate the current configuration by parsing HII form IFR opcode.\r
+  Validate the current configuration by parsing the IFR opcode in HII form.\r
 \r
-  NULL request string support depends on the ExtractConfig interface of\r
-  HiiConfigRouting protocol in UEFI specification.\r
+  NULL request string support depends on the ExportConfig interface of\r
+  HiiConfigRouting protocol in the UEFI specification.\r
   \r
   @param  Request   A null-terminated Unicode string in \r
                     <MultiConfigRequest> format. It can be NULL.\r
-                    If it is NULL, all current configuration for the\r
+                    If it is NULL, all current configurations for the\r
                     entirety of the current HII database will be validated.\r
   \r
   @retval TURE    Current configuration is valid.\r
@@ -325,56 +326,7 @@ HiiSetToDefaults (
 BOOLEAN\r
 EFIAPI                               \r
 HiiValidateSettings (\r
-  IN CONST EFI_STRING  Request  OPTIONAL\r
-  );\r
-\r
-/**\r
-  Allocates and returns a Null-terminated Unicode <ConfigAltResp> string.\r
-\r
-  If Guid is NULL, then ASSERT().\r
-  If Name is NULL, then ASSERT().\r
-  If BlockNameArray is NULL, then ASSERT().\r
-\r
-  @param[in] Guid               GUID of the buffer storage.\r
-  @param[in] Name               Name of the buffer storage.\r
-  @param[in] DriverHandle       The DriverHandle that support a Device Path\r
-                                Protocol.    \r
-  @param[in] BufferStorage      Content of the buffer storage.\r
-  @param[in] BufferStorageSize  Length in bytes of the buffer storage.\r
-  @param[in] BlockNameArray     Array generated by VFR compiler.  This array\r
-                                contains a UINT32 value that is the length\r
-                                of BlockNameArray in bytes, followed by pairs\r
-                                of 16-bit values that are the offset and length\r
-                                values used to contruct a <ConfigRequest> string.\r
-  @param[in]  ...               A variable argument list that contains pairs of 16-bit\r
-                                ALTCFG identifiers and pointers to DefaultValueArrays.\r
-                                The variable argument list is terminated by a NULL \r
-                                DefaultValueArray pointer.  A DefaultValueArray \r
-                                contains a UINT32 value that is the length, in bytes,\r
-                                of the DefaultValueArray.  The UINT32 length value \r
-                                is followed by a series of records that contain\r
-                                a 16-bit WIDTH value followed by a byte array with \r
-                                WIDTH entries.  The records must be parsed from\r
-                                beginning to end until the UINT32 length limit\r
-                                is reached.  \r
-\r
-  @retval NULL          There are not enough resources to process the request.\r
-  @retval NULL          A <ConfigResp> could not be retrieved from the Config \r
-                        Routing Protocol.\r
-  @retval Other         A pointer to the Null-terminate Unicode <ConfigAltResp>\r
-                        string.\r
-\r
-**/\r
-EFI_STRING\r
-EFIAPI\r
-HiiConstructConfigAltResp (\r
-  IN CONST EFI_GUID  *Guid,\r
-  IN CONST CHAR16    *Name,\r
-  IN EFI_HANDLE      DriverHandle,\r
-  IN CONST VOID      *BufferStorage,\r
-  IN UINTN           BufferStorageSize,\r
-  IN CONST VOID      *BlockNameArray, \r
-  ...\r
+  IN CONST EFI_STRING  Request  OPTIONAL\r
   );\r
 \r
 /**\r
@@ -399,7 +351,7 @@ HiiIsConfigHdrMatch (
   );\r
 \r
 /**\r
-  Retrieves uncommited data from the Form Browser and converts it to a binary\r
+  Retrieves uncommitted data from the Form Browser and converts it to a binary\r
   buffer.\r
 \r
   @param[in]  VariableName  Pointer to a Null-terminated Unicode string.  This \r
@@ -467,7 +419,7 @@ HiiSetBrowserData (
   an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.\r
 \r
   @param  Hour    The hour value to be encoded.\r
-  @param  Minute  The miniute value to be encoded.\r
+  @param  Minute  The minute value to be encoded.\r
   @param  Second  The second value to be encoded.\r
 \r
   @return A 64-bit containing Hour, Minute, and Second.\r
@@ -931,14 +883,14 @@ HiiCreateOrderedListOpCode (
   comparisons of IFR opcodes are performed from the beginning of the form being \r
   updated until an IFR opcode is found that exactly matches the first IFR opcode \r
   specifed by StartOpCodeHandle.  The following rules are used to determine if\r
-  an insert, replace, or delete operation is performed.\r
+  an insert, replace, or delete operation is performed:\r
   \r
   1) If no matches are found, then NULL is returned.  \r
   2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
      from StartOpcodeHandle except the first opcode are inserted immediately after \r
      the matching IFR opcode in the form beng updated.\r
   3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made \r
-     from the matching IFR opcode until an IFR opcode exatly matches the first \r
+     from the matching IFR opcode until an IFR opcode exactly matches the first \r
      IFR opcode specified by EndOpCodeHandle.  If no match is found for the first\r
      IFR opcode specified by EndOpCodeHandle, then NULL is returned.  If a match\r
      is found, then all of the IFR opcodes between the start match and the end \r
@@ -964,12 +916,12 @@ HiiCreateOrderedListOpCode (
   @param[in]  EndOpCodeHandle    An OpCcode Handle that contains the IFR opcode\r
                                  that marks the end of a replace operation in\r
                                  the form.  This is an optional parameter that\r
-                                 may be NULL.  If it is NULL, then an the IFR\r
+                                 may be NULL.  If it is NULL, then the IFR\r
                                  opcodes specified by StartOpCodeHandle are \r
                                  inserted into the form.\r
   \r
-  @retval EFI_OUT_OF_RESOURCES   No enough memory resource is allocated.\r
-  @retval EFI_NOT_FOUND          The following cases will return EFI_NOT_FOUND.\r
+  @retval EFI_OUT_OF_RESOURCES   Not enough memory resources are allocated.\r
+  @retval EFI_NOT_FOUND          The following cases will return EFI_NOT_FOUND:\r
                                  1) The form specified by HiiHandle, FormSetGuid, \r
                                  and FormId could not be found in the HII Database.\r
                                  2) No IFR opcodes in the target form match the first\r
@@ -990,32 +942,4 @@ HiiUpdateForm (
   IN VOID            *EndOpcodeHandle     OPTIONAL\r
   );\r
 \r
-/**\r
-  Configure the buffer accrording to ConfigBody strings in the format of\r
-  <Length:4 bytes>, <Offset: 2 bytes>, <Width:2 bytes>, <Data:n bytes>.\r
-  This ConfigBody strings is generated by EDKII UEFI VfrCompiler for the default\r
-  values in a Form Set. The name of the ConfigBody strings is VfrMyIfrNVDataDefault0000\r
-  constructed following this rule: \r
-   "Vfr" + varstore.name + "Default" + defaultstore.attributes.\r
-  Check the generated C file in Output for details.\r
-\r
-  @param  Buffer                 the start address of buffer.\r
-  @param  BufferSize             the size of buffer.\r
-  @param  Number                 the number of the ConfigBody strings.\r
-  @param  ...                    the ConfigBody strings\r
-\r
-  @retval EFI_BUFFER_TOO_SMALL   the BufferSize is too small to operate.\r
-  @retval EFI_INVALID_PARAMETER  Buffer is NULL or BufferSize is 0.\r
-  @retval EFI_SUCCESS            Operation successful.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-HiiIfrLibExtractDefault(\r
-  IN VOID                         *Buffer,\r
-  IN UINTN                        *BufferSize,\r
-  UINTN                           Number,\r
-  ...\r
-  );\r
-\r
 #endif\r