]>
Commit | Line | Data |
---|---|---|
7c6c064c ED |
1 | /** @file\r |
2 | Private structure, MACRO and function definitions for User Interface related functionalities.\r | |
3 | \r | |
4 | Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT 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 | |
28 | INTN \r | |
29 | GetConditionalExpressionCount (\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 | |
37 | VOID\r | |
38 | ResetCurrentExpressionStack (\r | |
39 | VOID\r | |
40 | );\r | |
41 | \r | |
42 | /**\r | |
43 | Reset stack pointer to begin of the stack.\r | |
44 | \r | |
45 | **/\r | |
46 | VOID\r | |
47 | ResetMapExpressionListStack (\r | |
48 | VOID\r | |
49 | );\r | |
50 | \r | |
51 | /**\r | |
52 | Reset stack pointer to begin of the stack.\r | |
53 | \r | |
54 | **/\r | |
55 | VOID\r | |
56 | ResetScopeStack (\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 | |
70 | EFI_STATUS\r | |
71 | PushScope (\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 | |
84 | FORM_EXPRESSION **\r | |
85 | GetConditionalExpressionList (\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 | |
99 | EFI_STATUS\r | |
100 | PopScope (\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 | |
113 | EFI_STATUS\r | |
114 | PushMapExpressionList (\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 | |
127 | EFI_STATUS\r | |
128 | PushCurrentExpression (\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 | |
138 | VOID\r | |
139 | ExtendValueToU64 (\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 | |
154 | EFI_STATUS\r | |
155 | PushConditionalExpression (\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 | |
170 | EFI_STATUS\r | |
171 | PopConditionalExpression (\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 | |
184 | EFI_STATUS\r | |
185 | PopMapExpressionList (\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 | |
198 | EFI_STATUS\r | |
199 | PopCurrentExpression (\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 | |
221 | EFI_STATUS\r | |
222 | EvaluateExpression (\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 | |
241 | EXPRESS_RESULT \r | |
242 | EvaluateExpressionList (\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 | |
259 | FORM_BROWSER_FORM *\r | |
260 | IdToForm (\r | |
261 | IN FORM_BROWSER_FORMSET *FormSet,\r | |
262 | IN UINT16 FormId\r | |
263 | );\r | |
264 | \r | |
265 | #endif // _EXPRESSION_H\r |