TianoCore EDK2 master
Loading...
Searching...
No Matches
ProcessOptions.c File Reference
#include "FormDisplay.h"

Go to the source code of this file.

Macros

#define MAX_TIME_OUT_LEN   0x10
 

Functions

VOID NewStrCat (IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CHAR16 *Source)
 
UINT64 HiiValueToUINT64 (IN EFI_HII_VALUE *Value)
 
BOOLEAN IsTypeInBuffer (IN EFI_HII_VALUE *Value)
 
BOOLEAN IsTypeInUINT64 (IN EFI_HII_VALUE *Value)
 
VOID GetBufAndLenForValue (IN EFI_HII_VALUE *Value, OUT UINT8 **Buf, OUT UINT16 *BufLen)
 
EFI_STATUS CompareHiiValue (IN EFI_HII_VALUE *Value1, IN EFI_HII_VALUE *Value2, OUT INTN *Result, IN EFI_HII_HANDLE HiiHandle OPTIONAL)
 
DISPLAY_QUESTION_OPTIONValueToOption (IN FORM_DISPLAY_ENGINE_STATEMENT *Question, IN EFI_HII_VALUE *OptionValue)
 
UINT64 GetArrayData (IN VOID *Array, IN UINT8 Type, IN UINTN Index)
 
VOID SetArrayData (IN VOID *Array, IN UINT8 Type, IN UINTN Index, IN UINT64 Value)
 
BOOLEAN FindArrayData (IN VOID *Array, IN UINT8 Type, IN UINT64 Value, OUT UINTN *Index OPTIONAL)
 
EFI_STATUS PrintFormattedNumber (IN FORM_DISPLAY_ENGINE_STATEMENT *Question, IN OUT CHAR16 *FormattedNumber, IN UINTN BufferSize)
 
VOID CreateSharedPopUp (IN UINTN RequestedWidth, IN UINTN NumberOfLines, IN VA_LIST Marker)
 
VOID EFIAPI CreateMultiStringPopUp (IN UINTN RequestedWidth, IN UINTN NumberOfLines,...)
 
