Clean up ExtendedHiiLib, HiiLib, IfrSupportLib, ExtendedIfrSupportLib for Doxygen comments requirement.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5458 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#/** @file
|
||||
# Component name for module UefiEfiIfrSupportLib
|
||||
#Utility functions which helps in opcode creation, HII configuration string manipulations,
|
||||
#pop up window creations, setup browser persistence data set and get.
|
||||
#
|
||||
# FIX ME!
|
||||
# Copyright (c) 2007, Intel Corporation. All rights reserved.
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
|
@@ -1,6 +1,8 @@
|
||||
/** @file
|
||||
Utility functions which helps in opcode creation, HII configuration string manipulations,
|
||||
pop up window creations, setup browser persistence data set and get.
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
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
|
||||
@@ -9,15 +11,6 @@ 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
UefiIfrCommon.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Common Library Routines to assist handle HII elements.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
#include "UefiIfrLibraryInternal.h"
|
||||
@@ -26,6 +19,17 @@ EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;
|
||||
EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;
|
||||
|
||||
|
||||
/**
|
||||
IfrSupportLib's constructor. It locates the required protocol:
|
||||
gEfiHiiDatabaseProtocolGuid and gEfiHiiStringProtocolGuid.
|
||||
|
||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||
|
||||
@param SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS This function always completes successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IfrSupportLibConstructor (
|
||||
|
@@ -1,4 +1,6 @@
|
||||
/** @file
|
||||
Utility functions which helps in opcode creation, HII configuration string manipulations,
|
||||
pop up window creations, setup browser persistence data set and get.
|
||||
|
||||
Copyright (c) 2007- 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
@@ -9,15 +11,6 @@ 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
UefiIfrForm.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Common Library Routines to assist handle HII elements.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
#include "UefiIfrLibraryInternal.h"
|
||||
@@ -223,7 +216,7 @@ IfrLibCreatePopUp (
|
||||
|
||||
|
||||
/**
|
||||
Swap bytes in the buffer.
|
||||
Swap bytes in the buffer. This is a internal function.
|
||||
|
||||
@param Buffer Binary buffer.
|
||||
@param BufferSize Size of the buffer in bytes.
|
||||
@@ -231,7 +224,6 @@ IfrLibCreatePopUp (
|
||||
@return None.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
SwapBuffer (
|
||||
IN OUT UINT8 *Buffer,
|
||||
@@ -252,11 +244,10 @@ SwapBuffer (
|
||||
|
||||
/**
|
||||
Converts the unicode character of the string from uppercase to lowercase.
|
||||
This is a internal function.
|
||||
|
||||
@param Str String to be converted
|
||||
|
||||
@retval VOID
|
||||
|
||||
**/
|
||||
VOID
|
||||
ToLower (
|
||||
|
@@ -1,4 +1,6 @@
|
||||
/** @file
|
||||
Utility functions which helps in opcode creation, HII configuration string manipulations,
|
||||
pop up window creations, setup browser persistence data set and get.
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
@@ -9,19 +11,11 @@ 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
UefiIfrLibraryInternal
|
||||
|
||||
Abstract:
|
||||
|
||||
The file contain all library function for Ifr Operations.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _IFRLIBRARY_INTERNAL_H
|
||||
#define _IFRLIBRARY_INTERNAL_H
|
||||
#ifndef _IFRLIBRARY_INTERNAL_H_
|
||||
#define _IFRLIBRARY_INTERNAL_H_
|
||||
|
||||
|
||||
#include <PiDxe.h>
|
||||
@@ -41,3 +35,4 @@ Abstract:
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
/** @file
|
||||
Library Routines to create IFR independent of string data - assume tokens already exist
|
||||
Primarily to be used for exporting op-codes at a label in pre-defined forms.
|
||||
|
||||
|
||||
Copyright (c) 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
@@ -9,32 +12,40 @@ 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
UefiIfrOpCodeCreation.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Library Routines to create IFR independent of string data - assume tokens already exist
|
||||
Primarily to be used for exporting op-codes at a label in pre-defined forms.
|
||||
|
||||
Revision History:
|
||||
|
||||
|
||||
**/
|
||||
|
||||
#include "UefiIfrLibraryInternal.h"
|
||||
|
||||
STATIC
|
||||
/**
|
||||
Check if the input question flags is a valid value.
|
||||
The valid combination of question flags includes
|
||||
EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY.
|
||||
|
||||
@param Flags The question flags to check.
|
||||
|
||||
@retval TRUE If the question flag is a valid combination.
|
||||
@retval FALSE If the question flag is an invalid combination.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidQuestionFlags (
|
||||
IN UINT8 Flags
|
||||
)
|
||||
{
|
||||
return (BOOLEAN) ((Flags & (~QUESTION_FLAGS)) ? FALSE : TRUE);
|
||||
return (BOOLEAN) (((Flags & (~QUESTION_FLAGS)) != 0) ? FALSE : TRUE);
|
||||
}
|
||||
|
||||
STATIC
|
||||
/**
|
||||
Check if the input value type is a valid type.
|
||||
The valid value type is smaller or equal than EFI_IFR_TYPE_OTHER.
|
||||
|
||||
@param Type The value type to check.
|
||||
|
||||
@retval TRUE If the value type is valid.
|
||||
@retval FALSE If the value type is invalid.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidValueType (
|
||||
IN UINT8 Type
|
||||
@@ -43,13 +54,21 @@ IsValidValueType (
|
||||
return (BOOLEAN) ((Type <= EFI_IFR_TYPE_OTHER) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
STATIC
|
||||
/**
|
||||
Check if the input numeric flags is a valid value.
|
||||
|
||||
@param Flags The numeric flags to check.
|
||||
|
||||
@retval TRUE If the numeric flags is valid.
|
||||
@retval FALSE If the numeric flags is invalid.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidNumricFlags (
|
||||
IN UINT8 Flags
|
||||
)
|
||||
{
|
||||
if (Flags & ~(EFI_IFR_NUMERIC_SIZE | EFI_IFR_DISPLAY)) {
|
||||
if ((Flags & ~(EFI_IFR_NUMERIC_SIZE | EFI_IFR_DISPLAY)) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -60,7 +79,15 @@ IsValidNumricFlags (
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
STATIC
|
||||
/**
|
||||
Check if the checkbox flags is a valid value.
|
||||
|
||||
@param Flags The checkbox flags to check.
|
||||
|
||||
@retval TRUE If the checkbox flags is valid.
|
||||
@retval FALSE If the checkbox flags is invalid.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsValidCheckboxFlags (
|
||||
IN UINT8 Flags
|
||||
@@ -69,6 +96,17 @@ IsValidCheckboxFlags (
|
||||
return (BOOLEAN) ((Flags <= EFI_IFR_CHECKBOX_DEFAULT_MFG) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -95,6 +133,18 @@ CreateEndOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -130,6 +180,21 @@ CreateDefaultOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -171,6 +236,19 @@ CreateActionOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -205,6 +283,18 @@ CreateSubTitleOpCode (
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -237,6 +327,21 @@ CreateTextOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -278,6 +383,18 @@ CreateGotoOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -319,6 +436,25 @@ CreateOneOfOptionOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -374,6 +510,27 @@ CreateOneOfOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -436,6 +593,23 @@ CreateOrderedListOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -480,6 +654,27 @@ CreateCheckBoxOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -567,6 +762,25 @@ CreateNumericOpCode (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
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 (
|
||||
@@ -587,7 +801,7 @@ CreateStringOpCode (
|
||||
|
||||
ASSERT (Data != NULL && Data->Data != NULL);
|
||||
|
||||
if (!IsValidQuestionFlags (QuestionFlags) || (StringFlags & (~EFI_IFR_STRING_MULTI_LINE))) {
|
||||
if (!IsValidQuestionFlags (QuestionFlags) || (StringFlags & ~EFI_IFR_STRING_MULTI_LINE) != 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user