]>
Commit | Line | Data |
---|---|---|
1df5fb2d HZ |
1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
4 | Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>\r | |
5 | \r | |
878b807a | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1df5fb2d HZ |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #include "VirtualKeyboard.h"\r | |
11 | \r | |
12 | //\r | |
13 | // EFI Component Name Protocol\r | |
14 | //\r | |
15 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gVirtualKeyboardComponentName = {\r | |
16 | VirtualKeyboardComponentNameGetDriverName,\r | |
17 | VirtualKeyboardComponentNameGetControllerName,\r | |
18 | "eng"\r | |
19 | };\r | |
20 | \r | |
21 | //\r | |
22 | // EFI Component Name 2 Protocol\r | |
23 | //\r | |
e7108d0e MK |
24 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gVirtualKeyboardComponentName2 = {\r |
25 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)VirtualKeyboardComponentNameGetDriverName,\r | |
26 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)VirtualKeyboardComponentNameGetControllerName,\r | |
1df5fb2d HZ |
27 | "en"\r |
28 | };\r | |
29 | \r | |
e7108d0e | 30 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mVirtualKeyboardDriverNameTable[] = {\r |
1df5fb2d HZ |
31 | {\r |
32 | "eng;en",\r | |
33 | L"Virtual Keyboard Driver"\r | |
34 | },\r | |
35 | {\r | |
36 | "zh-CHS",\r | |
37 | L"虚拟键盘驱动程序"\r | |
38 | },\r | |
39 | {\r | |
40 | NULL,\r | |
41 | NULL\r | |
42 | }\r | |
43 | };\r | |
44 | \r | |
45 | /**\r | |
46 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
47 | \r | |
48 | This function retrieves the user readable name of a driver in the form of a\r | |
49 | Unicode string. If the driver specified by This has a user readable name in\r | |
50 | the language specified by Language, then a pointer to the driver name is\r | |
51 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
52 | by This does not support the language specified by Language,\r | |
53 | then EFI_UNSUPPORTED is returned.\r | |
54 | \r | |
55 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
56 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
57 | \r | |
58 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
59 | array indicating the language. This is the\r | |
60 | language of the driver name that the caller is\r | |
61 | requesting, and it must match one of the\r | |
62 | languages specified in SupportedLanguages. The\r | |
63 | number of languages supported by a driver is up\r | |
64 | to the driver writer. Language is specified\r | |
65 | in RFC 4646 or ISO 639-2 language code format.\r | |
66 | \r | |
67 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
68 | This Unicode string is the name of the\r | |
69 | driver specified by This in the language\r | |
70 | specified by Language.\r | |
71 | \r | |
72 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
73 | This and the language specified by Language was\r | |
74 | returned in DriverName.\r | |
75 | \r | |
76 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
77 | \r | |
78 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
79 | \r | |
80 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
81 | the language specified by Language.\r | |
82 | \r | |
83 | **/\r | |
84 | EFI_STATUS\r | |
85 | EFIAPI\r | |
86 | VirtualKeyboardComponentNameGetDriverName (\r | |
87 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
88 | IN CHAR8 *Language,\r | |
89 | OUT CHAR16 **DriverName\r | |
90 | )\r | |
91 | {\r | |
92 | return LookupUnicodeString2 (\r | |
93 | Language,\r | |
94 | This->SupportedLanguages,\r | |
95 | mVirtualKeyboardDriverNameTable,\r | |
96 | DriverName,\r | |
97 | (BOOLEAN)(This == &gVirtualKeyboardComponentName)\r | |
98 | );\r | |
99 | }\r | |
100 | \r | |
101 | /**\r | |
102 | Retrieves a Unicode string that is the user readable name of the controller\r | |
103 | that is being managed by a driver.\r | |
104 | \r | |
105 | This function retrieves the user readable name of the controller specified by\r | |
106 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
107 | driver specified by This has a user readable name in the language specified by\r | |
108 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
109 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
110 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
111 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
112 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
113 | \r | |
114 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
115 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
116 | \r | |
117 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
118 | specified by This is managing. This handle\r | |
119 | specifies the controller whose name is to be\r | |
120 | returned.\r | |
121 | \r | |
122 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
123 | the name of. This is an optional parameter that\r | |
124 | may be NULL. It will be NULL for device\r | |
125 | drivers. It will also be NULL for a bus drivers\r | |
126 | that wish to retrieve the name of the bus\r | |
127 | controller. It will not be NULL for a bus\r | |
128 | driver that wishes to retrieve the name of a\r | |
129 | child controller.\r | |
130 | \r | |
131 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
132 | array indicating the language. This is the\r | |
133 | language of the driver name that the caller is\r | |
134 | requesting, and it must match one of the\r | |
135 | languages specified in SupportedLanguages. The\r | |
136 | number of languages supported by a driver is up\r | |
137 | to the driver writer. Language is specified in\r | |
138 | RFC 4646 or ISO 639-2 language code format.\r | |
139 | \r | |
140 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
141 | This Unicode string is the name of the\r | |
142 | controller specified by ControllerHandle and\r | |
143 | ChildHandle in the language specified by\r | |
144 | Language from the point of view of the driver\r | |
145 | specified by This.\r | |
146 | \r | |
147 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
148 | the language specified by Language for the\r | |
149 | driver specified by This was returned in\r | |
150 | DriverName.\r | |
151 | \r | |
152 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r | |
153 | \r | |
154 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
155 | EFI_HANDLE.\r | |
156 | \r | |
157 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
158 | \r | |
159 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
160 | \r | |
161 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
162 | managing the controller specified by\r | |
163 | ControllerHandle and ChildHandle.\r | |
164 | \r | |
165 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
166 | the language specified by Language.\r | |
167 | \r | |
168 | **/\r | |
169 | EFI_STATUS\r | |
170 | EFIAPI\r | |
171 | VirtualKeyboardComponentNameGetControllerName (\r | |
e7108d0e MK |
172 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r |
173 | IN EFI_HANDLE ControllerHandle,\r | |
174 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
175 | IN CHAR8 *Language,\r | |
176 | OUT CHAR16 **ControllerName\r | |
1df5fb2d HZ |
177 | )\r |
178 | {\r | |
179 | return EFI_UNSUPPORTED;\r | |
180 | }\r |