TianoCore EDK2 master
Loading...
Searching...
No Matches
Presentation.c File Reference
#include "Setup.h"

Go to the source code of this file.

Functions

EFI_STATUS CheckConfigAccess (IN FORM_BROWSER_FORMSET *FormSet)
 
EFI_STATUS EvaluateFormExpressions (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
FORM_DISPLAY_ENGINE_STATEMENTGetDisplayStatement (IN EFI_IFR_OP_HEADER *OpCode)
 
VOID FreeRefreshEvent (VOID)
 
VOID UpdateStatement (IN OUT FORM_BROWSER_STATEMENT *Statement)
 
VOID EFIAPI RefreshEventNotifyForStatement (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI RefreshEventNotifyForForm (IN EFI_EVENT Event, IN VOID *Context)
 
VOID CreateRefreshEventForStatement (IN FORM_BROWSER_STATEMENT *Statement)
 
VOID CreateRefreshEventForForm (IN FORM_BROWSER_FORM *Form)
 
VOID InitializeDisplayStatement (IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement, IN FORM_BROWSER_STATEMENT *Statement)
 
VOID EFIAPI RefreshIntervalProcess (IN EFI_EVENT Event, IN VOID *Context)
 
VOID UpdateHotkeyList (VOID)
 
UINT32 ProcessQuestionExtraAttr (IN EFI_QUESTION_ID QuestionId)
 
VOID AddStatementToDisplayForm (VOID)
 
VOID UpdateDataChangedFlag (VOID)
 
VOID InitializeDisplayFormData (VOID)
 
VOID FreeHotkeyList (VOID)
 
VOID UpdateDisplayFormData (VOID)
 
VOID FreeStatementData (LIST_ENTRY *StatementList)
 
VOID FreeDisplayFormData (VOID)
 
FORM_BROWSER_STATEMENTGetBrowserStatement (IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement)
 
VOID UpdateStatementStatusForForm (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form)
 
VOID UpdateStatementStatusForFormSet (IN FORM_BROWSER_FORMSET *FormSet)
 
VOID UpdateStatementStatus (IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN BROWSER_SETTING_SCOPE SettingScope)
 
EFI_STATUS ProcessAction (IN UINT32 Action, IN UINT16 DefaultId)
 
BOOLEAN GetFormsetGuidFromHiiHandle (IN EFI_HII_HANDLE HiiHandle, IN EFI_GUID *FormSetGuid)
 
EFI_HII_HANDLE DevicePathToHiiHandle (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_GUID *FormsetGuid)
 
EFI_HII_HANDLE FormSetGuidToHiiHandle (EFI_GUID *ComparingGuid)
 
BOOLEAN ProcessChangedData (IN OUT UI_MENU_SELECTION *Selection, IN BROWSER_SETTING_SCOPE Scope)
 
VOID FindParentFormSet (IN OUT UI_MENU_SELECTION *Selection)
 
EFI_STATUS ProcessGotoOpCode (IN OUT FORM_BROWSER_STATEMENT *Statement, IN OUT UI_MENU_SELECTION *Selection)
 
EFI_STATUS ProcessQuestionConfig (IN UI_MENU_SELECTION *Selection, IN FORM_BROWSER_STATEMENT *Question)
 
EFI_STATUS ProcessUserInput (IN USER_INPUT *UserInput)
 
EFI_STATUS DisplayForm (VOID)
 
EFI_STATUS EFIAPI FormUpdateNotify (IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN CONST EFI_HII_PACKAGE_HEADER *Package, IN EFI_HII_HANDLE Handle, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType)
 
BOOLEAN IsNvUpdateRequiredForFormSet (IN FORM_BROWSER_FORMSET *FormSet)
 
BOOLEAN IsNvUpdateRequiredForForm (IN FORM_BROWSER_FORM *Form)
 
BOOLEAN FindNextMenu (IN OUT UI_MENU_SELECTION *Selection, IN BROWSER_SETTING_SCOPE SettingLevel)
 
BOOLEAN ReconnectController (IN EFI_HANDLE DriverHandle)
 
EFI_STATUS ProcessCallBackFunction (IN OUT UI_MENU_SELECTION *Selection, IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN FORM_BROWSER_STATEMENT *Question, IN EFI_BROWSER_ACTION Action, IN BOOLEAN SkipSaveOrDiscard)
 
EFI_STATUS ProcessRetrieveForQuestion (IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess, IN FORM_BROWSER_STATEMENT *Statement, IN FORM_BROWSER_FORMSET *FormSet)
 
EFI_STATUS SetupBrowser (IN OUT UI_MENU_SELECTION *Selection)
 

Variables

BOOLEAN mHiiPackageListUpdated
 
UI_MENU_SELECTIONgCurrentSelection
 
EFI_HII_HANDLE mCurrentHiiHandle = NULL
 
EFI_GUID mCurrentFormSetGuid
 
UINT16 mCurrentFormId = 0
 
EFI_EVENT mValueChangedEvent = NULL
 
LIST_ENTRY mRefreshEventList = INITIALIZE_LIST_HEAD_VARIABLE (mRefreshEventList)
 
UINT16 mCurFakeQestId
 
FORM_DISPLAY_ENGINE_FORM gDisplayFormData
 
BOOLEAN mFinishRetrieveCall = FALSE
 

Detailed Description

Utility functions for UI presentation.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 - 2022 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Presentation.c.

Function Documentation

◆ AddStatementToDisplayForm()

VOID AddStatementToDisplayForm ( VOID  )

Enum all statement in current form, find all the statement can be display and add to the display form.

Definition at line 531 of file Presentation.c.

◆ CheckConfigAccess()

EFI_STATUS CheckConfigAccess ( IN FORM_BROWSER_FORMSET FormSet)

Check whether the ConfigAccess protocol is available.

Parameters
FormSetFormSet of which the ConfigAcces protocol need to be checked.
Return values
EFI_SUCCESSThe function executed successfully.

Definition at line 34 of file Presentation.c.

◆ CreateRefreshEventForForm()

VOID CreateRefreshEventForForm ( IN FORM_BROWSER_FORM Form)

Create refresh hook event for form which has refresh event or interval.

Parameters
FormThe form need to check.

Definition at line 267 of file Presentation.c.

◆ CreateRefreshEventForStatement()

VOID CreateRefreshEventForStatement ( IN FORM_BROWSER_STATEMENT Statement)

Create refresh hook event for statement which has refresh event or interval.

Parameters
StatementThe statement need to check.

Definition at line 233 of file Presentation.c.

◆ DevicePathToHiiHandle()

EFI_HII_HANDLE DevicePathToHiiHandle ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN EFI_GUID FormsetGuid 
)

Find HII Handle in the HII database associated with given Device Path.

If DevicePath is NULL, then ASSERT.

Parameters
DevicePathDevice Path associated with the HII package list handle.
FormsetGuidThe formset guid for this formset.
Return values
HandleHII package list Handle associated with the Device Path.
NULLHii Package list handle is not found.

Definition at line 1165 of file Presentation.c.

◆ DisplayForm()

EFI_STATUS DisplayForm ( VOID  )

Display form and wait for user to select one menu option, then return it.

Return values
EFI_SUCESSSThis function always return successfully for now.

Definition at line 1694 of file Presentation.c.

◆ EvaluateFormExpressions()

EFI_STATUS EvaluateFormExpressions ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

Evaluate all expressions in a Form.

Parameters
FormSetFormSet this Form belongs to.
FormThe Form.
Return values
EFI_SUCCESSThe expression evaluated successfuly

Definition at line 67 of file Presentation.c.

◆ FindNextMenu()

BOOLEAN FindNextMenu ( IN OUT UI_MENU_SELECTION Selection,
IN BROWSER_SETTING_SCOPE  SettingLevel 
)

Find menu which will show next time.

Parameters
SelectionOn input, Selection tell setup browser the information about the Selection, form and formset to be displayed. On output, Selection return the screen item that is selected by user.
SettingLevelInput Settting level, if it is FormLevel, just exit current form. else, we need to exit current formset.
Return values
TRUEExit current form.
FALSEUser press ESC and keep in current form.

Definition at line 1878 of file Presentation.c.

◆ FindParentFormSet()

VOID FindParentFormSet ( IN OUT UI_MENU_SELECTION Selection)

Find parent formset menu(the first menu which has different formset) for current menu. If not find, just return to the first menu.

Parameters
SelectionThe selection info.

Definition at line 1336 of file Presentation.c.

◆ FormSetGuidToHiiHandle()

EFI_HII_HANDLE FormSetGuidToHiiHandle ( EFI_GUID ComparingGuid)

Find HII Handle in the HII database associated with given form set guid.

If FormSetGuid is NULL, then ASSERT.

Parameters
ComparingGuidFormSet Guid associated with the HII package list handle.
Return values
HandleHII package list Handle associated with the Device Path.
NULLHii Package list handle is not found.

Definition at line 1241 of file Presentation.c.

◆ FormUpdateNotify()

EFI_STATUS EFIAPI FormUpdateNotify ( IN UINT8  PackageType,
IN CONST EFI_GUID PackageGuid,
IN CONST EFI_HII_PACKAGE_HEADER Package,
IN EFI_HII_HANDLE  Handle,
IN EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType 
)

Functions which are registered to receive notification of database events have this prototype. The actual event is encoded in NotifyType. The following table describes how PackageType, PackageGuid, Handle, and Package are used for each of the notification types.

Parameters
PackageTypePackage type of the notification.
PackageGuidIf PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to the GUID from the Guid field of EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it must be NULL.
PackagePoints to the package referred to by the notification Handle The handle of the package list which contains the specified package.
HandleThe HII handle.
NotifyTypeThe type of change concerning the database. See EFI_HII_DATABASE_NOTIFY_TYPE.

Definition at line 1784 of file Presentation.c.

◆ FreeDisplayFormData()

VOID FreeDisplayFormData ( VOID  )

Free the Display form structure data.

Definition at line 856 of file Presentation.c.

◆ FreeHotkeyList()

VOID FreeHotkeyList ( VOID  )

Free the kotkey info saved in form data.

Definition at line 758 of file Presentation.c.

◆ FreeRefreshEvent()

VOID FreeRefreshEvent ( VOID  )

Free the refresh event list.

Definition at line 137 of file Presentation.c.

◆ FreeStatementData()

VOID FreeStatementData ( LIST_ENTRY StatementList)

Free the Display Statement structure data.

Parameters
StatementListPoint to the statement list which need to be free.

Definition at line 812 of file Presentation.c.

◆ GetBrowserStatement()

FORM_BROWSER_STATEMENT * GetBrowserStatement ( IN FORM_DISPLAY_ENGINE_STATEMENT DisplayStatement)

Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.

Parameters
DisplayStatementThe input FORM_DISPLAY_ENGINE_STATEMENT.
Return values
FORM_BROWSER_STATEMENTThe return FORM_BROWSER_STATEMENT info.

Definition at line 878 of file Presentation.c.

◆ GetDisplayStatement()

FORM_DISPLAY_ENGINE_STATEMENT * GetDisplayStatement ( IN EFI_IFR_OP_HEADER OpCode)

Base on the opcode buffer info to get the display statement.

Parameters
OpCodeThe input opcode buffer for this statement.
Return values
StatementThe statement use this opcode buffer.

Definition at line 111 of file Presentation.c.

◆ GetFormsetGuidFromHiiHandle()

BOOLEAN GetFormsetGuidFromHiiHandle ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_GUID FormSetGuid 
)

