FrontPage.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /** @file
  2. Head file for front page.
  3. Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _FRONT_PAGE_H_
  7. #define _FRONT_PAGE_H_
  8. #include "String.h"
  9. #include "Ui.h"
  10. #include <Protocol/BootLogo.h>
  11. //
  12. // These is the VFR compiler generated data representing our VFR data.
  13. //
  14. extern UINT8 FrontPageVfrBin[];
  15. extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
  16. #define SMBIOS_TYPE4_CPU_SOCKET_POPULATED BIT6
  17. //
  18. // This is the VFR compiler generated header file which defines the
  19. // string identifiers.
  20. //
  21. #define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001
  22. //
  23. // These are defined as the same with vfr file
  24. //
  25. #define FRONT_PAGE_FORM_ID 0x1000
  26. #define LABEL_FRANTPAGE_INFORMATION 0x1000
  27. #define LABEL_END 0xffff
  28. #define FRONT_PAGE_FORMSET_GUID \
  29. { \
  30. 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \
  31. }
  32. #define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')
  33. typedef struct {
  34. UINTN Signature;
  35. //
  36. // HII relative handles
  37. //
  38. EFI_HII_HANDLE HiiHandle;
  39. EFI_HANDLE DriverHandle;
  40. EFI_STRING_ID *LanguageToken;
  41. //
  42. // Produced protocols
  43. //
  44. EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
  45. } FRONT_PAGE_CALLBACK_DATA;
  46. #define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \
  47. CR (a, \
  48. FRONT_PAGE_CALLBACK_DATA, \
  49. ConfigAccess, \
  50. FRONT_PAGE_CALLBACK_DATA_SIGNATURE \
  51. )
  52. /**
  53. This function allows a caller to extract the current configuration for one
  54. or more named elements from the target driver.
  55. @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  56. @param Request - A null-terminated Unicode string in <ConfigRequest> format.
  57. @param Progress - On return, points to a character in the Request string.
  58. Points to the string's null terminator if request was successful.
  59. Points to the most recent '&' before the first failing name/value
  60. pair (or the beginning of the string if the failure is in the
  61. first name/value pair) if the request was not successful.
  62. @param Results - A null-terminated Unicode string in <ConfigAltResp> format which
  63. has all values filled in for the names in the Request string.
  64. String to be allocated by the called function.
  65. @retval EFI_SUCCESS The Results is filled with the requested values.
  66. @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
  67. @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
  68. @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
  69. **/
  70. EFI_STATUS
  71. EFIAPI
  72. FakeExtractConfig (
  73. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  74. IN CONST EFI_STRING Request,
  75. OUT EFI_STRING *Progress,
  76. OUT EFI_STRING *Results
  77. );
  78. /**
  79. This function processes the results of changes in configuration.
  80. @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  81. @param Configuration - A null-terminated Unicode string in <ConfigResp> format.
  82. @param Progress - A pointer to a string filled in with the offset of the most
  83. recent '&' before the first failing name/value pair (or the
  84. beginning of the string if the failure is in the first
  85. name/value pair) or the terminating NULL if all was successful.
  86. @retval EFI_SUCCESS The Results is processed successfully.
  87. @retval EFI_INVALID_PARAMETER Configuration is NULL.
  88. @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
  89. **/
  90. EFI_STATUS
  91. EFIAPI
  92. FakeRouteConfig (
  93. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  94. IN CONST EFI_STRING Configuration,
  95. OUT EFI_STRING *Progress
  96. );
  97. /**
  98. This function processes the results of changes in configuration.
  99. @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
  100. @param Action - Specifies the type of action taken by the browser.
  101. @param QuestionId - A unique value which is sent to the original exporting driver
  102. so that it can identify the type of data to expect.
  103. @param Type - The type of value for the question.
  104. @param Value - A pointer to the data being sent to the original exporting driver.
  105. @param ActionRequest - On return, points to the action requested by the callback function.
  106. @retval EFI_SUCCESS The callback successfully handled the action.
  107. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
  108. @retval EFI_DEVICE_ERROR The variable could not be saved.
  109. @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
  110. **/
  111. EFI_STATUS
  112. EFIAPI
  113. FrontPageCallback (
  114. IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
  115. IN EFI_BROWSER_ACTION Action,
  116. IN EFI_QUESTION_ID QuestionId,
  117. IN UINT8 Type,
  118. IN EFI_IFR_TYPE_VALUE *Value,
  119. OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
  120. );
  121. /**
  122. Initialize HII information for the FrontPage
  123. @retval EFI_SUCCESS The operation is successful.
  124. @retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.
  125. **/
  126. EFI_STATUS
  127. InitializeFrontPage (
  128. VOID
  129. );
  130. /**
  131. Acquire the string associated with the ProducerGuid and return it.
  132. @param ProducerGuid - The Guid to search the HII database for
  133. @param Token - The token value of the string to extract
  134. @param String - The string that is extracted
  135. @retval EFI_SUCCESS The function returns EFI_SUCCESS always.
  136. **/
  137. EFI_STATUS
  138. GetProducerString (
  139. IN EFI_GUID *ProducerGuid,
  140. IN EFI_STRING_ID Token,
  141. OUT CHAR16 **String
  142. );
  143. /**
  144. This function is the main entry of the UI entry.
  145. The function will present the main menu of the system UI.
  146. @param ConnectAllHappened Caller passes the value to UI to avoid unnecessary connect-all.
  147. **/
  148. VOID
  149. EFIAPI
  150. UiEntry (
  151. IN BOOLEAN ConnectAllHappened
  152. );
  153. /**
  154. Extract device path for given HII handle and class guid.
  155. @param Handle The HII handle.
  156. @retval NULL Fail to get the device path string.
  157. @return PathString Get the device path string.
  158. **/
  159. CHAR16 *
  160. ExtractDevicePathFromHiiHandle (
  161. IN EFI_HII_HANDLE Handle
  162. );
  163. #endif // _FRONT_PAGE_H_