3 This library class defines a set of interfaces to customize Ui module
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Protocol/HiiConfigAccess.h>
11 #include <Library/BaseLib.h>
12 #include <Library/MemoryAllocationLib.h>
13 #include "FrontPage.h"
14 #include "FrontPageCustomizedUiSupport.h"
16 extern FRONT_PAGE_CALLBACK_DATA gFrontPagePrivate
;
19 Customize menus in the page.
21 @param[in] HiiHandle The HII Handle of the form to update.
22 @param[in] StartOpCodeHandle The context used to insert opcode.
23 @param[in] CustomizePageType The page type need to be customized.
27 UiCustomizeFrontPage (
28 IN EFI_HII_HANDLE HiiHandle
,
29 IN VOID
*StartOpCodeHandle
33 // Create "Select Language" menu with Oneof opcode.
35 UiCreateLanguageMenu (HiiHandle
, StartOpCodeHandle
);
40 UiCreateEmptyLine (HiiHandle
, StartOpCodeHandle
);
43 // Find third party drivers which need to be shown in the front page.
45 UiListThirdPartyDrivers (HiiHandle
, &gEfiIfrFrontPageGuid
, NULL
, StartOpCodeHandle
);
50 UiCreateEmptyLine (HiiHandle
, StartOpCodeHandle
);
53 // Create "Continue" menu.
55 UiCreateContinueMenu (HiiHandle
, StartOpCodeHandle
);
60 UiCreateResetMenu (HiiHandle
, StartOpCodeHandle
);
64 This function processes the results of changes in configuration.
67 @param HiiHandle Points to the hii handle for this formset.
68 @param Action Specifies the type of action taken by the browser.
69 @param QuestionId A unique value which is sent to the original exporting driver
70 so that it can identify the type of data to expect.
71 @param Type The type of value for the question.
72 @param Value A pointer to the data being sent to the original exporting driver.
73 @param ActionRequest On return, points to the action requested by the callback function.
75 @retval EFI_SUCCESS The callback successfully handled the action.
76 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
77 @retval EFI_DEVICE_ERROR The variable could not be saved.
78 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
82 UiFrontPageCallbackHandler (
83 IN EFI_HII_HANDLE HiiHandle
,
84 IN EFI_BROWSER_ACTION Action
,
85 IN EFI_QUESTION_ID QuestionId
,
87 IN EFI_IFR_TYPE_VALUE
*Value
,
88 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest
93 if (UiSupportLibCallbackHandler (HiiHandle
, Action
, QuestionId
, Type
, Value
, ActionRequest
, &Status
)) {
97 return EFI_UNSUPPORTED
;
101 Update the banner string in the front page.
103 Current layout for the banner string like below:
104 PS: Totally only 5 lines of banner supported.
106 Line 1: Left BannerStr RightBannerStr
107 Line 2: Left BannerStr RightBannerStr
108 Line 3: Left BannerStr RightBannerStr
109 Line 4: Left BannerStr RightBannerStr
110 Line 5: Left BannerStr RightBannerStr
112 First menu in front page.
115 @param LineIndex The line index of the banner need to check.
116 @param LeftOrRight The left or right banner need to check.
117 @param BannerStr Banner string need to update.
118 Input the current string and user can update
119 it and return the new string.
123 UiCustomizeFrontPageBanner (
125 IN BOOLEAN LeftOrRight
,
126 IN OUT EFI_STRING
*BannerStr
129 if ((LineIndex
== 5) && LeftOrRight
) {
130 // Update STR_CUSTOMIZE_BANNER_LINE5_LEFT
131 if (PcdGetBool (PcdTestKeyUsed
)) {
132 if (BannerStr
!= NULL
) {
133 FreePool (*BannerStr
);
136 *BannerStr
= HiiGetString (gFrontPagePrivate
.HiiHandle
, STRING_TOKEN (STR_TEST_KEY_USED
), NULL
);