Check whether the formset guid is in this Hii package list.

Parameters
HiiHandleThe HiiHandle for this HII package list.
FormSetGuidThe formset guid for the request formset.
Return values
TRUEFind the formset guid.
FALSENot found the formset guid.

Definition at line 1077 of file Presentation.c.

◆ InitializeDisplayFormData()

VOID InitializeDisplayFormData ( VOID  )

Initialize the Display form structure data.

Definition at line 727 of file Presentation.c.

◆ InitializeDisplayStatement()

VOID InitializeDisplayStatement ( IN OUT FORM_DISPLAY_ENGINE_STATEMENT DisplayStatement,
IN FORM_BROWSER_STATEMENT Statement 
)

Initialize the Display statement structure data.

Parameters
DisplayStatementPointer to the display Statement data strucure.
StatementThe statement need to check.

Definition at line 302 of file Presentation.c.

◆ IsNvUpdateRequiredForForm()

BOOLEAN IsNvUpdateRequiredForForm ( IN FORM_BROWSER_FORM Form)

Update the NvUpdateRequired flag for a form.

Parameters
FormForm data structure.

Definition at line 1843 of file Presentation.c.

◆ IsNvUpdateRequiredForFormSet()

BOOLEAN IsNvUpdateRequiredForFormSet ( IN FORM_BROWSER_FORMSET FormSet)

