]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/BdsDxe/Hotkey.h
Remove the non-standard definition: GLYPH_WIDTH and GLYPH_HEIGHT. All reference to...
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / Hotkey.h
1 /** @file
2 Provides a way for 3rd party applications to register themselves for launch by the
3 Boot Manager based on hot key
4
5 Copyright (c) 2007 - 2008, Intel Corporation. <BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _HOTKEY_H
17 #define _HOTKEY_H
18
19 #include "Bds.h"
20 #include "String.h"
21
22 #define GET_KEY_CODE_COUNT(KeyOptions) (((KeyOptions) & EFI_KEY_CODE_COUNT) >> 8)
23
24 #define BDS_HOTKEY_OPTION_SIGNATURE EFI_SIGNATURE_32 ('B', 'd', 'K', 'O')
25 typedef struct {
26 UINTN Signature;
27 LIST_ENTRY Link;
28
29 EFI_HANDLE NotifyHandle;
30 UINT16 BootOptionNumber;
31 UINT8 CodeCount;
32 UINT8 WaitingKey;
33 EFI_KEY_DATA KeyData[3];
34 } BDS_HOTKEY_OPTION;
35
36 #define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)
37
38 #define VarKeyOrder L"KeyOrder"
39
40 EFI_STATUS
41 RegisterHotkey (
42 IN EFI_KEY_OPTION *KeyOption,
43 OUT UINT16 *KeyOptionNumber
44 )
45 /*++
46
47 Routine Description:
48
49 Create Key#### for the given hotkey.
50
51 Arguments:
52
53 KeyOption - The Hot Key Option to be added.
54 KeyOptionNumber - The key option number for Key#### (optional).
55
56 Returns:
57
58 EFI_SUCCESS - Register hotkey successfully.
59 EFI_INVALID_PARAMETER - The hotkey option is invalid.
60
61 --*/
62 ;
63
64 EFI_STATUS
65 UnregisterHotkey (
66 IN UINT16 KeyOptionNumber
67 )
68 /*++
69
70 Routine Description:
71
72 Delete Key#### for the given Key Option number.
73
74 Arguments:
75
76 KeyOptionNumber - Key option number for Key####
77
78 Returns:
79
80 EFI_SUCCESS - Unregister hotkey successfully.
81 EFI_NOT_FOUND - No Key#### is found for the given Key Option number.
82
83 --*/
84 ;
85
86
87 EFI_STATUS
88 InitializeHotkeyService (
89 VOID
90 )
91 /*++
92
93 Routine Description:
94
95 Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.
96
97 Arguments:
98
99 None
100
101 Returns:
102
103 EFI_SUCCESS - Hotkey services successfully initialized.
104
105 --*/
106 ;
107
108 #endif