ShellPkg/[hex]edit: use SimpleTextInEx to read console
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / EditMenuBar.h
CommitLineData
2442e62a 1/** @file\r
2 Declares menubar interface functions.\r
3\r
5563281f 4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>\r
2442e62a 5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _LIB_MENU_BAR_H_\r
16#define _LIB_MENU_BAR_H_\r
17\r
5a2beb74 18#define SCAN_CONTROL_E 5\r
19#define SCAN_CONTROL_F 6\r
20#define SCAN_CONTROL_G 7\r
21#define SCAN_CONTROL_K 11\r
22#define SCAN_CONTROL_O 15\r
23#define SCAN_CONTROL_Q 17\r
24#define SCAN_CONTROL_R 18\r
25#define SCAN_CONTROL_S 19\r
26#define SCAN_CONTROL_T 20\r
27#define SCAN_CONTROL_U 21\r
28#define SCAN_CONTROL_W 23\r
29#define SCAN_CONTROL_Z 26\r
30\r
31\r
2442e62a 32typedef\r
33EFI_STATUS\r
2b578de0 34(*MENU_ITEM_FUNCTION) (\r
2442e62a 35 VOID\r
36 );\r
37\r
38typedef struct _EDITOR_MENU_ITEM {\r
39 EFI_STRING_ID NameToken;\r
40 CHAR16 FunctionKeyToken;\r
41 MENU_ITEM_FUNCTION Function;\r
42} EDITOR_MENU_ITEM;\r
43\r
44/**\r
45 Initializa the menu bar with the specified items.\r
46\r
47 @param[in] Items The items to display and their functions.\r
48\r
49 @retval EFI_SUCCESS The initialization was correct.\r
50 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
51**/\r
52EFI_STATUS\r
2442e62a 53MenuBarInit (\r
54 IN CONST EDITOR_MENU_ITEM *Items\r
55 );\r
56\r
5a2beb74 57/**\r
58 Initialize the control hot-key with the specified items.\r
59\r
60 @param[in] Items The hot-key functions.\r
61\r
62 @retval EFI_SUCCESS The initialization was correct.\r
63**/\r
64EFI_STATUS\r
5a2beb74 65ControlHotKeyInit (\r
66 IN MENU_ITEM_FUNCTION *Items\r
67 );\r
68\r
2442e62a 69/**\r
70 Cleanup function for a menu bar. frees all allocated memory.\r
71**/\r
72VOID\r
2442e62a 73MenuBarCleanup (\r
74 VOID\r
75 );\r
76\r
77/**\r
78 Refresh function for the menu bar.\r
79\r
80 @param[in] LastRow The last printable row.\r
81 @param[in] LastCol The last printable column.\r
82\r
83 @retval EFI_SUCCESS The refresh was successful.\r
84**/\r
85EFI_STATUS\r
2442e62a 86MenuBarRefresh (\r
87 IN CONST UINTN LastRow,\r
88 IN CONST UINTN LastCol\r
89 );\r
90\r
91/**\r
92 Function to dispatch the correct function based on a function key (F1...)\r
93\r
94 @param[in] Key The pressed key.\r
95\r
96 @retval EFI_NOT_FOUND The key was not a valid function key \r
97 (an error was sent to the status bar).\r
98 @return The return value from the called dispatch function.\r
99**/\r
100EFI_STATUS\r
2442e62a 101MenuBarDispatchFunctionKey (\r
102 IN CONST EFI_INPUT_KEY *Key\r
103 );\r
104\r
5a2beb74 105/**\r
106 Function to dispatch the correct function based on a control-based key (ctrl+o...)\r
107\r
5563281f 108 @param[in] KeyData The pressed key.\r
5a2beb74 109\r
110 @retval EFI_NOT_FOUND The key was not a valid control-based key \r
111 (an error was sent to the status bar).\r
112 @return EFI_SUCCESS.\r
113**/\r
114EFI_STATUS\r
5a2beb74 115MenuBarDispatchControlHotKey (\r
5563281f 116 IN CONST EFI_KEY_DATA *KeyData\r
5a2beb74 117 );\r
118\r
2442e62a 119#endif\r