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 SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 #include <Uefi.h>
10 #include <Protocol/HiiConfigAccess.h>
11 #include "BootMaintenanceManagerCustomizedUiSupport.h"
12 
13 /**
14   Customize menus in the page.
15 
16   @param[in]  HiiHandle             The HII Handle of the form to update.
17   @param[in]  StartOpCodeHandle     The context used to insert opcode.
18   @param[in]  CustomizePageType     The page type need to be customized.
19 
20 **/
21 VOID
UiCustomizeBMMPage(IN EFI_HII_HANDLE HiiHandle,IN VOID * StartOpCodeHandle)22 UiCustomizeBMMPage (
23   IN EFI_HII_HANDLE  HiiHandle,
24   IN VOID            *StartOpCodeHandle
25   )
26 {
27   //
28   // Create "Boot Option" menu.
29   //
30   BmmCreateBootOptionMenu(HiiHandle, StartOpCodeHandle);
31   //
32   // Create "Driver Option" menu.
33   //
34   BmmCreateDriverOptionMenu(HiiHandle, StartOpCodeHandle);
35   //
36   // Create "Com Option" menu.
37   //
38   BmmCreateComOptionMenu(HiiHandle, StartOpCodeHandle);
39   //
40   // Create "Boot From File" menu.
41   //
42   BmmCreateBootFromFileMenu(HiiHandle, StartOpCodeHandle);
43 
44   //
45   // Find third party drivers which need to be shown in the Bmm page.
46   //
47   BmmListThirdPartyDrivers (HiiHandle, &gEfiIfrBootMaintenanceGuid, NULL, StartOpCodeHandle);
48 
49   //
50   // Create empty line.
51   //
52   BmmCreateEmptyLine (HiiHandle, StartOpCodeHandle);
53 
54   //
55   // Create "Boot Next" menu.
56   //
57   BmmCreateBootNextMenu (HiiHandle, StartOpCodeHandle);
58   //
59   // Create "Time Out" menu.
60   //
61   BmmCreateTimeOutMenu (HiiHandle, StartOpCodeHandle);
62 }
63 
64 /**
65   This function processes the results of changes in configuration.
66 
67 
68   @param HiiHandle       Points to the hii handle for this formset.
69   @param Action          Specifies the type of action taken by the browser.
70   @param QuestionId      A unique value which is sent to the original exporting driver
71                          so that it can identify the type of data to expect.
72   @param Type            The type of value for the question.
73   @param Value           A pointer to the data being sent to the original exporting driver.
74   @param ActionRequest   On return, points to the action requested by the callback function.
75 
76   @retval  EFI_SUCCESS           The callback successfully handled the action.
77   @retval  EFI_OUT_OF_RESOURCES  Not enough storage is available to hold the variable and its data.
78   @retval  EFI_DEVICE_ERROR      The variable could not be saved.
79   @retval  EFI_UNSUPPORTED       The specified Action is not supported by the callback.
80 
81 **/
82 EFI_STATUS
UiBMMCallbackHandler(IN EFI_HII_HANDLE HiiHandle,IN EFI_BROWSER_ACTION Action,IN EFI_QUESTION_ID QuestionId,IN UINT8 Type,IN EFI_IFR_TYPE_VALUE * Value,OUT EFI_BROWSER_ACTION_REQUEST * ActionRequest)83 UiBMMCallbackHandler (
84   IN  EFI_HII_HANDLE                         HiiHandle,
85   IN  EFI_BROWSER_ACTION                     Action,
86   IN  EFI_QUESTION_ID                        QuestionId,
87   IN  UINT8                                  Type,
88   IN  EFI_IFR_TYPE_VALUE                     *Value,
89   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest
90   )
91 {
92   return EFI_UNSUPPORTED;
93 }
94