iPXE
FormBrowser2.h
Go to the documentation of this file.
00001 /** @file
00002   This protocol is defined in UEFI spec.
00003 
00004   The EFI_FORM_BROWSER2_PROTOCOL is the interface to call for drivers to
00005   leverage the EFI configuration driver interface.
00006 
00007 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
00008 This program and the accompanying materials are licensed and made available under
00009 the terms and conditions of the BSD License that accompanies this distribution.
00010 The full text of the license may be found at
00011 http://opensource.org/licenses/bsd-license.php.
00012 
00013 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00014 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00015 
00016 **/
00017 
00018 #ifndef __EFI_FORM_BROWSER2_H__
00019 #define __EFI_FORM_BROWSER2_H__
00020 
00021 FILE_LICENCE ( BSD3 );
00022 
00023 #include <ipxe/efi/Guid/HiiPlatformSetupFormset.h>
00024 
00025 #define EFI_FORM_BROWSER2_PROTOCOL_GUID \
00026   {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }}
00027 
00028 
00029 typedef struct _EFI_FORM_BROWSER2_PROTOCOL   EFI_FORM_BROWSER2_PROTOCOL;
00030 
00031 
00032 
00033 /**
00034 
00035   @param LeftColumn   The value that designates the text column
00036                       where the browser window will begin from
00037                       the left-hand side of the screen
00038 
00039   @param RightColumn  The value that designates the text
00040                       column where the browser window will end
00041                       on the right-hand side of the screen.
00042 
00043   @param TopRow       The value that designates the text row from the
00044                       top of the screen where the browser window
00045                       will start.
00046 
00047   @param BottomRow    The value that designates the text row from the
00048                       bottom of the screen where the browser
00049                       window will end.
00050 **/
00051 typedef struct {
00052   UINTN   LeftColumn;
00053   UINTN   RightColumn;
00054   UINTN   TopRow;
00055   UINTN   BottomRow;
00056 } EFI_SCREEN_DESCRIPTOR;
00057 
00058 typedef UINTN EFI_BROWSER_ACTION_REQUEST;
00059 
00060 #define EFI_BROWSER_ACTION_REQUEST_NONE   0
00061 #define EFI_BROWSER_ACTION_REQUEST_RESET  1
00062 #define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2
00063 #define EFI_BROWSER_ACTION_REQUEST_EXIT   3
00064 #define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT  4
00065 #define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5
00066 #define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY        6
00067 #define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD      7
00068 #define EFI_BROWSER_ACTION_REQUEST_RECONNECT         8
00069 
00070 
00071 /**
00072   Initialize the browser to display the specified configuration forms.
00073 
00074   This function is the primary interface to the internal forms-based browser.
00075   The forms browser will display forms associated with the specified Handles.
00076   The browser will select all forms in packages which have the specified Type
00077   and (for EFI_HII_PACKAGE_TYPE_GUID) the specified PackageGuid.
00078 
00079   @param This            A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance
00080 
00081   @param Handles         A pointer to an array of Handles. This value should correspond
00082                          to the value of the HII form package that is required to be displayed.
00083 
00084   @param HandleCount     The number of Handles specified in Handle.
00085 
00086   @param FormSetGuid     This field points to the EFI_GUID which must match the Guid field or one of the
00087                          elements of the ClassId field  in the EFI_IFR_FORM_SET op-code.  If
00088                          FormsetGuid is NULL, then this function will display the form set class
00089                          EFI_HII_PLATFORM_SETUP_FORMSET_GUID.
00090 
00091   @param FormId          This field specifies the identifier of the form within the form set to render as the first
00092                          displayable page. If this field has a value of 0x0000, then the Forms Browser will
00093                          render the first enabled form in the form set.
00094 
00095   @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
00096                           characters.
00097 
00098   @param ActionRequest   Points to the action recommended by the form.
00099 
00100   @retval EFI_SUCCESS           The function completed successfully
00101 
00102   @retval EFI_NOT_FOUND         The variable was not found.
00103 
00104   @retval EFI_INVALID_PARAMETER One of the parameters has an
00105                                 invalid value.
00106 **/
00107 typedef
00108 EFI_STATUS
00109 (EFIAPI *EFI_SEND_FORM2)(
00110   IN CONST  EFI_FORM_BROWSER2_PROTOCOL  *This,
00111   IN        EFI_HII_HANDLE              *Handle,
00112   IN        UINTN                      HandleCount,
00113   IN        EFI_GUID                   *FormSetGuid, OPTIONAL
00114   IN        EFI_FORM_ID                FormId, OPTIONAL
00115   IN CONST  EFI_SCREEN_DESCRIPTOR      *ScreenDimensions, OPTIONAL
00116   OUT       EFI_BROWSER_ACTION_REQUEST *ActionRequest  OPTIONAL
00117 );
00118 
00119 
00120 /**
00121   This function is called by a callback handler to retrieve uncommitted state data from the browser.
00122 
00123   This routine is called by a routine which was called by the
00124   browser. This routine called this service in the browser to
00125   retrieve or set certain uncommitted state information.
00126 
00127   @param This           A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance.
00128 
00129   @param ResultsDataSize  A pointer to the size of the buffer
00130                           associated with ResultsData. On input, the size in
00131                           bytes of ResultsData. On output, the size of data
00132                           returned in ResultsData.
00133 
00134   @param ResultsData    A string returned from an IFR browser or
00135                         equivalent. The results string will have
00136                         no routing information in them.
00137 
00138   @param RetrieveData   A BOOLEAN field which allows an agent to
00139                         retrieve (if RetrieveData = TRUE) data
00140                         from the uncommitted browser state
00141                         information or set (if RetrieveData =
00142                         FALSE) data in the uncommitted browser
00143                         state information.
00144 
00145   @param VariableGuid   An optional field to indicate the target
00146                         variable GUID name to use.
00147 
00148   @param VariableName   An optional field to indicate the target
00149                         human-readable variable name.
00150 
00151   @retval EFI_SUCCESS           The results have been distributed or are
00152                                 awaiting distribution.
00153 
00154   @retval EFI_OUT_OF_RESOURCES  The ResultsDataSize specified
00155                                 was too small to contain the
00156                                 results data.
00157 
00158 **/
00159 typedef
00160 EFI_STATUS
00161 (EFIAPI *EFI_BROWSER_CALLBACK2)(
00162   IN CONST  EFI_FORM_BROWSER2_PROTOCOL *This,
00163   IN OUT    UINTN                     *ResultsDataSize,
00164   IN OUT    EFI_STRING                ResultsData,
00165   IN CONST  BOOLEAN                   RetrieveData,
00166   IN CONST  EFI_GUID                  *VariableGuid, OPTIONAL
00167   IN CONST  CHAR16                    *VariableName OPTIONAL
00168 );
00169 
00170 ///
00171 /// This interface will allow the caller to direct the configuration
00172 /// driver to use either the HII database or use the passed-in packet of data.
00173 ///
00174 struct _EFI_FORM_BROWSER2_PROTOCOL {
00175   EFI_SEND_FORM2         SendForm;
00176   EFI_BROWSER_CALLBACK2  BrowserCallback;
00177 } ;
00178 
00179 extern EFI_GUID gEfiFormBrowser2ProtocolGuid;
00180 
00181 #endif
00182