]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/FormBrowser2.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / FormBrowser2.h
1 /** @file
2 This protocol is defined in UEFI spec.
3
4 The EFI_FORM_BROWSER2_PROTOCOL is the interface to call for drivers to
5 leverage the EFI configuration driver interface.
6
7 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11
12 #ifndef __EFI_FORM_BROWSER2_H__
13 #define __EFI_FORM_BROWSER2_H__
14
15 #include <Guid/HiiPlatformSetupFormset.h>
16
17 #define EFI_FORM_BROWSER2_PROTOCOL_GUID \
18 {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }}
19
20
21 typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL;
22
23
24
25 /**
26
27 @param LeftColumn The value that designates the text column
28 where the browser window will begin from
29 the left-hand side of the screen
30
31 @param RightColumn The value that designates the text
32 column where the browser window will end
33 on the right-hand side of the screen.
34
35 @param TopRow The value that designates the text row from the
36 top of the screen where the browser window
37 will start.
38
39 @param BottomRow The value that designates the text row from the
40 bottom of the screen where the browser
41 window will end.
42 **/
43 typedef struct {
44 UINTN LeftColumn;
45 UINTN RightColumn;
46 UINTN TopRow;
47 UINTN BottomRow;
48 } EFI_SCREEN_DESCRIPTOR;
49
50 typedef UINTN EFI_BROWSER_ACTION_REQUEST;
51
52 #define EFI_BROWSER_ACTION_REQUEST_NONE 0
53 #define EFI_BROWSER_ACTION_REQUEST_RESET 1
54 #define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2
55 #define EFI_BROWSER_ACTION_REQUEST_EXIT 3
56 #define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT 4
57 #define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5
58 #define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6
59 #define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD 7
60 #define EFI_BROWSER_ACTION_REQUEST_RECONNECT 8
61
62
63 /**
64 Initialize the browser to display the specified configuration forms.
65
66 This function is the primary interface to the internal forms-based browser.
67 The forms browser will display forms associated with the specified Handles.
68 The browser will select all forms in packages which have the specified Type
69 and (for EFI_HII_PACKAGE_TYPE_GUID) the specified PackageGuid.
70
71 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance
72
73 @param Handles A pointer to an array of Handles. This value should correspond
74 to the value of the HII form package that is required to be displayed.
75
76 @param HandleCount The number of Handles specified in Handle.
77
78 @param FormSetGuid This field points to the EFI_GUID which must match the Guid field or one of the
79 elements of the ClassId field in the EFI_IFR_FORM_SET op-code. If
80 FormsetGuid is NULL, then this function will display the form set class
81 EFI_HII_PLATFORM_SETUP_FORMSET_GUID.
82
83 @param FormId This field specifies the identifier of the form within the form set to render as the first
84 displayable page. If this field has a value of 0x0000, then the Forms Browser will
85 render the first enabled form in the form set.
86
87 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
88 characters.
89
90 @param ActionRequest Points to the action recommended by the form.
91
92 @retval EFI_SUCCESS The function completed successfully
93
94 @retval EFI_NOT_FOUND The variable was not found.
95
96 @retval EFI_INVALID_PARAMETER One of the parameters has an
97 invalid value.
98 **/
99 typedef
100 EFI_STATUS
101 (EFIAPI *EFI_SEND_FORM2)(
102 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
103 IN EFI_HII_HANDLE *Handle,
104 IN UINTN HandleCount,
105 IN EFI_GUID *FormSetGuid, OPTIONAL
106 IN EFI_FORM_ID FormId, OPTIONAL
107 IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
108 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL
109 );
110
111
112 /**
113 This function is called by a callback handler to retrieve uncommitted state data from the browser.
114
115 This routine is called by a routine which was called by the
116 browser. This routine called this service in the browser to
117 retrieve or set certain uncommitted state information.
118
119 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance.
120
121 @param ResultsDataSize A pointer to the size of the buffer
122 associated with ResultsData. On input, the size in
123 bytes of ResultsData. On output, the size of data
124 returned in ResultsData.
125
126 @param ResultsData A string returned from an IFR browser or
127 equivalent. The results string will have
128 no routing information in them.
129
130 @param RetrieveData A BOOLEAN field which allows an agent to
131 retrieve (if RetrieveData = TRUE) data
132 from the uncommitted browser state
133 information or set (if RetrieveData =
134 FALSE) data in the uncommitted browser
135 state information.
136
137 @param VariableGuid An optional field to indicate the target
138 variable GUID name to use.
139
140 @param VariableName An optional field to indicate the target
141 human-readable variable name.
142
143 @retval EFI_SUCCESS The results have been distributed or are
144 awaiting distribution.
145
146 @retval EFI_OUT_OF_RESOURCES The ResultsDataSize specified
147 was too small to contain the
148 results data.
149
150 **/
151 typedef
152 EFI_STATUS
153 (EFIAPI *EFI_BROWSER_CALLBACK2)(
154 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
155 IN OUT UINTN *ResultsDataSize,
156 IN OUT EFI_STRING ResultsData,
157 IN CONST BOOLEAN RetrieveData,
158 IN CONST EFI_GUID *VariableGuid, OPTIONAL
159 IN CONST CHAR16 *VariableName OPTIONAL
160 );
161
162 ///
163 /// This interface will allow the caller to direct the configuration
164 /// driver to use either the HII database or use the passed-in packet of data.
165 ///
166 struct _EFI_FORM_BROWSER2_PROTOCOL {
167 EFI_SEND_FORM2 SendForm;
168 EFI_BROWSER_CALLBACK2 BrowserCallback;
169 } ;
170
171 extern EFI_GUID gEfiFormBrowser2ProtocolGuid;
172
173 #endif
174