VOID EFIAPI EmptyEventProcess (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI RefreshTimeOutProcess (IN EFI_EVENT Event, IN VOID *Context)
 
VOID PasswordInvalid (VOID)
 
EFI_STATUS PasswordProcess (IN UI_MENU_OPTION *MenuOption)
 
VOID PrintMismatchMenuInfo (IN UI_MENU_OPTION *MenuOption)
 
EFI_STATUS ProcessOptions (IN UI_MENU_OPTION *MenuOption, IN BOOLEAN Selected, OUT CHAR16 **OptionString, IN BOOLEAN SkipErrorValue)
 
UINTN ProcessHelpString (IN CHAR16 *StringPtr, OUT CHAR16 **FormattedString, OUT UINT16 *EachLineWidth, IN UINTN RowCount)
 

Detailed Description

Implementation for handling the User Interface option processing.

Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ProcessOptions.c.

Macro Definition Documentation

◆ MAX_TIME_OUT_LEN

#define MAX_TIME_OUT_LEN   0x10

Definition at line 12 of file ProcessOptions.c.

Function Documentation

◆ CompareHiiValue()

EFI_STATUS CompareHiiValue ( IN EFI_HII_VALUE Value1,
IN EFI_HII_VALUE Value2,
OUT INTN Result,
IN EFI_HII_HANDLE HiiHandle  OPTIONAL 
)

Compare two Hii value.

Parameters
Value1Expression value to compare on left-hand.
Value2Expression value to compare on right-hand.
ResultReturn value after compare. retval 0 Two operators equal. return Positive value if Value1 is greater than Value2. retval Negative value if Value1 is less than Value2.
HiiHandleOnly required for string compare.
Return values
otherCould not perform compare on two values.
EFI_SUCCESSCompare the value success.

Definition at line 214 of file ProcessOptions.c.

◆ CreateMultiStringPopUp()

VOID EFIAPI CreateMultiStringPopUp ( IN UINTN  RequestedWidth,
IN UINTN  NumberOfLines,
  ... 
)

Draw a pop up windows based on the dimension, number of lines and strings specified.

Parameters
RequestedWidthThe width of the pop-up.
NumberOfLinesThe number of lines.
...A series of text strings that displayed in the pop-up.

Definition at line 689 of file ProcessOptions.c.

◆ CreateSharedPopUp()

VOID CreateSharedPopUp ( IN UINTN  RequestedWidth,
IN UINTN  NumberOfLines,
IN VA_LIST  Marker 
)

Draw a pop up windows based on the dimension, number of lines and strings specified.

Parameters
RequestedWidthThe width of the pop-up.
NumberOfLinesThe number of lines.
MarkerThe variable argument list for the list of string to be printed.

Definition at line 583 of file ProcessOptions.c.

◆ EmptyEventProcess()

VOID EFIAPI EmptyEventProcess ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Process nothing.

Parameters
EventThe Event need to be process
ContextThe context of the event.

Definition at line 713 of file ProcessOptions.c.

◆ FindArrayData()

BOOLEAN FindArrayData ( IN VOID *  Array,
IN UINT8  Type,
IN UINT64  Value,
OUT UINTN *Index  OPTIONAL 
)

Check whether this value already in the array, if yes, return the index.

Parameters
ArrayThe data array.
TypeType of the data in this array.
ValueThe value to be find.
IndexThe index in the array which has same value with Value.
Return values
TRUEFound the value in the array.
FALSENot found the value.

Definition at line 443 of file ProcessOptions.c.

◆ GetArrayData()

UINT64 GetArrayData ( IN VOID *  Array,
IN UINT8  Type,
IN UINTN  Index 
)

Return data element in an Array by its Index.

Parameters
ArrayThe data array.
TypeType of the data in this array.
IndexZero based index for data in this array.
Return values
ValueThe data to be returned

Definition at line 354 of file ProcessOptions.c.

◆ GetBufAndLenForValue()

VOID GetBufAndLenForValue ( IN EFI_HII_VALUE Value,
OUT UINT8 **  Buf,
OUT UINT16 *  BufLen 
)

Return the buffer length and buffer pointer for this value.

EFI_IFR_TYPE_REF, EFI_IFR_TYPE_DATE and EFI_IFR_TYPE_TIME are converted to EFI_IFR_TYPE_BUFFER when do the value compare.

Parameters
ValueExpression value to compare on.
BufReturn the buffer pointer.
BufLenReturn the buffer length.

Definition at line 165 of file ProcessOptions.c.

◆ HiiValueToUINT64()

UINT64 HiiValueToUINT64 ( IN EFI_HII_VALUE Value)

Get UINT64 type value.

Parameters
ValueInput Hii value.
Return values
UINT64Return the UINT64 type value.

Definition at line 56 of file ProcessOptions.c.

◆ IsTypeInBuffer()

BOOLEAN IsTypeInBuffer ( IN EFI_HII_VALUE Value)

Check whether this value type can be transfer to EFI_IFR_TYPE_BUFFER type.

EFI_IFR_TYPE_REF, EFI_IFR_TYPE_DATE and EFI_IFR_TYPE_TIME are converted to EFI_IFR_TYPE_BUFFER when do the value compare.

Parameters
ValueExpression value to compare on.
Return values
TRUEThis value type can be transter to EFI_IFR_TYPE_BUFFER type.
FALSEThis value type can't be transter to EFI_IFR_TYPE_BUFFER type.

Definition at line 110 of file ProcessOptions.c.

◆ IsTypeInUINT64()

BOOLEAN IsTypeInUINT64 ( IN EFI_HII_VALUE Value)

Check whether this value type can be transfer to EFI_IFR_TYPE_UINT64

Parameters
ValueExpression value to compare on.
Return values
TRUEThis value type can be transter to EFI_IFR_TYPE_BUFFER type.
FALSEThis value type can't be transter to EFI_IFR_TYPE_BUFFER type.

Definition at line 136 of file ProcessOptions.c.

◆ NewStrCat()

VOID NewStrCat ( IN OUT CHAR16 *  Destination,
IN UINTN  DestMax,
IN CHAR16 *  Source 
)

Concatenate a narrow string to another string.

Parameters
DestinationThe destination string.
DestMaxThe Max length of destination string.
SourceThe source string. The string to be concatenated. to the end of Destination.

Definition at line 24 of file ProcessOptions.c.

◆ PasswordInvalid()

VOID PasswordInvalid ( VOID  )

Display error message for invalid password.

Definition at line 758 of file ProcessOptions.c.

◆ PasswordProcess()

EFI_STATUS PasswordProcess ( IN UI_MENU_OPTION MenuOption)

Process password op code.

Parameters
MenuOptionThe menu for current password op code.
Return values
EFI_SUCCESSQuestion Option process success.
OtherQuestion Option process fail.

Definition at line 782 of file ProcessOptions.c.

◆ PrintFormattedNumber()

EFI_STATUS PrintFormattedNumber ( IN FORM_DISPLAY_ENGINE_STATEMENT Question,
IN OUT CHAR16 *  FormattedNumber,
IN UINTN  BufferSize 
)

Print Question Value according to it's storage width and display attributes.

Parameters
QuestionThe Question to be printed.
FormattedNumberBuffer for output string.
BufferSizeThe FormattedNumber buffer size in bytes.
Return values
EFI_SUCCESSPrint success.
EFI_BUFFER_TOO_SMALLBuffer size is not enough for formatted number.

Definition at line 508 of file ProcessOptions.c.

◆ PrintMismatchMenuInfo()

VOID PrintMismatchMenuInfo ( IN UI_MENU_OPTION MenuOption)

Print some debug message about mismatched menu info.

Parameters
MenuOptionThe MenuOption for this Question.

Definition at line 926 of file ProcessOptions.c.

◆ ProcessHelpString()

UINTN ProcessHelpString ( IN CHAR16 *  StringPtr,
OUT CHAR16 **  FormattedString,
OUT UINT16 *  EachLineWidth,
IN UINTN  RowCount 
)

Process the help string: Split StringPtr to several lines of strings stored in FormattedString and the glyph width of each line cannot exceed gHelpBlockWidth.

Parameters
StringPtrThe entire help string.
FormattedStringThe oupput formatted string.
EachLineWidthThe max string length of each line in the formatted string.
RowCountTRUE: if Question is selected.

Definition at line 1560 of file ProcessOptions.c.

◆ ProcessOptions()

EFI_STATUS ProcessOptions ( IN UI_MENU_OPTION MenuOption,
IN BOOLEAN  Selected,
OUT CHAR16 **  OptionString,
IN BOOLEAN  SkipErrorValue 
)

Process a Question's Option (whether selected or un-selected).

Parameters
MenuOptionThe MenuOption for this Question.
SelectedTRUE: if Question is selected.
OptionStringPointer of the Option String to be displayed.
SkipErrorValueWhether need to return when value without option for it.
Return values
EFI_SUCCESSQuestion Option process success.
OtherQuestion Option process fail.

Definition at line 1044 of file ProcessOptions.c.

◆ RefreshTimeOutProcess()

VOID EFIAPI RefreshTimeOutProcess ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Process for the refresh interval statement.

Parameters
EventThe Event need to be process
ContextThe context of the event.

Definition at line 729 of file ProcessOptions.c.

◆ SetArrayData()

VOID SetArrayData ( IN VOID *  Array,
IN UINT8  Type,
IN UINTN  Index,
IN UINT64  Value 
)

Set value of a data element in an Array by its Index.

Parameters
ArrayThe data array.
TypeType of the data in this array.
IndexZero based index for data in this array.
ValueThe value to be set.

Definition at line 399 of file ProcessOptions.c.

◆ ValueToOption()

DISPLAY_QUESTION_OPTION * ValueToOption ( IN FORM_DISPLAY_ENGINE_STATEMENT Question,
IN EFI_HII_VALUE OptionValue 
)

Search an Option of a Question by its value.

Parameters
QuestionThe Question
OptionValueValue for Option to be searched.
Return values
PointerPointer to the found Option.
NULLOption not found.

Definition at line 315 of file ProcessOptions.c.