summaryrefslogtreecommitdiff
path: root/Board/EM/MeWrapper/AtAmUi/AtAmUiString.h
blob: 0331127190c8a703fe66f5a2bd5cfd801f238f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/** @file
  Heder file.

@copyright
  Copyright (c) 2012 Intel Corporation. All rights reserved
  This software and associated documentation (if any) is furnished
  under a license and may only be used or copied in accordance
  with the terms of the license. Except as permitted by such
  license, no part of this software or documentation may be
  reproduced, stored in a retrieval system, or transmitted in any
  form or by any means without the express written consent of
  Intel Corporation.

  This file contains a 'Sample Driver' and is licensed as such
  under the terms of your license agreement with Intel or your
  vendor.  This file may be modified by the user, subject to
  the additional terms of the license agreement
**/

#ifndef _ATAMUISTRING_H_
#define _ATAMUISTRING_H_

typedef enum _AT_AM_UI_STRING_ID {
  STR_ATAMUI_LOCKED_TEXT,
  STR_ATAMUI_PLATFORM_ID,
  STR_ATAMUI_PROVIDER_ID,
  STR_ATAMUI_LOCK_DUE_TO,
  STR_ATAMUI_SELECT_PASS,
  STR_ATAMUI_TIME_LEFT,
  STR_ATAMUI_USER_PASS,
  STR_ATAMUI_SERV_BASED_RECOV,
  STR_ATAMUI_INVALID_SELECT,
  STR_ATAMUI_LOCK_TIME,
  STR_ATAMUI_LOCK_STOLEN,
  STR_ATAMUI_LOCK_THRESHOLD,
  STR_ATAMUI_LOCK_ATTACK,
  STR_ATAMUI_CHECKING_PASS,
  STR_ATAMUI_RECO_TRY_AGAIN,
  STR_ATAMUI_RECO_FAILED,
  STR_ATAMUI_RECO_SUCCESS,
  STR_ATAMUI_SUS_ENTER_INFO,
  STR_ATAMUI_RES_REFER,
  STR_ATAMUI_RECO_REFER,
  STR_ATAMUI_SUS_REFER,
  STR_ATAMUI_SUS_ENTER_TOKEN,
  STR_ATAMUI_SUS_ATTEMPT_EXC,
  STR_ATAMUI_SUS_ENTER_SUCCESS,
  STR_ATAMUI_SUS_ENTER_FAILED,
  STR_ATAMUI_SUS_AUTH_FAILED,
  STR_ATAMUI_SUS_EXIT_QUESTION,
  STR_ATAMUI_SUS_EXIT_INFO,
  STR_ATAMUI_SUS_EXIT_SUCCESS,
  STR_ATAMUI_SUS_STAY,
  STR_ATAMUI_SUS_NONCE_FAILED,
  STR_ATAMUI_RECO_ENTER_PASS,
  STR_ATAMUI_TIME_LEFT_SEC,
  STR_ATAMUI_SELECT_OPTION,
  STR_ATAMUI_CHECKING_AUTHENT,
  STR_ATAMUI_FAILED_TO_AUTHENT,
  STR_ATAMUI_RECO_SEC_TOKEN,

  //
  // this has to be a last element of this enum
  //
  STR_ATAMUI_END_OF_TAB
} AT_AM_UI_STRING_ID;

///
/// Strings will be kept in array. There can be created many tables with strings in various
/// languages. A language table can be selected within AtAmUiStrDisplay () to display string in
/// targeted language with the unique string ID. The same unique string ID is applied to all
/// language tables
///
typedef struct _AT_AM_UI_STRING {
  UINTN   StrID;    ///< Unique string ID crated as enum type AT_AM_UI_STRING_ID
  UINT8   X;        ///< The place of cursor row to be display
  UINT8   Y;        ///< The place of cursor column to be display
  CHAR16  *String;  ///< Pointer to the string
} AT_AM_UI_STRING;

#define AT_AM_UI_1_SECOND 1000000

/**
  This function gets character inputted.

  @param[out] Key                 Pointer to buffer for keystroke.

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrGetChar (
  OUT EFI_INPUT_KEY               *Key
  )
;

/**
  This routine displays the string out to the screen based on defined strings.
  It uses X and Y to calculate the start location of string where it will be displayed. Function
  uses string ID to indicate which strings are going to be shown by AtAmUiDisplay(). There will
  be UseXY flag to indicate if there will be used coordinates from Strings library or not. If
  not, the cursor will be moved behind last printed sign. It will be used to print e.g. '*' sign
  during password entering. In graphic mode it is overridden by requirement. In graphic mode, X
  and Y can be calculated the start location of string.

  @param[in] StringID             Unique string ID crated as enum type of AT_AM_UI_STRING_ID
  @param[in] UseXY                Set the current cursor position for the displayed string if it is TRUE
                                  FALSE - don't use coordinates from String library. Cursor is moved behind
                                  last printed sign.
                                  TRUE - Use coordinates from String library.

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrDisplayFix (
  IN UINT32                       StringID,
  IN BOOLEAN                      UseXY
  )
;

/**
  This routine displays the string out to the screen.
  For multi-language support, a language table is expected to be selected by customization here. For example,
  the default language table is US-English in AtAmUiUSStringTab[], a second language table is created by
  customization in AtAmUiSECStringTab[].

  @param[in] String               The NULL-terminated Unicode string to be displayed on the output device(s)

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrDisplay (
  IN CHAR16                       *String
  )
;

/**
  This routine clears the screen.
  In graphic mode it is overridden by requirement.

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrClearScreen (
  VOID
  )
;

/**
  In text mode it is used to set the place of cursor row and cursor column.
  In graphic mode it is overridden by requirement.

  @param[in] CCol                 The column position to set the cursor to be displayed
  @param[in] CRow                 The row position to set the cursor to be displayed

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrSetCursor (
  IN UINT32                       CCol,
  IN UINT32                       CRow
  )
;

/**
  This function enables or disables cursor.
  In graphic mode it is overridden by requirement.

  @param[in] Enabled              If TRUE, the cursor is set to be visible. If FALSE, the cursor is set to be invisible.

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrEnableCursor (
  IN BOOLEAN                      Enabled
  )
;

/**
  In text mode it returns the place of cursor row and cursor column.
  In graphic mode it is overridden by requirement.

  @param[out] CRow                The pointer to return current cursor row
  @param[out] CCol                The pointer to return current cursor column

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiStrGetCursor (
  OUT UINT32                      *CRow,
  OUT UINT32                      *CCol
  )
;

/**
  Function handling delay code.
  In graphic mode it is overridden by requirement.

  @param[in] delay                The number of microseconds to stall execution.

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
AtAmUiDelay (
  IN UINT32                       delay
  )
;

#endif