]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/UiApp/FrontPage.h
UiApp code split from IntelFrameworkModulePkg/Universal/BdsDxe driver.
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / FrontPage.h
diff --git a/MdeModulePkg/Application/UiApp/FrontPage.h b/MdeModulePkg/Application/UiApp/FrontPage.h
new file mode 100644 (file)
index 0000000..08d1692
--- /dev/null
@@ -0,0 +1,278 @@
+/** @file\r
+  FrontPage routines to handle the callbacks and browser calls\r
+\r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _FRONT_PAGE_H_\r
+#define _FRONT_PAGE_H_\r
+\r
+#include "DeviceMngr/DeviceManager.h"\r
+#include "BootMaint/BootMaint.h"\r
+#include "BootMngr/BootManager.h"\r
+#include "String.h"\r
+\r
+#include <Protocol/BootLogo.h>\r
+//\r
+// These are the VFR compiler generated data representing our VFR data.\r
+//\r
+extern UINT8  FrontPageVfrBin[];\r
+\r
+extern EFI_FORM_BROWSER2_PROTOCOL      *gFormBrowser2;\r
+\r
+extern BOOLEAN  gConnectAllHappened;\r
+\r
+#define SMBIOS_TYPE4_CPU_SOCKET_POPULATED BIT6\r
+\r
+///\r
+/// The size of a 3 character ISO639 language code.\r
+///\r
+#define ISO_639_2_ENTRY_SIZE   3\r
+\r
+//\r
+// This is the VFR compiler generated header file which defines the\r
+// string identifiers.\r
+//\r
+#define PRINTABLE_LANGUAGE_NAME_STRING_ID     0x0001\r
+\r
+//\r
+// These are defined as the same with vfr file\r
+//\r
+#define FRONT_PAGE_FORM_ID             0x1000\r
+#define INVALID_FORM_ID                0x0FFF\r
+\r
+#define FRONT_PAGE_KEY_SECTION         0x1000\r
+#define FRONT_PAGE_KEY_OFFSET          0x4000\r
+#define FRONT_PAGE_KEY_CONTINUE        0x1000\r
+#define FRONT_PAGE_KEY_LANGUAGE        0x1234\r
+#define FRONT_PAGE_KEY_BOOT_MANAGER    0x1064\r
+#define FRONT_PAGE_KEY_DEVICE_MANAGER  0x8567\r
+#define FRONT_PAGE_KEY_BOOT_MAINTAIN   0x9876\r
+#define FRONT_PAGE_KEY_RESET           0X7654\r
+\r
+#define LABEL_SELECT_LANGUAGE          0x1000\r
+#define LABEL_PLATFORM_INFORMATION     0x1001\r
+#define LABEL_END                      0xffff\r
+\r
+#define FRONT_PAGE_FORMSET_GUID \\r
+  { \\r
+    0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \\r
+  }\r
+\r
+#define FRONT_PAGE_CALLBACK_DATA_SIGNATURE  SIGNATURE_32 ('F', 'P', 'C', 'B')\r
+\r
+typedef struct {\r
+  UINTN                           Signature;\r
+\r
+  //\r
+  // HII relative handles\r
+  //\r
+  EFI_HII_HANDLE                  HiiHandle;\r
+  EFI_HANDLE                      DriverHandle;\r
+  EFI_STRING_ID                   *LanguageToken;\r
+\r
+  //\r
+  // Produced protocols\r
+  //\r
+  EFI_HII_CONFIG_ACCESS_PROTOCOL  ConfigAccess;\r
+} FRONT_PAGE_CALLBACK_DATA;\r
+\r
+\r
+#define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \\r
+  CR (a, \\r
+      FRONT_PAGE_CALLBACK_DATA, \\r
+      ConfigAccess, \\r
+      FRONT_PAGE_CALLBACK_DATA_SIGNATURE \\r
+      )\r
+\r
+/**\r
+  This function allows a caller to extract the current configuration for one\r
+  or more named elements from the target driver.\r
+\r
+\r
+  @param This            - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+  @param Request         - A null-terminated Unicode string in <ConfigRequest> format.\r
+  @param Progress        - On return, points to a character in the Request string.\r
+                         Points to the string's null terminator if request was successful.\r
+                         Points to the most recent '&' before the first failing name/value\r
+                         pair (or the beginning of the string if the failure is in the\r
+                         first name/value pair) if the request was not successful.\r
+  @param Results         - A null-terminated Unicode string in <ConfigAltResp> format which\r
+                         has all values filled in for the names in the Request string.\r
+                         String to be allocated by the called function.\r
+\r
+  @retval  EFI_SUCCESS            The Results is filled with the requested values.\r
+  @retval  EFI_OUT_OF_RESOURCES   Not enough memory to store the results.\r
+  @retval  EFI_INVALID_PARAMETER  Request is NULL, illegal syntax, or unknown name.\r
+  @retval  EFI_NOT_FOUND          Routing data doesn't match any storage in this driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FakeExtractConfig (\r
+  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,\r
+  IN  CONST EFI_STRING                       Request,\r
+  OUT EFI_STRING                             *Progress,\r
+  OUT EFI_STRING                             *Results\r
+  );\r
+\r
+/**\r
+  This function processes the results of changes in configuration.\r
+\r
+\r
+  @param This            - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+  @param Configuration   - A null-terminated Unicode string in <ConfigResp> format.\r
+  @param Progress        - A pointer to a string filled in with the offset of the most\r
+                         recent '&' before the first failing name/value pair (or the\r
+                         beginning of the string if the failure is in the first\r
+                         name/value pair) or the terminating NULL if all was successful.\r
+\r
+  @retval  EFI_SUCCESS            The Results is processed successfully.\r
+  @retval  EFI_INVALID_PARAMETER  Configuration is NULL.\r
+  @retval  EFI_NOT_FOUND          Routing data doesn't match any storage in this driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FakeRouteConfig (\r
+  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,\r
+  IN  CONST EFI_STRING                       Configuration,\r
+  OUT EFI_STRING                             *Progress\r
+  );\r
+\r
+/**\r
+  This function processes the results of changes in configuration.\r
+\r
+\r
+  @param This            - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+  @param Action          - Specifies the type of action taken by the browser.\r
+  @param QuestionId      - A unique value which is sent to the original exporting driver\r
+                         so that it can identify the type of data to expect.\r
+  @param Type            - The type of value for the question.\r
+  @param Value           - A pointer to the data being sent to the original exporting driver.\r
+  @param ActionRequest   - On return, points to the action requested by the callback function.\r
+\r
+  @retval  EFI_SUCCESS           The callback successfully handled the action.\r
+  @retval  EFI_OUT_OF_RESOURCES  Not enough storage is available to hold the variable and its data.\r
+  @retval  EFI_DEVICE_ERROR      The variable could not be saved.\r
+  @retval  EFI_UNSUPPORTED       The specified Action is not supported by the callback.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FrontPageCallback (\r
+  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,\r
+  IN  EFI_BROWSER_ACTION                     Action,\r
+  IN  EFI_QUESTION_ID                        QuestionId,\r
+  IN  UINT8                                  Type,\r
+  IN  EFI_IFR_TYPE_VALUE                     *Value,\r
+  OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
+  );\r
+\r
+/**\r
+  Initialize HII information for the FrontPage\r
+\r
+  @retval  EFI_SUCCESS        The operation is successful.\r
+  @retval  EFI_DEVICE_ERROR   If the dynamic opcode creation failed.\r
+\r
+**/\r
+EFI_STATUS\r
+InitializeFrontPage (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Acquire the string associated with the ProducerGuid and return it.\r
+\r
+\r
+  @param ProducerGuid    - The Guid to search the HII database for\r
+  @param Token           - The token value of the string to extract\r
+  @param String          - The string that is extracted\r
+\r
+  @retval  EFI_SUCCESS  The function returns EFI_SUCCESS always.\r
+\r
+**/\r
+EFI_STATUS\r
+GetProducerString (\r
+  IN      EFI_GUID                  *ProducerGuid,\r
+  IN      EFI_STRING_ID             Token,\r
+  OUT     CHAR16                    **String\r
+  );\r
+\r
+/**\r
+  This function is the main entry of the UI entry.\r
+  The function will present the main menu of the system UI.\r
+\r
+  @param ConnectAllHappened Caller passes the value to UI to avoid unnecessary connect-all.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+UiEntry (\r
+  IN BOOLEAN                      ConnectAllHappened\r
+  );\r
+\r
+/**\r
+  Extract the displayed formset for given HII handle and class guid.\r
+\r
+  @param Handle          The HII handle.\r
+  @param SetupClassGuid  The class guid specifies which form set will be displayed.\r
+  @param SkipCount       Skip some formsets which has processed before.\r
+  @param FormSetTitle    Formset title string.\r
+  @param FormSetHelp     Formset help string.\r
+  @param FormSetGuid     Formset Guid.\r
+\r
+  @retval  TRUE          The formset for given HII handle will be displayed.\r
+  @return  FALSE         The formset for given HII handle will not be displayed.\r
+\r
+**/\r
+BOOLEAN\r
+ExtractDisplayedHiiFormFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle,\r
+  IN      EFI_GUID            *SetupClassGuid,\r
+  IN      UINTN               SkipCount,\r
+  OUT     EFI_STRING_ID       *FormSetTitle,\r
+  OUT     EFI_STRING_ID       *FormSetHelp,\r
+  OUT     EFI_GUID            *FormSetGuid\r
+  );\r
+\r
+/**\r
+  Extract device path for given HII handle and class guid.\r
+\r
+  @param Handle          The HII handle.\r
+\r
+  @retval  NULL          Fail to get the device path string.\r
+  @return  PathString    Get the device path string.\r
+\r
+**/\r
+CHAR16 *\r
+ExtractDevicePathFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle\r
+  );\r
+\r
+/**\r
+  This function will change video resolution and text mode\r
+  according to defined setup mode or defined boot mode  \r
+\r
+  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode. \r
+\r
+  @retval  EFI_SUCCESS  Mode is changed successfully.\r
+  @retval  Others             Mode failed to be changed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BdsSetConsoleMode (\r
+  BOOLEAN  IsSetupMode\r
+  );\r
+\r
+#endif // _FRONT_PAGE_H_\r
+\r