1 /** @file
2   Extension Form Browser Protocol provides the services that can be used to
3   register the different hot keys for the standard Browser actions described in UEFI specification.
4 
5 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 
10 #ifndef __FORM_BROWSER_EXTENSION2_H__
11 #define __FORM_BROWSER_EXTENSION2_H__
12 
13 #include <Protocol/FormBrowserEx.h>
14 
15 #define EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL_GUID  \
16   { 0xa770c357, 0xb693, 0x4e6d, { 0xa6, 0xcf, 0xd2, 0x1c, 0x72, 0x8e, 0x55, 0xb }}
17 
18 typedef struct _EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL   EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL;
19 
20 #define BROWSER_EXTENSION2_VERSION_1    0x10000
21 #define BROWSER_EXTENSION2_VERSION_1_1  0x10001
22 
23 /**
24   Check whether the browser data has been modified.
25 
26   @retval TRUE        Browser data is modified.
27   @retval FALSE       No browser data is modified.
28 
29 **/
30 typedef
31 BOOLEAN
32 (EFIAPI *IS_BROWSER_DATA_MODIFIED) (
33   VOID
34   );
35 
36 /**
37   Execute the action requested by the Action parameter.
38 
39   @param[in] Action     Execute the request action.
40   @param[in] DefaultId  The default Id info when need to load default value.
41 
42   @retval EFI_SUCCESS              Execute the request action succss.
43 
44 **/
45 typedef
46 EFI_STATUS
47 (EFIAPI *EXECUTE_ACTION) (
48   IN UINT32        Action,
49   IN UINT16        DefaultId
50   );
51 
52 /**
53   Check whether required reset when exit the browser
54 
55   @retval TRUE      Browser required to reset after exit.
56   @retval FALSE     Browser not need to reset after exit.
57 
58 **/
59 typedef
60 BOOLEAN
61 (EFIAPI *IS_RESET_REQUIRED) (
62   VOID
63   );
64 
65 #define FORM_ENTRY_INFO_SIGNATURE    SIGNATURE_32 ('f', 'e', 'i', 's')
66 
67 typedef struct {
68   UINTN           Signature;
69   LIST_ENTRY      Link;
70 
71   EFI_HII_HANDLE  HiiHandle;
72   EFI_GUID        FormSetGuid;
73   EFI_FORM_ID     FormId;
74   EFI_QUESTION_ID QuestionId;
75 } FORM_ENTRY_INFO;
76 
77 #define FORM_ENTRY_INFO_FROM_LINK(a)  CR (a, FORM_ENTRY_INFO, Link, FORM_ENTRY_INFO_SIGNATURE)
78 
79 #define FORM_QUESTION_ATTRIBUTE_OVERRIDE_SIGNATURE    SIGNATURE_32 ('f', 'q', 'o', 's')
80 
81 typedef struct {
82   UINTN            Signature;
83   LIST_ENTRY       Link;
84 
85   EFI_QUESTION_ID  QuestionId;           // Find the question
86   EFI_FORM_ID      FormId;               // Find the form
87   EFI_GUID         FormSetGuid;          // Find the formset.
88   EFI_HII_HANDLE   HiiHandle;            // Find the HII handle
89   UINT32           Attribute;            // Hide or grayout ...
90 } QUESTION_ATTRIBUTE_OVERRIDE;
91 
92 #define FORM_QUESTION_ATTRIBUTE_OVERRIDE_FROM_LINK(a)  CR (a, QUESTION_ATTRIBUTE_OVERRIDE, Link, FORM_QUESTION_ATTRIBUTE_OVERRIDE_SIGNATURE)
93 
94 struct _EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL {
95   ///
96   /// Version for protocol future extension.
97   ///
98   UINT32                    Version;
99   SET_SCOPE                 SetScope;
100   REGISTER_HOT_KEY          RegisterHotKey;
101   REGISTER_EXIT_HANDLER     RegiserExitHandler;
102   IS_BROWSER_DATA_MODIFIED  IsBrowserDataModified;
103   EXECUTE_ACTION            ExecuteAction;
104   ///
105   /// A list of type FORMID_INFO is Browser View Form History List.
106   ///
107   LIST_ENTRY                FormViewHistoryHead;
108   ///
109   /// A list of type QUESTION_ATTRIBUTE_OVERRIDE.
110   ///
111   LIST_ENTRY                OverrideQestListHead;
112 
113   IS_RESET_REQUIRED         IsResetRequired;
114 };
115 
116 extern EFI_GUID gEdkiiFormBrowserEx2ProtocolGuid;
117 
118 #endif
119 
120