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