Update the NV flag info for this form set.

Parameters
FormSetFormSet data structure.

Definition at line 1804 of file Presentation.c.

◆ ProcessAction()

EFI_STATUS ProcessAction ( IN UINT32  Action,
IN UINT16  DefaultId 
)

Process the action request in user input.

Parameters
ActionThe user input action request info.
DefaultIdThe user input default Id info.
Return values
EFI_SUCESSSThis function always return successfully for now.

Definition at line 1011 of file Presentation.c.

◆ ProcessCallBackFunction()

EFI_STATUS ProcessCallBackFunction ( IN OUT UI_MENU_SELECTION Selection,
IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN FORM_BROWSER_STATEMENT Question,
IN EFI_BROWSER_ACTION  Action,
IN BOOLEAN  SkipSaveOrDiscard 
)

Call the call back function for the question and process the return action.

Parameters
SelectionOn input, Selection tell setup browser the information about the Selection, form and formset to be displayed. On output, Selection return the screen item that is selected by user.
FormSetThe formset this question belong to.
FormThe form this question belong to.
QuestionThe Question which need to call.
ActionThe action request.
SkipSaveOrDiscardWhether skip save or discard action.
Return values
EFI_SUCCESSThe call back function executes successfully.
Returns
Other value if the call back function failed to execute.

