]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/HiiLib.h
MdeModulePkg FileExplorerLib: Create file explorer library.
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
index b54fdd29a42c369a939bc8f9a6592b8973b58090..4ad4cf133f207220289d2dddc3b85774194b8083 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Public include file for the HII Library\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -48,7 +48,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                to packages terminated by a NULL.\r
 \r
   @retval NULL   An HII Handle has already been registered in the HII Database with\r
-                 the same PackageListGuid.\r
+                 the same PackageListGuid and DeviceHandle.\r
   @retval NULL   The HII Handle could not be created.\r
   @retval NULL   An empty list of packages was passed in.\r
   @retval NULL   All packages are empty.\r
@@ -224,6 +224,29 @@ HiiGetHiiHandles (
   )\r
 ;\r
 \r
+/**\r
+  This function allows a caller to extract the form set opcode form the Hii Handle.\r
+  The returned buffer is allocated using AllocatePool().The caller is responsible \r
+  for freeing the allocated buffer using FreePool().\r
+\r
+  @param Handle            The HII handle.\r
+  @param Buffer            On return, opints to a pointer which point to the buffer that contain the formset opcode.\r
+  @param BufferSize        On return, points to the length of the buffer.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES   No enough memory resource is allocated.\r
+  @retval EFI_NOT_FOUND          Can't find the package data for the input Handle.\r
+  @retval EFI_INVALID_PARAMETER  The input parameters are not correct.\r
+  @retval EFI_SUCCESS            Get the formset opcode from the hii handle sucessfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiGetFormSetFromHiiHandle(\r
+  IN  EFI_HII_HANDLE     Handle,\r
+  OUT EFI_IFR_FORM_SET   **Buffer,\r
+  OUT UINTN              *BufferSize\r
+  );\r
+\r
 /**\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
@@ -320,7 +343,7 @@ HiiSetToDefaults (
                     If it is NULL, all current configurations for the\r
                     entirety of the current HII database will be validated.\r
   \r
-  @retval TURE    The current configuration is valid.\r
+  @retval TRUE    The current configuration is valid.\r
   @retval FALSE   The current configuration is invalid.\r
 **/\r
 BOOLEAN\r
@@ -679,6 +702,49 @@ HiiCreateGotoOpCode (
   IN EFI_QUESTION_ID  QuestionId\r
   );\r
 \r
