2 // Include common header file for this module.
4 #include "CommonHeader.h"
8 // Copyright (c) 2006, Intel Corporation
9 // All rights reserved. This program and the accompanying materials
10 // are licensed and made available under the terms and conditions of the BSD License
11 // which accompanies this distribution. The full text of the license may be found at
12 // http://opensource.org/licenses/bsd-license.php
14 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23 // Sample Setup formset
30 #include "DriverSampleStrDefs.h"
32 #include "NVDataStruc.h"
47 #define MY_TEXT_KEY 0x100
49 #define LABEL_1_VALUE 0x01
50 #define LABEL_2_VALUE 0x1000
51 #define LABEL_UPDATE_BBS 0x2222
52 #define LABEL_END_UPDATE_BBS 0x2223
56 title = STRING_TOKEN(STR_FORM_SET_TITLE),
57 help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
61 varstore MyIfrNVData2, key = 0x1234, name = MY_DATA2, guid = FORMSET_GUID;
64 varstore MyIfrNVData3, key = 0x4321, name = MY_DATA3, guid = FORMSET_GUID;
67 title = STRING_TOKEN(STR_FORM1_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
69 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
71 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
74 title = STRING_TOKEN(STR_BANNER_TITLE),
79 title = STRING_TOKEN(STR_BANNER_TITLE),
84 title = STRING_TOKEN(STR_BANNER_TITLE),
89 help = STRING_TOKEN(STR_TEXT_HELP),
90 text = STRING_TOKEN(STR_CPU_STRING),
91 text = STRING_TOKEN(STR_CPU_STRING2),
96 help = STRING_TOKEN(STR_EXIT_TEXT),
97 text = STRING_TOKEN(STR_EXIT_TEXT),
98 text = STRING_TOKEN(STR_EXIT_TEXT),
102 oneof varid = MyIfrNVData.SuppressGrayOutSomething,
103 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
104 help = STRING_TOKEN(STR_ONE_OF_HELP),
105 option text = STRING_TOKEN(STR_ONE_OF_TEXT4), value = 0x0, flags = 0;
106 option text = STRING_TOKEN(STR_ONE_OF_TEXT5), value = 0x1, flags = 0;
107 option text = STRING_TOKEN(STR_ONE_OF_TEXT6), value = 0x2, flags = DEFAULT;
110 oneof varid = MyIfrNVData.BootOrderLarge,
111 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
112 help = STRING_TOKEN(STR_ONE_OF_HELP),
113 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = INTERACTIVE, key = 1;
114 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = INTERACTIVE | DEFAULT, key = 2;
117 grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
118 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
120 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
121 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
122 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
123 flags = 1, // Flags behavior for checkbox is overloaded so that it equals a DEFAULT value. 1 = ON, 0 = off
131 // sizeof(MyIfrNVData) storage must be UINT8 array, and
132 // size written for the variable must be size of the entire
136 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
137 label LABEL_UPDATE_BBS;
139 varid = MyIfrNVData.BootOrder,
140 prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
141 help = STRING_TOKEN(STR_NULL_STRING),
142 option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = RESET_REQUIRED;
143 option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = RESET_REQUIRED;
144 option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = RESET_REQUIRED;
145 option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED;
147 label LABEL_END_UPDATE_BBS;
150 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2;
152 varid = MyIfrNVData.OrderedList,
153 prompt = STRING_TOKEN(STR_TEST_OPCODE),
154 help = STRING_TOKEN(STR_TEXT_HELP),
155 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 4, flags = RESET_REQUIRED;
156 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 3, flags = RESET_REQUIRED;
157 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 2, flags = RESET_REQUIRED;
158 option text = STRING_TOKEN(STR_TEXT_HELP), value = 1, flags = RESET_REQUIRED;
165 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC),
166 help = STRING_TOKEN(STR_GOTO_HELP),
171 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
172 help = STRING_TOKEN(STR_GOTO_HELP),
179 // Till now, been using variable NvData (must be reserved)
180 // now we do a varselect for variable NvData3
181 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
182 ideqid MyIfrNVData3.Field16 == MyIfrNVData3.Field16
184 // now we do a varselect_pair for variable NvData2 and NvData3
185 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
186 ideqid MyIfrNVData2.Field16 == MyIfrNVData3.Field16
190 // now we do a varselect_pair for variable NvData and NvData2
191 // inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
192 // ideqid MyIfrNVData2.Field16 == MyIfrNVData.TestLateCheck
195 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
196 ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
199 oneof varid = MyIfrNVData.TestLateCheck,
200 prompt = STRING_TOKEN(STR_TEST_OPCODE),
201 help = STRING_TOKEN(STR_ONE_OF_HELP),
202 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = LATE_CHECK | RESET_REQUIRED;
203 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = LATE_CHECK | DEFAULT | RESET_REQUIRED;
206 oneof varid = MyIfrNVData.TestLateCheck2,
207 prompt = STRING_TOKEN(STR_TEST_OPCODE2),
208 help = STRING_TOKEN(STR_ONE_OF_HELP),
209 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = LATE_CHECK | DEFAULT | RESET_REQUIRED;
210 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = LATE_CHECK | RESET_REQUIRED;
214 oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
215 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
216 help = STRING_TOKEN(STR_ONE_OF_HELP),
217 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
218 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
219 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
223 string varid = MyIfrNVData.MyStringData,
224 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
225 help = STRING_TOKEN(STR_MY_STRING_HELP2),
233 help = STRING_TOKEN(STR_GRAYOUT_TEST),
234 text = STRING_TOKEN(STR_GRAYOUT_TEST),
235 text = STRING_TOKEN(STR_GRAYOUT_TEST),
240 help = STRING_TOKEN(STR_SUPPRESS_TEST),
241 text = STRING_TOKEN(STR_SUPPRESS_TEST),
242 text = STRING_TOKEN(STR_SUPPRESS_TEST),
247 help = STRING_TOKEN(STR_CLEAR_TEST),
248 text = STRING_TOKEN(STR_CLEAR_TEST),
249 text = STRING_TOKEN(STR_CLEAR_TEST),
253 grayoutif vareqval var(VAR_EQ_TEST_NAME) == 0x1;
254 suppressif vareqval var(VAR_EQ_TEST_NAME) == 0x1000;
256 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
257 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
258 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
265 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
266 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
267 help = STRING_TOKEN(STR_NUMERIC_HELP0),
269 maximum = 0xf0, // 0xf0 = 240 in decimal
270 step = 0, // Stepping of 0 equates to a manual entering
271 // of a value, otherwise it will auto-increment
272 // with a left/right arrow
277 numeric varid = MyIfrNVData.HowTallAreYouManual,
278 prompt = STRING_TOKEN(STR_TALL_MANUAL_PROMPT),
279 help = STRING_TOKEN(STR_NUMERIC_HELP1),
282 step = 0, // Stepping of 0 equates to a manual entering
283 // of a value, otherwise it will auto-increment
284 // with a left/right arrow
290 help = STRING_TOKEN(STR_INVENTORY_HELP),
291 text = STRING_TOKEN(STR_INVENTORY_TEXT1),
292 text = STRING_TOKEN(STR_INVENTORY_TEXT2);
297 prompt = STRING_TOKEN(STR_RESTORE_DEFAULTS_PROMPT),
298 help = STRING_TOKEN(STR_RESTORE_DEFAULTS_HELP),
304 prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
305 help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
310 // Case with no flags or key
314 prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
315 help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP);
321 prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
322 help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
325 // Case with no flags
329 prompt = STRING_TOKEN(STR_SAVE_DEFAULTS_PROMPT),
330 help = STRING_TOKEN(STR_SAVE_DEFAULTS_HELP),
335 grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
336 numeric varid = MyIfrNVData.HowOldAreYouInYears,
337 prompt = STRING_TOKEN(STR_NUMERIC_PROMPT),
338 help = STRING_TOKEN(STR_NUMERIC_HELP2),
349 // Numeric with no step or default specified
351 numeric varid = MyIfrNVData.HowTallAreYou,
352 prompt = STRING_TOKEN(STR_NUMERIC_PROMPT1),
353 help = STRING_TOKEN(STR_NUMERIC_HELP3),
356 // step = 1, // Stepping of 1 if not specified
357 // default = minimum; // if not specified
361 string varid = MyIfrNVData.MyStringData,
362 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
363 help = STRING_TOKEN(STR_MY_STRING_HELP),
368 password varid = MyIfrNVData.WhatIsThePassword,
369 prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
370 help = STRING_TOKEN(STR_PASSWORD_HELP),
372 maxsize = 20, // new opcode
375 password varid = MyIfrNVData.WhatIsThePassword2,
376 prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
377 help = STRING_TOKEN(STR_PASSWORD_HELP),
379 maxsize = 20, // new opcode
383 // Test with flags and key fields
385 password varid = MyIfrNVData.WhatIsThePassword,
386 prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
387 help = STRING_TOKEN(STR_PASSWORD_HELP),
391 maxsize = 20, // new opcode
396 prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
397 help = STRING_TOKEN(STR_GOTO_HELP);
400 prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
401 help = STRING_TOKEN(STR_GOTO_HELP);
405 form formid = 2, // SecondSetupPage,
406 title = STRING_TOKEN(STR_FORM2_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
409 date year varid = Date.Year, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
410 prompt = STRING_TOKEN(STR_DATE_PROMPT),
411 help = STRING_TOKEN(STR_DATE_YEAR_HELP),
417 month varid = Date.Month, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
418 prompt = STRING_TOKEN(STR_DATE_PROMPT),
419 help = STRING_TOKEN(STR_DATE_MONTH_HELP),
425 day varid = Date.Day, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
426 prompt = STRING_TOKEN(STR_DATE_PROMPT),
427 help = STRING_TOKEN(STR_DATE_DAY_HELP),
435 time hour varid = Time.Hours, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
436 prompt = STRING_TOKEN(STR_TIME_PROMPT),
437 help = STRING_TOKEN(STR_TIME_HOUR_HELP),
443 minute varid = Time.Minutes, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
444 prompt = STRING_TOKEN(STR_TIME_PROMPT),
445 help = STRING_TOKEN(STR_TIME_MINUTE_HELP),
451 second varid = Time.Seconds, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
452 prompt = STRING_TOKEN(STR_TIME_PROMPT),
453 help = STRING_TOKEN(STR_TIME_SECOND_HELP),
461 date year varid = Date.Year, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
462 prompt = STRING_TOKEN(STR_DATE_PROMPT),
463 help = STRING_TOKEN(STR_DATE_YEAR_HELP),
469 month varid = Date.Month, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
470 prompt = STRING_TOKEN(STR_DATE_PROMPT),
471 help = STRING_TOKEN(STR_DATE_MONTH_HELP),
477 day varid = Date.Day, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
478 prompt = STRING_TOKEN(STR_DATE_PROMPT),
479 help = STRING_TOKEN(STR_DATE_DAY_HELP),
487 time hour varid = Time.Hours, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
488 prompt = STRING_TOKEN(STR_TIME_PROMPT),
489 help = STRING_TOKEN(STR_TIME_HOUR_HELP),
495 minute varid = Time.Minutes, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
496 prompt = STRING_TOKEN(STR_TIME_PROMPT),
497 help = STRING_TOKEN(STR_TIME_MINUTE_HELP),
503 second varid = Time.Seconds, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
504 prompt = STRING_TOKEN(STR_TIME_PROMPT),
505 help = STRING_TOKEN(STR_TIME_SECOND_HELP),
514 ideqval Date.Day == 21
516 ideqval Date.Month == 8;
518 hidden value = 32, key = 0x7777;
523 ideqval Date.Day == 8
525 ideqval Date.Month == 21;
527 hidden value = 32, key = 0x7777;
532 hidden value = 32, key = 0x1234;
534 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
535 ideqval MyIfrNVData.HowOldAreYouInYearsManual == 4
538 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
539 ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 2 3 4
542 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
543 ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyIfrNVData.MyFavoriteNumber
548 // If the day is 31 AND months is any of the following 2, 4, 6, 9, 11
550 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
551 ideqval Date.Day == 31
553 ideqvallist Date.Month == 2 4 6 9 11
557 // If the day is 30 AND month is 2
559 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
560 ideqval Date.Day == 30
562 ideqval Date.Month == 2
566 // If the day is 29 AND month is 2 AND it year is NOT a leapyear
568 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
569 ideqval Date.Day == 0x1D
571 ideqval Date.Month == 2
574 ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
577 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
578 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
579 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
585 help = STRING_TOKEN(STR_TEXT_HELP),
586 text = STRING_TOKEN(STR_TEXT_TEXT_1);
589 help = STRING_TOKEN(STR_TEXT_HELP),
590 text = STRING_TOKEN(STR_TEXT_TEXT_1),
591 text = STRING_TOKEN(STR_TEXT_TEXT_2),
596 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
597 help = STRING_TOKEN(STR_GOTO_HELP);
601 form formid = 3, title = STRING_TOKEN(STR_FORM3_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
603 grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
605 help = STRING_TOKEN(STR_TEXT_HELP),
606 text = STRING_TOKEN(STR_TEXT_TEXT_1);
608 endif; //end grayoutif
611 help = STRING_TOKEN(STR_TEXT_HELP),
612 text = STRING_TOKEN(STR_TEXT_TEXT_1);
616 form formid = 4, title = STRING_TOKEN(STR_FORM3_TITLE);
620 form formid = 0x1234, // Dynamically created page,
621 title = STRING_TOKEN(STR_DYNAMIC_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code