-/** @file\r
- The file contain all library function for Ifr Operations.\r
- \r
- Copyright (c) 2006 - 2007, 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
- 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
-**/\r
-\r
-#ifndef __IFRSUPPORTLIBRARY_H__\r
-#define __IFRSUPPORTLIBRARY_H__\r
-\r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
-#define DEFAULT_FORM_BUFFER_SIZE 0xFFFF\r
-#define DEFAULT_STRING_BUFFER_SIZE 0xFFFF\r
-\r
-#pragma pack(1)\r
-typedef struct {\r
- CHAR16 *OptionString; // Passed in string to generate a token for in a truly dynamic form creation\r
- STRING_REF StringToken; // This is used when creating a single op-code without generating a StringToken (have one already)\r
- UINT16 Value;\r
- UINT8 Flags;\r
- UINT16 Key;\r
-} IFR_OPTION;\r
-#pragma pack()\r
-\r
-EFI_STATUS\r
-GetCurrentLanguage (\r
- OUT CHAR16 *Lang\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Determine what is the current language setting\r
- \r
-Arguments:\r
-\r
- Lang - Pointer of system language\r
- \r
-Returns: \r
- \r
- Status code\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-AddString (\r
- IN VOID *StringBuffer,\r
- IN CHAR16 *Language,\r
- IN CHAR16 *String,\r
- IN OUT STRING_REF *StringToken\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add a string to the incoming buffer and return the token and offset data\r
- \r
-Arguments:\r
-\r
- StringBuffer - The incoming buffer\r
- \r
- Language - Currrent language\r
- \r
- String - The string to be added\r
- \r
- StringToken - The index where the string placed\r
- \r
-Returns: \r
-\r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - String successfully added to the incoming buffer\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-AddOpCode (\r
- IN VOID *FormBuffer,\r
- IN OUT VOID *OpCodeData\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add op-code data to the FormBuffer\r
- \r
-Arguments:\r
-\r
- FormBuffer - Form buffer to be inserted to\r
- \r
- OpCodeData - Op-code data to be inserted\r
- \r
-Returns: \r
-\r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Op-code data successfully inserted\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateFormSet (\r
- IN CHAR16 *FormSetTitle,\r
- IN EFI_GUID *Guid,\r
- IN UINT8 Class,\r
- IN UINT8 SubClass,\r
- IN OUT VOID **FormBuffer,\r
- IN OUT VOID **StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a formset\r
- \r
-Arguments:\r
-\r
- FormSetTitle - Title of formset\r
- \r
- Guid - Guid of formset\r
- \r
- Class - Class of formset\r
- \r
- SubClass - Sub class of formset\r
- \r
- FormBuffer - Pointer of the formset created\r
- \r
- StringBuffer - Pointer of FormSetTitile string created\r
- \r
-Returns: \r
-\r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Formset successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateForm (\r
- IN CHAR16 *FormTitle,\r
- IN UINT16 FormId,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a form\r
- \r
-Arguments:\r
-\r
- FormTitle - Title of the form\r
- \r
- FormId - Id of the form\r
- \r
- FormBuffer - Pointer of the form created\r
- \r
- StringBuffer - Pointer of FormTitil string created\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Form successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateSubTitle (\r
- IN CHAR16 *SubTitle,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a SubTitle\r
- \r
-Arguments:\r
-\r
- SubTitle - Sub title to be created\r
- \r
- FormBuffer - Where this subtitle to add to\r
- \r
- StringBuffer - String buffer created for subtitle\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Subtitle successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateText (\r
- IN CHAR16 *String,\r
- IN CHAR16 *String2,\r
- IN CHAR16 *String3,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a line of text\r
- \r
-Arguments:\r
-\r
- String - First string of the text\r
- \r
- String2 - Second string of the text\r
- \r
- String3 - Help string of the text\r
- \r
- Flags - Flag of the text\r
- \r
- Key - Key of the text\r
- \r
- FormBuffer - The form where this text adds to\r
- \r
- StringBuffer - String buffer created for String, String2 and String3\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Text successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateGoto (\r
- IN UINT16 FormId,\r
- IN CHAR16 *Prompt,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a hyperlink\r
- \r
-Arguments:\r
-\r
- FormId - Form ID of the hyperlink\r
- \r
- Prompt - Prompt of the hyperlink\r
- \r
- FormBuffer - The form where this hyperlink adds to\r
- \r
- StringBuffer - String buffer created for Prompt\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Hyperlink successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOneOf (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN CHAR16 *Prompt,\r
- IN CHAR16 *Help,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINTN OptionCount,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a one-of question with a set of options to choose from. The\r
- OptionsList is a pointer to a null-terminated list of option descriptions.\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the one-of box\r
- \r
- DataWidth - DataWidth of the one-of box\r
- \r
- Prompt - Prompt of the one-of box\r
- \r
- Help - Help of the one-of box\r
- \r
- OptionsList - Each string in it is an option of the one-of box\r
- \r
- OptionCount - Option string count\r
- \r
- FormBuffer - The form where this one-of box adds to\r
- \r
- StringBuffer - String buffer created for Prompt, Help and Option strings\r
- \r
-Returns: \r
-\r
- EFI_DEVICE_ERROR - DataWidth > 2\r
-\r
- EFI_SUCCESS - One-Of box successfully created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOrderedList (\r
- IN UINT16 QuestionId,\r
- IN UINT8 MaxEntries,\r
- IN CHAR16 *Prompt,\r
- IN CHAR16 *Help,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINTN OptionCount,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a one-of question with a set of options to choose from. The\r
- OptionsList is a pointer to a null-terminated list of option descriptions.\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the ordered list\r
- \r
- MaxEntries - MaxEntries of the ordered list\r
- \r
- Prompt - Prompt of the ordered list\r
- \r
- Help - Help of the ordered list\r
- \r
- OptionsList - Each string in it is an option of the ordered list\r
- \r
- OptionCount - Option string count\r
- \r
- FormBuffer - The form where this ordered list adds to\r
- \r
- StringBuffer - String buffer created for Prompt, Help and Option strings\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Ordered list successfully created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateCheckBox (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN CHAR16 *Prompt,\r
- IN CHAR16 *Help,\r
- IN UINT8 Flags,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a checkbox\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the check box\r
- \r
- DataWidth - DataWidth of the check box\r
- \r
- Prompt - Prompt of the check box\r
- \r
- Help - Help of the check box\r
- \r
- Flags - Flags of the check box\r
- \r
- FormBuffer - The form where this check box adds to\r
- \r
- StringBuffer - String buffer created for Prompt and Help.\r
- \r
-Returns: \r
-\r
- EFI_DEVICE_ERROR - DataWidth > 1\r
-\r
- EFI_SUCCESS - Check box successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateNumeric (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN CHAR16 *Prompt,\r
- IN CHAR16 *Help,\r
- IN UINT16 Minimum,\r
- IN UINT16 Maximum,\r
- IN UINT16 Step,\r
- IN UINT16 Default,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a numeric\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the numeric\r
- \r
- DataWidth - DataWidth of the numeric\r
- \r
- Prompt - Prompt of the numeric\r
- \r
- Help - Help of the numeric\r
- \r
- Minimum - Minumun boundary of the numeric\r
- \r
- Maximum - Maximum boundary of the numeric\r
- \r
- Step - Step of the numeric\r
- \r
- Default - Default value\r
- \r
- Flags - Flags of the numeric\r
- \r
- Key - Key of the numeric\r
- \r
- FormBuffer - The form where this numeric adds to\r
- \r
- StringBuffer - String buffer created for Prompt and Help.\r
- \r
-Returns: \r
-\r
- EFI_DEVICE_ERROR - DataWidth > 2\r
- \r
- EFI_SUCCESS - Numeric is successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateString (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN CHAR16 *Prompt,\r
- IN CHAR16 *Help,\r
- IN UINT8 MinSize,\r
- IN UINT8 MaxSize,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer,\r
- IN OUT VOID *StringBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a string\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the string\r
- \r
- DataWidth - DataWidth of the string\r
- \r
- Prompt - Prompt of the string\r
- \r
- Help - Help of the string\r
- \r
- MinSize - Min size boundary of the string\r
- \r
- MaxSize - Max size boundary of the string\r
- \r
- Flags - Flags of the string\r
- \r
- Key - Key of the string\r
- \r
- FormBuffer - The form where this string adds to\r
- \r
- StringBuffer - String buffer created for Prompt and Help.\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - String successfully created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-ExtractDataFromHiiHandle (\r
- IN EFI_HII_HANDLE HiiHandle,\r
- IN OUT UINT16 *ImageLength,\r
- OUT UINT8 *DefaultImage,\r
- OUT EFI_GUID *Guid\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Extract information pertaining to the HiiHandle\r
- \r
-Arguments:\r
-\r
- HiiHandle - Hii handle\r
- \r
- ImageLength - For input, length of DefaultImage;\r
- For output, length of actually required\r
- \r
- DefaultImage - Image buffer prepared by caller\r
- \r
- Guid - Guid information about the form\r
- \r
-Returns: \r
-\r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength\r
- \r
- EFI_SUCCESS - Successfully extract data from Hii database.\r
- \r
- \r
---*/\r
-;\r
-\r
-EFI_HII_HANDLE\r
-FindHiiHandle (\r
- IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL\r
- IN EFI_GUID *Guid\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Finds HII handle for given pack GUID previously registered with the HII.\r
-\r
-Arguments:\r
- HiiProtocol - pointer to pointer to HII protocol interface. \r
- If NULL, the interface will be found but not returned.\r
- If it points to NULL, the interface will be found and \r
- written back to the pointer that is pointed to.\r
- Guid - The GUID of the pack that registered with the HII.\r
-\r
-Returns:\r
- Handle to the HII pack previously registered by the memory driver.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateSubTitleOpCode (\r
- IN STRING_REF StringToken,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a SubTitle opcode independent of string creation\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
- \r
-Arguments:\r
-\r
- StringToken - StringToken of the subtitle\r
- \r
- FormBuffer - Output of subtitle as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Subtitle created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateTextOpCode (\r
- IN STRING_REF StringToken,\r
- IN STRING_REF StringTokenTwo,\r
- IN STRING_REF StringTokenThree,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a Text opcode independent of string creation\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
- \r
-Arguments:\r
-\r
- StringToken - First string token of the text\r
- \r
- StringTokenTwo - Second string token of the text\r
- \r
- StringTokenThree - Help string token of the text\r
- \r
- Flags - Flag of the text\r
- \r
- Key - Key of the text\r
- \r
- FormBuffer - Output of text as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Text created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateGotoOpCode (\r
- IN UINT16 FormId,\r
- IN STRING_REF StringToken,\r
- IN STRING_REF StringTokenTwo,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a hyperlink opcode independent of string creation\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
- \r
-Arguments:\r
-\r
- FormId - Form ID of the hyperlink\r
- \r
- StringToken - Prompt string token of the hyperlink\r
- \r
- StringTokenTwo - Help string token of the hyperlink\r
- \r
- Flags - Flags of the hyperlink\r
- \r
- Key - Key of the hyperlink\r
- \r
- FormBuffer - Output of hyperlink as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Hyperlink created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOneOfOpCode (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN STRING_REF PromptToken,\r
- IN STRING_REF HelpToken,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINTN OptionCount,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
-\r
- OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken\r
- has been filled in since this routine will not generate StringToken values.\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the one-of box\r
- \r
- DataWidth - DataWidth of the one-of box\r
- \r
- PromptToken - Prompt string token of the one-of box\r
- \r
- HelpToken - Help string token of the one-of box\r
- \r
- OptionsList - Each string in it is an option of the one-of box\r
- \r
- OptionCount - Option string count\r
- \r
- FormBuffer - Output of One-Of box as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - One-Of box created to be a form\r
- \r
- EFI_DEVICE_ERROR - DataWidth > 2\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOrderedListOpCode (\r
- IN UINT16 QuestionId,\r
- IN UINT8 MaxEntries,\r
- IN STRING_REF PromptToken,\r
- IN STRING_REF HelpToken,\r
- IN IFR_OPTION *OptionsList,\r
- IN UINTN OptionCount,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
-\r
- OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken\r
- has been filled in since this routine will not generate StringToken values.\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the ordered list\r
- \r
- MaxEntries - MaxEntries of the ordered list\r
- \r
- PromptToken - Prompt string token of the ordered list\r
- \r
- HelpToken - Help string token of the ordered list\r
- \r
- OptionsList - Each string in it is an option of the ordered list\r
- \r
- OptionCount - Option string count\r
- \r
- FormBuffer - Output of ordered list as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Ordered list created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateCheckBoxOpCode (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN STRING_REF PromptToken,\r
- IN STRING_REF HelpToken,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a checkbox opcode independent of string creation\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the check box\r
- \r
- DataWidth - DataWidth of the check box\r
- \r
- PromptToken - Prompt string token of the check box\r
- \r
- HelpToken - Help string token of the check box\r
- \r
- Flags - Flags of the check box\r
- \r
- Key - Key of the check box\r
- \r
- FormBuffer - Output of the check box as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Checkbox created to be a form\r
- \r
- EFI_DEVICE_ERROR - DataWidth > 1\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateNumericOpCode (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN STRING_REF PromptToken,\r
- IN STRING_REF HelpToken,\r
- IN UINT16 Minimum,\r
- IN UINT16 Maximum,\r
- IN UINT16 Step,\r
- IN UINT16 Default,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a numeric opcode independent of string creation\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the numeric\r
- \r
- DataWidth - DataWidth of the numeric\r
- \r
- PromptToken - Prompt string token of the numeric\r
- \r
- HelpToken - Help string token of the numeric\r
- \r
- Minimum - Minumun boundary of the numeric\r
- \r
- Maximum - Maximum boundary of the numeric\r
- \r
- Step - Step of the numeric\r
- \r
- Default - Default value of the numeric\r
- \r
- Flags - Flags of the numeric\r
- \r
- Key - Key of the numeric\r
- \r
- FormBuffer - Output of the numeric as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - The numeric created to be a form.\r
- \r
- EFI_DEVICE_ERROR - DataWidth > 2\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateStringOpCode (\r
- IN UINT16 QuestionId,\r
- IN UINT8 DataWidth,\r
- IN STRING_REF PromptToken,\r
- IN STRING_REF HelpToken,\r
- IN UINT8 MinSize,\r
- IN UINT8 MaxSize,\r
- IN UINT8 Flags,\r
- IN UINT16 Key,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a numeric opcode independent of string creation\r
- This is used primarily by users who need to create just one particular valid op-code and the string\r
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label\r
- location to pre-defined forms in HII)\r
- \r
-Arguments:\r
-\r
- QuestionId - Question ID of the string\r
- \r
- DataWidth - DataWidth of the string\r
- \r
- PromptToken - Prompt token of the string\r
- \r
- HelpToken - Help token of the string\r
- \r
- MinSize - Min size boundary of the string\r
- \r
- MaxSize - Max size boundary of the string\r
- \r
- Flags - Flags of the string\r
- \r
- Key - Key of the string\r
- \r
- FormBuffer - Output of the string as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - String created to be a form.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-ValidateDataFromHiiHandle (\r
- IN EFI_HII_HANDLE HiiHandle,\r
- OUT BOOLEAN *Results\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Validate that the data associated with the HiiHandle in NVRAM is within\r
- the reasonable parameters for that FormSet. Values for strings and passwords\r
- are not verified due to their not having the equivalent of valid range settings.\r
- \r
-Arguments:\r
-\r
- HiiHandle - Handle of the HII database entry to query\r
-\r
- Results - If return Status is EFI_SUCCESS, Results provides valid data\r
- TRUE = NVRAM Data is within parameters\r
- FALSE = NVRAM Data is NOT within parameters\r
- \r
-Returns: \r
-\r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Data successfully validated\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateBannerOpCode (\r
- IN UINT16 Title,\r
- IN UINT16 LineNumber,\r
- IN UINT8 Alignment,\r
- IN OUT VOID *FormBuffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.\r
- \r
-Arguments:\r
-\r
- Title - Title of the banner\r
- \r
- LineNumber - LineNumber of the banner\r
- \r
- Alignment - Alignment of the banner\r
- \r
- FormBuffer - Output of banner as a form\r
- \r
-Returns: \r
-\r
- EFI_SUCCESS - Banner created to be a form.\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiLibHiiVariablePackGetMap (\r
- IN EFI_HII_VARIABLE_PACK *Pack, \r
- OUT CHAR16 **Name, OPTIONAL\r
- OUT EFI_GUID **Guid, OPTIONAL\r
- OUT UINT16 *Id, OPTIONAL\r
- OUT VOID **Var, OPTIONAL\r
- OUT UINTN *Size OPTIONAL\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
- Extracts a variable form a Pack.\r
-\r
-Arguments:\r
-\r
- Pack - List of variables\r
- Name - Name of the variable/map\r
- Guid - GUID of the variable/map\r
- Var - Pointer to the variable/map\r
- Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
- VOID.\r
-\r
---*/\r
-;\r
-\r
-UINTN\r
-EfiLibHiiVariablePackListGetMapCnt (\r
- IN EFI_HII_VARIABLE_PACK_LIST *List\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Finds a count of the variables/maps in the List.\r
-\r
-Arguments:\r
-\r
- List - List of variables\r
-\r
-Returns: \r
-\r
- Number of Map in the variable pack list.\r
-\r
---*/\r
-;\r
-\r
-typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (\r
- IN CHAR16 *Name,\r
- IN EFI_GUID *Guid,\r
- IN UINT16 Id,\r
- IN VOID *Var,\r
- IN UINTN Size\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
- type definition for the callback to be \r
- used with EfiLibHiiVariablePackListForEachVar().\r
-\r
-Arguments:\r
-\r
- Id - Variable/Map ID\r
- Name - Name of the variable/map\r
- Guid - GUID of the variable/map\r
- Var - Pointer to the variable/map\r
- Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
- VOID\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiLibHiiVariablePackListForEachVar (\r
- IN EFI_HII_VARIABLE_PACK_LIST *List,\r
- IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Will iterate all variable/maps as appearing \r
- in List and for each, it will call the Callback.\r
-\r
-Arguments:\r
-\r
- List - List of variables\r
- Callback - Routine to be called for each iterated variable.\r
-\r
-Returns: \r
-\r
- VOID\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapByIdx (\r
- IN UINTN Idx, \r
- IN EFI_HII_VARIABLE_PACK_LIST *List, \r
- OUT CHAR16 **Name, OPTIONAL\r
- OUT EFI_GUID **Guid, OPTIONAL\r
- OUT UINT16 *Id, OPTIONAL\r
- OUT VOID **Var,\r
- OUT UINTN *Size\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
- Finds a variable form List given \r
- the order number as appears in the List.\r
-\r
-Arguments:\r
-\r
- Idx - The index of the variable/map to retrieve\r
- List - List of variables\r
- Name - Name of the variable/map\r
- Guid - GUID of the variable/map\r
- Var - Pointer to the variable/map\r
- Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Variable is found, OUT parameters are valid\r
- EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapById (\r
- IN UINT16 Id, \r
- IN EFI_HII_VARIABLE_PACK_LIST *List,\r
- OUT CHAR16 **Name, OPTIONAL\r
- OUT EFI_GUID **Guid, OPTIONAL\r
- OUT VOID **Var,\r
- OUT UINTN *Size\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
- Finds a variable form List given the \r
- order number as appears in the List.\r
-\r
-Arguments:\r
-\r
- Id - The ID of the variable/map to retrieve\r
- List - List of variables\r
- Name - Name of the variable/map\r
- Guid - GUID of the variable/map\r
- Var - Pointer to the variable/map\r
- Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Variable is found, OUT parameters are valid\r
- EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMap (\r
- IN EFI_HII_VARIABLE_PACK_LIST *List,\r
- IN CHAR16 *Name,\r
- IN EFI_GUID *Guid,\r
- OUT UINT16 *Id,\r
- OUT VOID **Var, \r
- OUT UINTN *Size\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
- Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
-\r
-Arguments:\r
-\r
- List - List of variables\r
- Name - Name of the variable/map to be found\r
- Guid - GUID of the variable/map to be found\r
- Var - Pointer to the variable/map found\r
- Size - Size of the variable/map in bytes found\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - variable is found, OUT parameters are valid\r
- EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableRetrieveFromNv (\r
- IN CHAR16 *Name,\r
- IN EFI_GUID *Guid,\r
- IN UINTN Size,\r
- OUT VOID **Var\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Finds out if a variable of specific Name/Guid/Size exists in NV. \r
- If it does, it will retrieve it into the Var. \r
-\r
-Arguments:\r
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
- Var - Variable will be retrieved into buffer pointed by this pointer.\r
- If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
-Returns:\r
- EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.\r
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-;\r
-\r
-////\r
-//// Variable override support.\r
-////\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideIfSuffix (\r
- IN CHAR16 *Suffix,\r
- IN CHAR16 *Name,\r
- IN EFI_GUID *Guid,\r
- IN UINTN Size,\r
- OUT VOID *Var\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
- Overrrides the variable with NV data if found.\r
- But it only does it if the Name ends with specified Suffix.\r
- For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
- the Suffix matches the end of Name, so the variable will be loaded from NV\r
- provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
- Suffix - Suffix the Name should end with.\r
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
- Var - Variable will be retrieved into this buffer.\r
- Caller is responsible for providing storage of exactly Size size in bytes.\r
-Returns:\r
- EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.\r
- EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.\r
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideBySuffix (\r
- IN CHAR16 *Suffix,\r
- IN CHAR16 *Name,\r
- IN EFI_GUID *Guid,\r
- IN UINTN Size,\r
- OUT VOID *Var\r
- ) \r
-/*++\r
-\r
-Routine Description:\r
- Overrrides the variable with NV data if found.\r
- But it only does it if the NV contains the same variable with Name is appended with Suffix. \r
- For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
- the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
- will be loaded from NV provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
- Suffix - Suffix the variable will be appended with.\r
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
- Var - Variable will be retrieved into this buffer.\r
- Caller is responsible for providing storage of exactly Size size in bytes.\r
-\r
-Returns:\r
- EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.\r
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.\r
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-;\r
-\r
-#endif\r
+/** @file
+ The file contain all library functions and definitions for IFR opcode creation and
+ related Form Browser utility Operations.
+
+ Copyright (c) 2007 - 2008, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IFR_SUPPORT_LIBRARY_H_
+#define _IFR_SUPPORT_LIBRARY_H_
+
+
+#include <Protocol/HiiFont.h>
+#include <Protocol/HiiImage.h>
+#include <Protocol/HiiString.h>
+#include <Protocol/HiiDatabase.h>
+#include <Protocol/HiiConfigRouting.h>
+#include <Protocol/HiiConfigAccess.h>
+#include <Protocol/FormBrowser2.h>
+#include <Protocol/SimpleTextOut.h>
+
+#include <Guid/GlobalVariable.h>
+
+//
+// The architectural variable "Lang" and "LangCodes" are deprecated in UEFI
+// specification. While, UEFI specification also states that these deprecated
+// variables may be provided for backwards compatibility.
+
+#define EFI_LANGUAGE_VARIABLE L"Lang"
+#define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"
+
+#define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
+#define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
+
+//
+// Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
+// (42 characters plus a NULL terminator)
+//
+#define RFC_3066_ENTRY_SIZE (42 + 1)
+#define ISO_639_2_ENTRY_SIZE 3
+
+#define INVALID_VARSTORE_ID 0
+
+#define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)
+#define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)
+
+extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;
+extern EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;
+
+#pragma pack(1)
+typedef struct {
+ EFI_STRING_ID StringToken;
+ EFI_IFR_TYPE_VALUE Value;
+ UINT8 Flags;
+} IFR_OPTION;
+#pragma pack()
+
+typedef struct {
+ ///
+ /// Buffer size allocated for Data.
+ ///
+ UINT32 BufferSize;
+
+ ///
+ /// Offset in Data to append the newly created opcode binary.
+ /// It will be adjusted automatically in Create***OpCode(), and should be
+ /// initialized to 0 before invocation of a serial of Create***OpCode()
+ ///
+ UINT32 Offset;
+
+ ///
+ /// The destination buffer for created op-codes
+ ///
+ UINT8 *Data;
+} EFI_HII_UPDATE_DATA;
+
+
+/**
+ Create EFI_IFR_END_OP opcode.
+
+ If Data is NULL or Data->Data is NULL, then ASSERT.
+
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateEndOpCode (
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_DEFAULT_OP opcode.
+
+ @param Value Value for the default
+ @param Type Type for the default
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER The type is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateDefaultOpCode (
+ IN EFI_IFR_TYPE_VALUE *Value,
+ IN UINT8 Type,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_ACTION_OP opcode.
+
+ @param QuestionId Question ID
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param QuestionConfig String ID for configuration
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateActionOpCode (
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN EFI_STRING_ID QuestionConfig,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_SUBTITLE_OP opcode.
+
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param Flags Subtitle opcode flags
+ @param Scope Subtitle Scope bit
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateSubTitleOpCode (
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 Flags,
+ IN UINT8 Scope,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_TEXT_OP opcode.
+
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param TextTwo String ID for text two
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateTextOpCode (
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN EFI_STRING_ID TextTwo,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_REF_OP opcode.
+
+ @param FormId Destination Form ID
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param QuestionId Question ID
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateGotoOpCode (
+ IN EFI_FORM_ID FormId,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN EFI_QUESTION_ID QuestionId,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_ONE_OF_OPTION_OP opcode.
+
+ @param OptionCount The number of options.
+ @param OptionsList The list of Options.
+ @param Type The data type.
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateOneOfOptionOpCode (
+ IN UINTN OptionCount,
+ IN IFR_OPTION *OptionsList,
+ IN UINT8 Type,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_ONE_OF_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param OneOfFlags Flags for oneof opcode
+ @param OptionsList List of options
+ @param OptionCount Number of options in option list
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateOneOfOpCode (
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 OneOfFlags,
+ IN IFR_OPTION *OptionsList,
+ IN UINTN OptionCount,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_ORDERED_LIST_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param OrderedListFlags Flags for ordered list opcode
+ @param DataType Type for option value
+ @param MaxContainers Maximum count for options in this ordered list
+ @param OptionsList List of options
+ @param OptionCount Number of options in option list
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateOrderedListOpCode (
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 OrderedListFlags,
+ IN UINT8 DataType,
+ IN UINT8 MaxContainers,
+ IN IFR_OPTION *OptionsList,
+ IN UINTN OptionCount,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_CHECKBOX_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param CheckBoxFlags Flags for checkbox opcode
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateCheckBoxOpCode (
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 CheckBoxFlags,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_NUMERIC_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param NumericFlags Flags for numeric opcode
+ @param Minimum Numeric minimum value
+ @param Maximum Numeric maximum value
+ @param Step Numeric step for edit
+ @param Default Numeric default value
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateNumericOpCode (
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 NumericFlags,
+ IN UINT64 Minimum,
+ IN UINT64 Maximum,
+ IN UINT64 Step,
+ IN UINT64 Default,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Create EFI_IFR_STRING_OP opcode.
+
+ @param QuestionId Question ID
+ @param VarStoreId Storage ID
+ @param VarOffset Offset in Storage
+ @param Prompt String ID for Prompt
+ @param Help String ID for Help
+ @param QuestionFlags Flags in Question Header
+ @param StringFlags Flags for string opcode
+ @param MinSize String minimum length
+ @param MaxSize String maximum length
+ @param Data Destination for the created opcode binary
+
+ @retval EFI_SUCCESS Opcode create success
+ @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
+ @retval EFI_INVALID_PARAMETER If QuestionFlags is not valid.
+
+**/
+EFI_STATUS
+EFIAPI
+CreateStringOpCode (
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 StringFlags,
+ IN UINT8 MinSize,
+ IN UINT8 MaxSize,
+ IN OUT EFI_HII_UPDATE_DATA *Data
+ )
+;
+
+/**
+ Converts the unicode character of the string from uppercase to lowercase.
+
+ @param Str String to be converted
+
+
+**/
+VOID
+EFIAPI
+ToLower (
+ IN OUT CHAR16 *Str
+ )
+;
+
+/**
+ Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
+
+ @param Str String for output
+ @param Buffer Binary buffer.
+ @param BufferSize Size of the buffer in bytes.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+BufferToHexString (
+ IN OUT CHAR16 *Str,
+ IN UINT8 *Buffer,
+ IN UINTN BufferSize
+ )
+;
+
+/**
+ Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
+
+ @param Buffer Pointer to buffer that receives the data.
+ @param BufferSize Length in bytes of the buffer to hold converted
+ data. If routine return with EFI_SUCCESS,
+ containing length of converted data. If routine
+ return with EFI_BUFFER_TOO_SMALL, containg length
+ of buffer desired.
+ @param Str String to be converted from.
+
+ @retval EFI_SUCCESS The function completed successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+HexStringToBuffer (
+ IN OUT UINT8 *Buffer,
+ IN OUT UINTN *BufferSize,
+ IN CHAR16 *Str
+ )
+;
+
+/**
+ Convert binary representation Config string (e.g. "0041004200430044") to the
+ original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
+ "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
+
+ @param UnicodeString Original Unicode string.
+ @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.
+ Includes tailing '\0' character.
+ On output:
+ If return EFI_SUCCESS, containing length of Unicode string buffer.
+ If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
+ @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+
+
+ @retval EFI_SUCCESS Routine success.
+ @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+ConfigStringToUnicode (
+ IN OUT CHAR16 *UnicodeString,
+ IN OUT UINTN *StrBufferLen,
+ IN CHAR16 *ConfigString
+ )
+;
+
+/**
+ Convert Unicode string to binary representation Config string, e.g.
+ "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
+ "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
+
+ @param ConfigString Binary representation of Unicode String, <string> := (<HexCh>4)+
+ @param StrBufferLen On input: Length in bytes of buffer to hold the Unicode string.
+ Includes tailing '\0' character.
+ On output:
+ If return EFI_SUCCESS, containing length of Unicode string buffer.
+ If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
+ @param UnicodeString Original Unicode string.
+
+ @retval EFI_SUCCESS Routine success.
+ @retval EFI_BUFFER_TOO_SMALL The string buffer is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+UnicodeToConfigString (
+ IN OUT CHAR16 *ConfigString,
+ IN OUT UINTN *StrBufferLen,
+ IN CHAR16 *UnicodeString
+ )
+;
+
+/**
+ Construct <ConfigHdr> using routing information GUID/NAME/PATH.
+
+ @param ConfigHdr Pointer to the ConfigHdr string.
+ @param StrBufferLen On input: Length in bytes of buffer to hold the
+ ConfigHdr string. Includes tailing '\0' character.
+ On output: If return EFI_SUCCESS, containing
+ length of ConfigHdr string buffer. If return
+ EFI_BUFFER_TOO_SMALL, containg length of string
+ buffer desired.
+ @param Guid Routing information: GUID.
+ @param Name Routing information: NAME.
+ @param DriverHandle Driver handle which contains the routing
+ information: PATH.
+
+ @retval EFI_SUCCESS Routine success.
+ @retval EFI_BUFFER_TOO_SMALL The ConfigHdr string buffer is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+ConstructConfigHdr (
+ IN OUT CHAR16 *ConfigHdr,
+ IN OUT UINTN *StrBufferLen,
+ IN EFI_GUID *Guid,
+ IN CHAR16 *Name, OPTIONAL
+ IN EFI_HANDLE *DriverHandle
+ )
+
+;
+
+/**
+ Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
+
+ @param String The string to be searched in.
+ @param Offset Offset in BlockName.
+ @param Width Width in BlockName.
+
+ @retval TRUE Block name found.
+ @retval FALSE Block name not found.
+
+**/
+BOOLEAN
+EFIAPI
+FindBlockName (
+ IN OUT CHAR16 *String,
+ UINTN Offset,
+ UINTN Width
+ )
+;
+
+/**
+ This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
+
+ @param VariableGuid An optional field to indicate the target variable
+ GUID name to use.
+ @param VariableName An optional field to indicate the target
+ human-readable variable name.
+ @param BufferSize On input: Length in bytes of buffer to hold
+ retrived data. On output: If return
+ EFI_BUFFER_TOO_SMALL, containg length of buffer
+ desired.
+ @param Buffer Buffer to hold retrived data.
+
+ @retval EFI_SUCCESS Routine success.
+ @retval EFI_BUFFER_TOO_SMALL The intput buffer is too small.
+
+**/
+EFI_STATUS
+EFIAPI
+GetBrowserData (
+ EFI_GUID *VariableGuid, OPTIONAL
+ CHAR16 *VariableName, OPTIONAL
+ UINTN *BufferSize,
+ UINT8 *Buffer
+ )
+;
+
+/**
+ This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
+
+ @param VariableGuid An optional field to indicate the target variable
+ GUID name to use.
+ @param VariableName An optional field to indicate the target
+ human-readable variable name.
+ @param BufferSize Length in bytes of buffer to hold retrived data.
+ @param Buffer Buffer to hold retrived data.
+ @param RequestElement An optional field to specify which part of the
+ buffer data will be send back to Browser. If NULL,
+ the whole buffer of data will be committed to
+ Browser. <RequestElement> ::=
+ &OFFSET=<Number>&WIDTH=<Number>*
+
+ @retval EFI_SUCCESS Routine success.
+ @retval Other Updating Browser uncommitted data failed.
+
+**/
+EFI_STATUS
+EFIAPI
+SetBrowserData (
+ EFI_GUID *VariableGuid, OPTIONAL
+ CHAR16 *VariableName, OPTIONAL
+ UINTN BufferSize,
+ UINT8 *Buffer,
+ CHAR16 *RequestElement OPTIONAL
+ )
+;
+
+/**
+ Draw a dialog and return the selected key.
+
+ @param NumberOfLines The number of lines for the dialog box
+ @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
+ @param String Pointer to the first string in the list
+ @param ... A series of (quantity == NumberOfLines - 1) text
+ strings which will be used to construct the dialog
+ box
+
+ @retval EFI_SUCCESS Displayed dialog and received user interaction
+ @retval EFI_INVALID_PARAMETER One of the parameters was invalid.
+
+**/
+EFI_STATUS
+EFIAPI
+IfrLibCreatePopUp (
+ IN UINTN NumberOfLines,
+ OUT EFI_INPUT_KEY *KeyValue,
+ IN CHAR16 *String,
+ ...
+ )
+;
+
+/**
+ Draw a dialog and return the selected key using Variable Argument List.
+
+ @param NumberOfLines The number of lines for the dialog box
+ @param KeyValue The EFI_KEY value returned if HotKey is TRUE..
+ @param String Pointer to the first string in the list
+ @param Args VA_LIST marker for the variable argument list.
+ A series of (quantity == NumberOfLines - 1) text
+ strings which will be used to construct the dialog
+ box
+
+ @retval EFI_SUCCESS Displayed dialog and received user interaction
+ @retval EFI_INVALID_PARAMETER One of the parameters was invalid.
+
+**/
+EFI_STATUS
+EFIAPI
+IfrLibCreatePopUp2 (
+ IN UINTN NumberOfLines,
+ OUT EFI_INPUT_KEY *KeyValue,
+ IN VA_LIST Args
+ )
+;
+
+#endif