]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c
6e4f7b5c22b41bce95590bc8234ce6a97094aee5
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / FrontPageCustomizedUi.c
1 /** @file
2
3 This library class defines a set of interfaces to customize Ui module
4
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 #include <Uefi.h>
16 #include <Protocol/HiiConfigAccess.h>
17 #include <Library/BaseLib.h>
18 #include <Library/MemoryAllocationLib.h>
19 #include "FrontPageCustomizedUiSupport.h"
20
21 /**
22 Customize menus in the page.
23
24 @param[in] HiiHandle The HII Handle of the form to update.
25 @param[in] StartOpCodeHandle The context used to insert opcode.
26 @param[in] CustomizePageType The page type need to be customized.
27
28 **/
29 VOID
30 UiCustomizeFrontPage (
31 IN EFI_HII_HANDLE HiiHandle,
32 IN VOID *StartOpCodeHandle
33 )
34 {
35 //
36 // Create "Select Language" menu with Oneof opcode.
37 //
38 UiCreateLanguageMenu (HiiHandle, StartOpCodeHandle);
39
40 //
41 // Create empty line.
42 //
43 UiCreateEmptyLine(HiiHandle, StartOpCodeHandle);
44
45 //
46 // Find third party drivers which need to be shown in the front page.
47 //
48 UiListThirdPartyDrivers (HiiHandle, &gEfiIfrFrontPageGuid, NULL, StartOpCodeHandle);
49
50 //
51 // Create empty line.
52 //
53 UiCreateEmptyLine(HiiHandle, StartOpCodeHandle);
54
55 //
56 // Create "Continue" menu.
57 //
58 UiCreateContinueMenu(HiiHandle, StartOpCodeHandle);
59
60 //
61 // Create reset menu.
62 //
63 UiCreateResetMenu(HiiHandle, StartOpCodeHandle);
64 }
65
66 /**
67 This function processes the results of changes in configuration.
68
69
70 @param HiiHandle Points to the hii handle for this formset.
71 @param Action Specifies the type of action taken by the browser.
72 @param QuestionId A unique value which is sent to the original exporting driver
73 so that it can identify the type of data to expect.
74 @param Type The type of value for the question.
75 @param Value A pointer to the data being sent to the original exporting driver.
76 @param ActionRequest On return, points to the action requested by the callback function.
77
78 @retval EFI_SUCCESS The callback successfully handled the action.
79 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
80 @retval EFI_DEVICE_ERROR The variable could not be saved.
81 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
82
83 **/
84 EFI_STATUS
85 UiFrontPageCallbackHandler (
86 IN EFI_HII_HANDLE HiiHandle,
87 IN EFI_BROWSER_ACTION Action,
88 IN EFI_QUESTION_ID QuestionId,
89 IN UINT8 Type,
90 IN EFI_IFR_TYPE_VALUE *Value,
91 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
92 )
93 {
94 EFI_STATUS Status;
95
96 if (UiSupportLibCallbackHandler (HiiHandle, Action, QuestionId, Type, Value, ActionRequest, &Status)) {
97 return Status;
98 }
99
100 return EFI_UNSUPPORTED;
101 }
102
103 /**
104 Update the banner string in the front page.
105
106 Current layout for the banner string like below:
107 PS: Totally only 5 lines of banner supported.
108
109 Line 1: Left BannerStr RightBannerStr
110 Line 2: Left BannerStr RightBannerStr
111 Line 3: Left BannerStr RightBannerStr
112 Line 4: Left BannerStr RightBannerStr
113 Line 5: Left BannerStr RightBannerStr
114 <EmptyLine>
115 First menu in front page.
116 ...
117
118 @param LineIndex The line index of the banner need to check.
119 @param LeftOrRight The left or right banner need to check.
120 @param BannerStr Banner string need to update.
121 Input the current string and user can update
122 it and return the new string.
123
124 **/
125 VOID
126 UiCustomizeFrontPageBanner (
127 IN UINTN LineIndex,
128 IN BOOLEAN LeftOrRight,
129 IN OUT EFI_STRING *BannerStr
130 )
131 {
132 }