+/**\r
+  Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode.\r
+\r
+  When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created. \r
+  When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created.\r
+  When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created.\r
+  When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is zero, EFI_IFR_REF opcode will be created.\r
+\r
+  If OpCodeHandle is NULL, then ASSERT().\r
+  If any reserved bits are set in QuestionFlags, then ASSERT().\r
+\r
+  @param[in]  OpCodeHandle   The handle to the buffer of opcodes.\r
+  @param[in]  RefFormId      The Destination Form ID.\r
+  @param[in]  Prompt         The string ID for Prompt.\r
+  @param[in]  Help           The string ID for Help.\r
+  @param[in]  QuestionFlags  The flags in Question Header\r
+  @param[in]  QuestionId     Question ID.\r
+  @param[in]  RefQuestionId  The question on the form to which this link is referring. \r
+                             If its value is zero, then the link refers to the top of the form.\r
+  @param[in]  RefFormSetId   The form set to which this link is referring. If its value is NULL, and RefDevicePath is \r
+                             zero, then the link is to the current form set.\r
+  @param[in]  RefDevicePath  The string identifier that specifies the string containing the text representation of \r
+                             the device path to which the form set containing the form specified by FormId.\r
+                             If its value is zero, then the link refers to the current page.\r
+\r
+  @retval NULL   There is not enough space left in Buffer to add the opcode.\r
+  @retval Other  A pointer to the created opcode.\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+HiiCreateGotoExOpCode (\r
+  IN VOID             *OpCodeHandle,\r
+  IN EFI_FORM_ID      RefFormId,\r
+  IN EFI_STRING_ID    Prompt,\r
+  IN EFI_STRING_ID    Help,\r
+  IN UINT8            QuestionFlags,\r
+  IN EFI_QUESTION_ID  QuestionId,\r
+  IN EFI_QUESTION_ID  RefQuestionId,\r
+  IN EFI_GUID         *RefFormSetId,    OPTIONAL\r
+  IN EFI_STRING_ID    RefDevicePath\r
+  );\r
+\r
 /**\r
   Create EFI_IFR_CHECKBOX_OP opcode.\r
 \r
@@ -689,7 +755,8 @@ HiiCreateGotoOpCode (
   @param[in]  OpCodeHandle          The handle to the buffer of opcodes.\r
   @param[in]  QuestionId            The question ID.\r
   @param[in]  VarStoreId            The storage ID.\r
-  @param[in]  VarOffset             The offset in Storage.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair.\r
   @param[in]  Prompt                The string ID for Prompt.\r
   @param[in]  Help                  The string ID for Help.\r
   @param[in]  QuestionFlags         The flags in Question Header.\r
@@ -725,7 +792,8 @@ HiiCreateCheckBoxOpCode (
   @param[in]  OpCodeHandle          The handle to the buffer of opcodes.\r
   @param[in]  QuestionId            The question ID.\r
   @param[in]  VarStoreId            The storage ID.\r
-  @param[in]  VarOffset             The offset in Storage.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair.\r
   @param[in]  Prompt                The string ID for Prompt.\r
   @param[in]  Help                  The string ID for Help.\r
   @param[in]  QuestionFlags         The flags in Question Header.\r
@@ -767,7 +835,8 @@ HiiCreateNumericOpCode (
   @param[in]  OpCodeHandle          The handle to the buffer of opcodes.\r
   @param[in]  QuestionId            The question ID.\r
   @param[in]  VarStoreId            The storage ID.\r
-  @param[in]  VarOffset             The offset in Storage.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair.\r
   @param[in]  Prompt                The string ID for Prompt.\r
   @param[in]  Help                  The string ID for Help.\r
   @param[in]  QuestionFlags         The flags in Question Header.\r
@@ -807,7 +876,8 @@ HiiCreateStringOpCode (
   @param[in]  OpCodeHandle          The handle to the buffer of opcodes.\r
   @param[in]  QuestionId            The question ID.\r
   @param[in]  VarStoreId            The storage ID.\r
-  @param[in]  VarOffset             The offset in Storage.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair.\r
   @param[in]  Prompt                The string ID for Prompt.\r
   @param[in]  Help                  The string ID for Help.\r
   @param[in]  QuestionFlags         The flags in Question Header.\r
@@ -845,7 +915,8 @@ HiiCreateOneOfOpCode (
   @param[in]  OpCodeHandle          The handle to the buffer of opcodes.\r
   @param[in]  QuestionId            The question ID.\r
   @param[in]  VarStoreId            The storage ID.\r
-  @param[in]  VarOffset             The offset in Storage.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair.\r
   @param[in]  Prompt                The string ID for Prompt.\r
   @param[in]  Help                  The string ID for Help.\r
   @param[in]  QuestionFlags         The flags in Question Header.\r
@@ -877,6 +948,107 @@ HiiCreateOrderedListOpCode (
   IN VOID             *DefaultsOpCodeHandle  OPTIONAL\r
   );\r
 \r
+/**\r
+  Create EFI_IFR_TEXT_OP opcode.\r
+\r
+  If OpCodeHandle is NULL, then ASSERT().\r
+\r
+  @param[in]  OpCodeHandle  Handle to the buffer of opcodes.\r
+  @param[in]  Prompt        String ID for Prompt.\r
+  @param[in]  Help          String ID for Help.\r
+  @param[in]  TextTwo       String ID for TextTwo.\r
+\r
+  @retval NULL   There is not enough space left in Buffer to add the opcode.\r
+  @retval Other  A pointer to the created opcode.\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+HiiCreateTextOpCode (\r
+  IN VOID           *OpCodeHandle,\r
+  IN EFI_STRING_ID  Prompt,\r
+  IN EFI_STRING_ID  Help,\r
+  IN EFI_STRING_ID  TextTwo\r
+  );\r
+\r
+/**\r
+  Create EFI_IFR_DATE_OP opcode.\r
+\r
+  If OpCodeHandle is NULL, then ASSERT().\r
+  If any reserved bits are set in QuestionFlags, then ASSERT().\r
+  If any reserved bits are set in DateFlags, then ASSERT().\r
+\r
+  @param[in]  OpCodeHandle          Handle to the buffer of opcodes.\r
+  @param[in]  QuestionId            Question ID\r
+  @param[in]  VarStoreId            Storage ID, optional. If DateFlags is not\r
+                                    QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair, optional. If DateFlags is not\r
+                                    QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
+  @param[in]  Prompt                String ID for Prompt\r
+  @param[in]  Help                  String ID for Help\r
+  @param[in]  QuestionFlags         Flags in Question Header\r
+  @param[in]  DateFlags             Flags for date opcode\r
+  @param[in]  DefaultsOpCodeHandle  Handle for a buffer of DEFAULT opcodes.  This\r
+                                    is an optional parameter that may be NULL.\r
+\r
+  @retval NULL   There is not enough space left in Buffer to add the opcode.\r
+  @retval Other  A pointer to the created opcode.\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+HiiCreateDateOpCode (\r
+  IN VOID             *OpCodeHandle,\r
+  IN EFI_QUESTION_ID  QuestionId,\r
+  IN EFI_VARSTORE_ID  VarStoreId,   OPTIONAL\r
+  IN UINT16           VarOffset,    OPTIONAL\r
+  IN EFI_STRING_ID    Prompt,\r
+  IN EFI_STRING_ID    Help,\r
+  IN UINT8            QuestionFlags,\r
+  IN UINT8            DateFlags,\r
+  IN VOID             *DefaultsOpCodeHandle  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Create EFI_IFR_TIME_OP opcode.\r
+\r
+  If OpCodeHandle is NULL, then ASSERT().\r
+  If any reserved bits are set in QuestionFlags, then ASSERT().\r
+  If any reserved bits are set in TimeFlags, then ASSERT().\r
+\r
+  @param[in]  OpCodeHandle          Handle to the buffer of opcodes.\r
+  @param[in]  QuestionId            Question ID\r
+  @param[in]  VarStoreId            Storage ID, optional. If TimeFlags is not\r
+                                    QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
+  @param[in]  VarOffset             Offset in Storage or String ID of the name (VarName)\r
+                                    for this name/value pair, optional. If TimeFlags is not\r
+                                    QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
+  @param[in]  Prompt                String ID for Prompt\r
+  @param[in]  Help                  String ID for Help\r
+  @param[in]  QuestionFlags         Flags in Question Header\r
+  @param[in]  TimeFlags             Flags for time opcode\r
+  @param[in]  DefaultsOpCodeHandle  Handle for a buffer of DEFAULT opcodes.  This\r
+                                    is an optional parameter that may be NULL.\r
+\r
+  @retval NULL   There is not enough space left in Buffer to add the opcode.\r
+  @retval Other  A pointer to the created opcode.\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+HiiCreateTimeOpCode (\r
+  IN VOID             *OpCodeHandle,\r
+  IN EFI_QUESTION_ID  QuestionId,\r
+  IN EFI_VARSTORE_ID  VarStoreId,   OPTIONAL\r
+  IN UINT16           VarOffset,    OPTIONAL\r
+  IN EFI_STRING_ID    Prompt,\r
+  IN EFI_STRING_ID    Help,\r
+  IN UINT8            QuestionFlags,\r
+  IN UINT8            TimeFlags,\r
+  IN VOID             *DefaultsOpCodeHandle  OPTIONAL\r
+  );\r
+\r
 /**\r
   This function updates a form that has previously been registered with the HII \r
   Database.  This function will perform at most one update operation.\r