Definition at line 1987 of file Presentation.c.

◆ ProcessChangedData()

BOOLEAN ProcessChangedData ( IN OUT UI_MENU_SELECTION Selection,
IN BROWSER_SETTING_SCOPE  Scope 
)

check how to process the changed data in current form or form set.

Parameters
SelectionOn input, Selection tell setup browser the information about the Selection, form and formset to be displayed. On output, Selection return the screen item that is selected by user.
ScopeData save or discard scope, form or formset.
Return values
TRUESuccess process the changed data, will return to the parent form.
FALSEReject to process the changed data, will stay at current form.

Definition at line 1291 of file Presentation.c.

◆ ProcessGotoOpCode()

EFI_STATUS ProcessGotoOpCode ( IN OUT FORM_BROWSER_STATEMENT Statement,
IN OUT UI_MENU_SELECTION Selection 
)

Process the goto op code, update the info in the selection structure.

Parameters
StatementThe statement belong to goto op code.
SelectionThe selection info.
Return values
EFI_SUCCESSThe menu process successfully.
Returns
Other value if the process failed.

Definition at line 1369 of file Presentation.c.

◆ ProcessQuestionConfig()

EFI_STATUS ProcessQuestionConfig ( IN UI_MENU_SELECTION Selection,
IN FORM_BROWSER_STATEMENT Question 
)

Process Question Config.

Parameters
SelectionThe UI menu selection.
QuestionThe Question to be peocessed.
Return values
EFI_SUCCESSQuestion Config process success.
OtherQuestion Config process fail.

Definition at line 1519 of file Presentation.c.

◆ ProcessQuestionExtraAttr()

UINT32 ProcessQuestionExtraAttr ( IN EFI_QUESTION_ID  QuestionId)

Get the extra question attribute from override question list.

Parameters
QuestionIdThe question id for this request question.
Return values
Theattribute for this question or NULL if not found this question in the list.

Definition at line 493 of file Presentation.c.

◆ ProcessRetrieveForQuestion()

EFI_STATUS ProcessRetrieveForQuestion ( IN EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess,
IN FORM_BROWSER_STATEMENT Statement,
IN FORM_BROWSER_FORMSET FormSet 
)

Call the retrieve type call back function for one question to get the initialize data.

This function only used when in the initialize stage, because in this stage, the Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.

Parameters
ConfigAccessThe config access protocol produced by the hii driver.
StatementThe Question which need to call.
FormSetThe formset this question belong to.
Return values
EFI_SUCCESSThe call back function executes successfully.
Returns
Other value if the call back function failed to execute.

Definition at line 2310 of file Presentation.c.

◆ ProcessUserInput()

EFI_STATUS ProcessUserInput ( IN USER_INPUT UserInput)

Process the user input data.

Parameters
UserInputThe user input data.
Return values
EFI_SUCESSSThis function always return successfully for now.

Definition at line 1564 of file Presentation.c.

◆ ReconnectController()

BOOLEAN ReconnectController ( IN EFI_HANDLE  DriverHandle)

Reconnect the controller.

Parameters
DriverHandleThe controller handle which need to be reconnect.
Return values
TRUEdo the reconnect behavior success.
FALSEdo the reconnect behavior failed.

Definition at line 1956 of file Presentation.c.

◆ RefreshEventNotifyForForm()

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

