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

Go to the source code of this file.

Functions

VOID GetFieldFromOp (IN EFI_IFR_OP_HEADER *OpCode, OUT UINTN *Minimum, OUT UINTN *Maximum)
 
EFI_STATUS ReadString (IN UI_MENU_OPTION *MenuOption, IN CHAR16 *Prompt, IN OUT CHAR16 *StringPtr)
 
VOID AdjustQuestionValue (IN EFI_HII_VALUE *QuestionValue, IN UINT8 Sequence)
 
VOID GetValueFromNum (IN EFI_IFR_OP_HEADER *OpCode, IN BOOLEAN IntInput, IN EFI_HII_VALUE *QuestionValue, OUT UINT64 *Value, OUT UINT64 *Minimum, OUT UINT64 *Maximum, OUT UINT64 *Step, OUT UINT16 *StorageWidth)
 
EFI_STATUS GetNumericInput (IN UI_MENU_OPTION *MenuOption)
 
EFI_STATUS AdjustOptionOrder (IN FORM_DISPLAY_ENGINE_STATEMENT *Question, OUT UINTN *PopUpMenuLines)
 
BOOLEAN IsValuesEqual (IN EFI_IFR_TYPE_VALUE *Value1, IN EFI_IFR_TYPE_VALUE *Value2, IN UINT8 Type)
 
VOID SetValuesByType (OUT EFI_IFR_TYPE_VALUE *Dest, IN EFI_IFR_TYPE_VALUE *Source, IN UINT8 Type)
 
EFI_STATUS GetSelectionInputPopUp (IN UI_MENU_OPTION *MenuOption)
 

Detailed Description

Implementation for handling user input from the User Interfaces.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file InputHandler.c.

Function Documentation

◆ AdjustOptionOrder()

EFI_STATUS AdjustOptionOrder ( IN FORM_DISPLAY_ENGINE_STATEMENT Question,
OUT UINTN PopUpMenuLines 
)

Adjust option order base on the question value.

Parameters
QuestionPointer to current question.
PopUpMenuLinesThe line number of the pop up menu.
Return values
EFI_SUCCESSIf Option input is processed successfully
EFI_DEVICE_ERRORIf operation fails

Definition at line 1133 of file InputHandler.c.

◆ AdjustQuestionValue()

VOID AdjustQuestionValue ( IN EFI_HII_VALUE QuestionValue,
IN UINT8  Sequence 
)

Adjust the value to the correct one. Rules follow the sample: like: Year change: 2012.02.29 -> 2013.02.29 -> 2013.02.01 Month change: 2013.03.29 -> 2013.02.29 -> 2013.02.28

Parameters
QuestionValuePointer to current question.
SequenceThe sequence of the field in the question.

Definition at line 325 of file InputHandler.c.

◆ GetFieldFromOp()

VOID GetFieldFromOp ( IN EFI_IFR_OP_HEADER OpCode,
OUT UINTN Minimum,
OUT UINTN Maximum 
)

Get maximum and minimum info from this opcode.

Parameters
OpCodePointer to the current input opcode.
MinimumThe minimum size info for this opcode.
MaximumThe maximum size info for this opcode.

Definition at line 21 of file InputHandler.c.

◆ GetNumericInput()

EFI_STATUS GetNumericInput ( IN UI_MENU_OPTION MenuOption)

This routine reads a numeric value from the user input.

Parameters
MenuOptionPointer to the current input menu.
Return values
EFI_SUCCESSIf numerical input is read successfully
EFI_DEVICE_ERRORIf operation fails

Definition at line 487 of file InputHandler.c.

◆ GetSelectionInputPopUp()

EFI_STATUS GetSelectionInputPopUp ( IN UI_MENU_OPTION MenuOption)

Get selection for OneOf and OrderedList (Left/Right will be ignored).

Parameters
MenuOptionPointer to the current input menu.
Return values
EFI_SUCCESSIf Option input is processed successfully
EFI_DEVICE_ERRORIf operation fails

Definition at line 1280 of file InputHandler.c.

◆ GetValueFromNum()

VOID GetValueFromNum ( IN EFI_IFR_OP_HEADER OpCode,
IN BOOLEAN  IntInput,
IN EFI_HII_VALUE QuestionValue,
OUT UINT64 *  Value,
OUT UINT64 *  Minimum,
OUT UINT64 *  Maximum,
OUT UINT64 *  Step,
OUT UINT16 *  StorageWidth 
)

Get field info from numeric opcode.

Parameters
OpCodePointer to the current input opcode.
IntInputWhether question shows with EFI_IFR_DISPLAY_INT_DEC type.
QuestionValueInput question value, with EFI_HII_VALUE type.
ValueReturn question value, always return UINT64 type.
MinimumThe minimum size info for this opcode.
MaximumThe maximum size info for this opcode.
StepThe step size info for this opcode.
StorageWidthThe storage width info for this opcode.

Definition at line 392 of file InputHandler.c.

◆ IsValuesEqual()

BOOLEAN IsValuesEqual ( IN EFI_IFR_TYPE_VALUE Value1,
IN EFI_IFR_TYPE_VALUE Value2,
IN UINT8  Type 
)

Base on the type to compare the value.

Parameters
Value1The first value need to compare.
Value2The second value need to compare.
TypeThe value type for above two values.
Return values
TRUEThe two value are same.
FALSEThe two value are different.

Definition at line 1202 of file InputHandler.c.

◆ ReadString()

EFI_STATUS ReadString ( IN UI_MENU_OPTION MenuOption,
IN CHAR16 *  Prompt,
IN OUT CHAR16 *  StringPtr 
)

Get string or password input from user.

Parameters
MenuOptionPointer to the current input menu.
PromptThe prompt string shown on popup window.
StringPtrOld user input and destination for use input string.
Return values
EFI_SUCCESSIf string input is read successfully
EFI_DEVICE_ERRORIf operation fails

Definition at line 56 of file InputHandler.c.

◆ SetValuesByType()

VOID SetValuesByType ( OUT EFI_IFR_TYPE_VALUE Dest,
IN EFI_IFR_TYPE_VALUE Source,
IN UINT8  Type 
)

Base on the type to set the value.

Parameters
DestThe dest value.
SourceThe source value.
TypeThe value type for above two values.

Definition at line 1237 of file InputHandler.c.