xref: /illumos-gate/usr/src/boot/efi/include/Protocol/HiiPopup.h (revision f334afcfaebea1b7dc3430015651d8d748fa8a3e)
1 /** @file
2   This protocol provides services to display a popup window.
3   The protocol is typically produced by the forms browser and consumed by a driver callback handler.
4 
5   Copyright (c) 2017-2021, Intel Corporation. All rights reserved.<BR>
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8   @par Revision Reference:
9   This Protocol was introduced in UEFI Specification 2.7.
10 
11 **/
12 
13 #ifndef __HII_POPUP_H__
14 #define __HII_POPUP_H__
15 
16 #define EFI_HII_POPUP_PROTOCOL_GUID \
17   {0x4311edc0, 0x6054, 0x46d4, {0x9e, 0x40, 0x89, 0x3e, 0xa9, 0x52, 0xfc, 0xcc}}
18 
19 #define EFI_HII_POPUP_PROTOCOL_REVISION  1
20 
21 typedef struct _EFI_HII_POPUP_PROTOCOL EFI_HII_POPUP_PROTOCOL;
22 
23 typedef enum {
24   EfiHiiPopupStyleInfo,
25   EfiHiiPopupStyleWarning,
26   EfiHiiPopupStyleError
27 } EFI_HII_POPUP_STYLE;
28 
29 typedef enum {
30   EfiHiiPopupTypeOk,
31   EfiHiiPopupTypeOkCancel,
32   EfiHiiPopupTypeYesNo,
33   EfiHiiPopupTypeYesNoCancel
34 } EFI_HII_POPUP_TYPE;
35 
36 typedef enum {
37   EfiHiiPopupSelectionOk,
38   EfiHiiPopupSelectionCancel,
39   EfiHiiPopupSelectionYes,
40   EfiHiiPopupSelectionNo
41 } EFI_HII_POPUP_SELECTION;
42 
43 /**
44   Displays a popup window.
45 
46   @param  This           A pointer to the EFI_HII_POPUP_PROTOCOL instance.
47   @param  PopupStyle     Popup style to use.
48   @param  PopupType      Type of the popup to display.
49   @param  HiiHandle      HII handle of the string pack containing Message
50   @param  Message        A message to display in the popup box.
51   @param  UserSelection  User selection.
52 
53   @retval EFI_SUCCESS            The popup box was successfully displayed.
54   @retval EFI_INVALID_PARAMETER  HiiHandle and Message do not define a valid HII string.
55   @retval EFI_INVALID_PARAMETER  PopupType is not one of the values defined by this specification.
56   @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to display the popup box.
57 
58 **/
59 typedef
60 EFI_STATUS
61 (EFIAPI *EFI_HII_CREATE_POPUP)(
62   IN  EFI_HII_POPUP_PROTOCOL  *This,
63   IN  EFI_HII_POPUP_STYLE     PopupStyle,
64   IN  EFI_HII_POPUP_TYPE      PopupType,
65   IN  EFI_HII_HANDLE          HiiHandle,
66   IN  EFI_STRING_ID           Message,
67   OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL
68   );
69 
70 struct _EFI_HII_POPUP_PROTOCOL {
71   UINT64                  Revision;
72   EFI_HII_CREATE_POPUP    CreatePopup;
73 };
74 
75 extern EFI_GUID  gEfiHiiPopupProtocolGuid;
76 
77 #endif
78