]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SetupBrowserDxe/Expression.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Expression.h
CommitLineData
7c6c064c
ED
1/** @file\r
2Private structure, MACRO and function definitions for User Interface related functionalities.\r
3\r
d1102dba 4Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
7c6c064c
ED
6\r
7**/\r
8\r
9#ifndef _EXPRESSION_H_\r
10#define _EXPRESSION_H_\r
11\r
12/**\r
13 Get the expression list count.\r
d1102dba
LG
14\r
15 @param Level Which type this expression belong to. Form,\r
7c6c064c
ED
16 statement or option?\r
17\r
18 @retval >=0 The expression count\r
19 @retval -1 Input parameter error.\r
20\r
21**/\r
d1102dba 22INTN\r
7c6c064c
ED
23GetConditionalExpressionCount (\r
24 IN EXPRESS_LEVEL Level\r
25 );\r
26\r
27/**\r
28 Reset stack pointer to begin of the stack.\r
29\r
30**/\r
31VOID\r
32ResetCurrentExpressionStack (\r
33 VOID\r
34 );\r
35\r
36/**\r
37 Reset stack pointer to begin of the stack.\r
38\r
39**/\r
40VOID\r
41ResetMapExpressionListStack (\r
42 VOID\r
43 );\r
44\r
45/**\r
46 Reset stack pointer to begin of the stack.\r
47\r
48**/\r
49VOID\r
50ResetScopeStack (\r
51 VOID\r
52 );\r
53\r
54/**\r
55 Push an Operand onto the Stack\r
56\r
57 @param Operand Operand to push.\r
58\r
59 @retval EFI_SUCCESS The value was pushed onto the stack.\r
60 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r
61 stack.\r
62\r
63**/\r
64EFI_STATUS\r
65PushScope (\r
66 IN UINT8 Operand\r
67 );\r
68\r
69/**\r
70 Get the expression Buffer pointer.\r
d1102dba
LG
71\r
72 @param Level Which type this expression belong to. Form,\r
7c6c064c
ED
73 statement or option?\r
74\r
75 @retval The start pointer of the expression buffer or NULL.\r
76\r
77**/\r
78FORM_EXPRESSION **\r
79GetConditionalExpressionList (\r
80 IN EXPRESS_LEVEL Level\r
81 );\r
82\r
83/**\r
84 Pop an Operand from the Stack\r
85\r
86 @param Operand Operand to pop.\r
87\r
88 @retval EFI_SUCCESS The value was pushed onto the stack.\r
89 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r
90 stack.\r
91\r
92**/\r
93EFI_STATUS\r
94PopScope (\r
95 OUT UINT8 *Operand\r
96 );\r
97\r
98/**\r
99 Push the list of map expression onto the Stack\r
100\r
101 @param Pointer Pointer to the list of map expression to be pushed.\r
102\r
103 @retval EFI_SUCCESS The value was pushed onto the stack.\r
104 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r
105\r
106**/\r
107EFI_STATUS\r
108PushMapExpressionList (\r
109 IN VOID *Pointer\r
110 );\r
111\r
112/**\r
113 Push current expression onto the Stack\r
114\r
115 @param Pointer Pointer to current expression.\r
116\r
117 @retval EFI_SUCCESS The value was pushed onto the stack.\r
118 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r
119\r
120**/\r
121EFI_STATUS\r
122PushCurrentExpression (\r
123 IN VOID *Pointer\r
124 );\r
125\r
126/**\r
127 Zero extend integer/boolean/date/time to UINT64 for comparing.\r
128\r
129 @param Value HII Value to be converted.\r
130\r
131**/\r
132VOID\r
133ExtendValueToU64 (\r
134 IN EFI_HII_VALUE *Value\r
135 );\r
136\r
137/**\r
138 Push the expression options onto the Stack.\r
139\r
140 @param Pointer Pointer to the current expression.\r
d1102dba 141 @param Level Which type this expression belong to. Form,\r
7c6c064c
ED
142 statement or option?\r
143\r
144 @retval EFI_SUCCESS The value was pushed onto the stack.\r
145 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r
146\r
147**/\r
148EFI_STATUS\r
149PushConditionalExpression (\r
150 IN FORM_EXPRESSION *Pointer,\r
151 IN EXPRESS_LEVEL Level\r
152 );\r
153\r
154/**\r
155 Pop the expression options from the Stack\r
156\r
d1102dba 157 @param Level Which type this expression belong to. Form,\r
7c6c064c
ED
158 statement or option?\r
159\r
160 @retval EFI_SUCCESS The value was pushed onto the stack.\r
161 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r
162\r
163**/\r
164EFI_STATUS\r
165PopConditionalExpression (\r
166 IN EXPRESS_LEVEL Level\r
167 );\r
168\r
169/**\r
170 Pop the list of map expression from the Stack\r
171\r
172 @param Pointer Pointer to the list of map expression to be pop.\r
173\r
174 @retval EFI_SUCCESS The value was pushed onto the stack.\r
175 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r
176\r
177**/\r
178EFI_STATUS\r
179PopMapExpressionList (\r
180 OUT VOID **Pointer\r
181 );\r
182\r
183/**\r
184 Pop current expression from the Stack\r
185\r
186 @param Pointer Pointer to current expression to be pop.\r
187\r
188 @retval EFI_SUCCESS The value was pushed onto the stack.\r
189 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the stack.\r
190\r
191**/\r
192EFI_STATUS\r
193PopCurrentExpression (\r
194 OUT VOID **Pointer\r
195 );\r
196\r
197/**\r
198 Evaluate the result of a HII expression.\r
199\r
200 If Expression is NULL, then ASSERT.\r
201\r
202 @param FormSet FormSet associated with this expression.\r
203 @param Form Form associated with this expression.\r
204 @param Expression Expression to be evaluated.\r
205\r
206 @retval EFI_SUCCESS The expression evaluated successfuly\r
207 @retval EFI_NOT_FOUND The Question which referenced by a QuestionId\r
208 could not be found.\r
209 @retval EFI_OUT_OF_RESOURCES There is not enough system memory to grow the\r
210 stack.\r
211 @retval EFI_ACCESS_DENIED The pop operation underflowed the stack\r
212 @retval EFI_INVALID_PARAMETER Syntax error with the Expression\r
213\r
214**/\r
215EFI_STATUS\r
216EvaluateExpression (\r
217 IN FORM_BROWSER_FORMSET *FormSet,\r
218 IN FORM_BROWSER_FORM *Form,\r
219 IN OUT FORM_EXPRESSION *Expression\r
220 );\r
221/**\r
d1102dba
LG
222 Return the result of the expression list. Check the expression list and\r
223 return the highest priority express result.\r
7c6c064c
ED
224 Priority: DisableIf > SuppressIf > GrayOutIf > FALSE\r
225\r
226 @param ExpList The input expression list.\r
227 @param Evaluate Whether need to evaluate the expression first.\r
228 @param FormSet FormSet associated with this expression.\r
d1102dba 229 @param Form Form associated with this expression.\r
7c6c064c 230\r
d1102dba 231 @retval EXPRESS_RESULT Return the higher priority express result.\r
7c6c064c
ED
232 DisableIf > SuppressIf > GrayOutIf > FALSE\r
233\r
234**/\r
d1102dba 235EXPRESS_RESULT\r
7c6c064c
ED
236EvaluateExpressionList (\r
237 IN FORM_EXPRESSION_LIST *ExpList,\r
238 IN BOOLEAN Evaluate,\r
239 IN FORM_BROWSER_FORMSET *FormSet, OPTIONAL\r
240 IN FORM_BROWSER_FORM *Form OPTIONAL\r
241 );\r
242\r
243/**\r
244 Get Form given its FormId.\r
245\r
246 @param FormSet The formset which contains this form.\r
247 @param FormId Id of this form.\r
248\r
249 @retval Pointer The form.\r
250 @retval NULL Specified Form is not found in the formset.\r
251\r
252**/\r
253FORM_BROWSER_FORM *\r
254IdToForm (\r
255 IN FORM_BROWSER_FORMSET *FormSet,\r
256 IN UINT16 FormId\r
257 );\r
258\r
259#endif // _EXPRESSION_H\r