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