Refresh the questions within this form.

Parameters
EventThe event which has this function related.
ContextThe input context info related to this event or the status code return to the caller.

Definition at line 216 of file Presentation.c.

◆ RefreshEventNotifyForStatement()

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

Refresh the question which has refresh guid event attribute.

Parameters
EventThe event which has this function related.
ContextThe input context info related to this event or the status code return to the caller.

Definition at line 196 of file Presentation.c.

◆ RefreshIntervalProcess()

VOID EFIAPI RefreshIntervalProcess ( 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 428 of file Presentation.c.

◆ SetupBrowser()

EFI_STATUS SetupBrowser ( IN OUT UI_MENU_SELECTION Selection)

The worker function that send the displays to the screen. On output, the selection made by user is returned.

Parameters
SelectionOn input, Selection tell setup browser the information about the Selection, form and formset to be displayed. On output, Selection return the screen item that is selected by user.
Return values
EFI_SUCCESSThe page is displayed successfully.
Returns
Other value if the page failed to be diplayed.

Definition at line 2379 of file Presentation.c.

◆ UpdateDataChangedFlag()

VOID UpdateDataChangedFlag ( VOID  )

Initialize the SettingChangedFlag variable in the display form.

Definition at line 673 of file Presentation.c.

◆ UpdateDisplayFormData()

VOID UpdateDisplayFormData ( VOID  )

Update the Display form structure data.

Definition at line 783 of file Presentation.c.

◆ UpdateHotkeyList()

VOID UpdateHotkeyList ( VOID  )

Make a copy of the global hotkey info.

Definition at line 457 of file Presentation.c.

◆ UpdateStatement()

VOID UpdateStatement ( IN OUT FORM_BROWSER_STATEMENT Statement)

Check whether this statement value is changed. If yes, update the statement value and return TRUE; else return FALSE.

Parameters
StatementThe statement need to check.

Definition at line 163 of file Presentation.c.

◆ UpdateStatementStatus()

VOID UpdateStatementStatus ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form,
IN BROWSER_SETTING_SCOPE  SettingScope 
)

Update the ValueChanged status for questions.

Parameters
FormSetFormSet data structure.
FormForm data structure.
SettingScopeSetting Scope for Default action.

Definition at line 963 of file Presentation.c.

◆ UpdateStatementStatusForForm()

VOID UpdateStatementStatusForForm ( IN FORM_BROWSER_FORMSET FormSet,
IN FORM_BROWSER_FORM Form 
)

Update the ValueChanged status for questions in this form.

Parameters
FormSetFormSet data structure.
FormForm data structure.

Definition at line 907 of file Presentation.c.

◆ UpdateStatementStatusForFormSet()

VOID UpdateStatementStatusForFormSet ( IN FORM_BROWSER_FORMSET FormSet)

Update the ValueChanged status for questions in this formset.

Parameters
FormSetFormSet data structure.

Definition at line 938 of file Presentation.c.

Variable Documentation

◆ gCurrentSelection

UI_MENU_SELECTION* gCurrentSelection

Definition at line 13 of file Presentation.c.

◆ gDisplayFormData

FORM_DISPLAY_ENGINE_FORM gDisplayFormData

Definition at line 22 of file Presentation.c.

◆ mCurFakeQestId

UINT16 mCurFakeQestId

Definition at line 21 of file Presentation.c.

◆ mCurrentFormId

UINT16 mCurrentFormId = 0

Definition at line 18 of file Presentation.c.

◆ mCurrentFormSetGuid

EFI_GUID mCurrentFormSetGuid
Initial value:
= {
0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 }
}

Definition at line 15 of file Presentation.c.

◆ mCurrentHiiHandle

EFI_HII_HANDLE mCurrentHiiHandle = NULL

Definition at line 14 of file Presentation.c.

◆ mFinishRetrieveCall

BOOLEAN mFinishRetrieveCall = FALSE

Definition at line 23 of file Presentation.c.

◆ mHiiPackageListUpdated

BOOLEAN mHiiPackageListUpdated

Definition at line 12 of file Presentation.c.

◆ mRefreshEventList

LIST_ENTRY mRefreshEventList = INITIALIZE_LIST_HEAD_VARIABLE (mRefreshEventList)

Definition at line 20 of file Presentation.c.

◆ mValueChangedEvent

EFI_EVENT mValueChangedEvent = NULL

Definition at line 19 of file Presentation.c.