[email protected] | c6d068ff | 2011-10-14 17:28:23 | [diff] [blame^] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | c6d068ff | 2011-10-14 17:28:23 | [diff] [blame^] | 5 | #ifndef CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ |
6 | #define CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 8 | |
9 | #include <windows.h> | ||||
10 | |||||
11 | #include <string> | ||||
[email protected] | 9db40b68 | 2009-05-29 00:39:59 | [diff] [blame] | 12 | #include <vector> |
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 13 | #include "base/basictypes.h" |
14 | |||||
15 | // Implements the platform-dependent part of a pseudo keyboard device for | ||||
16 | // Windows. | ||||
17 | class MockKeyboardDriverWin { | ||||
18 | public: | ||||
19 | MockKeyboardDriverWin(); | ||||
20 | ~MockKeyboardDriverWin(); | ||||
21 | |||||
22 | bool SetLayout(int layout); | ||||
23 | bool SetModifiers(int modifiers); | ||||
24 | int GetCharacters(int key_code, std::wstring* code); | ||||
25 | |||||
26 | private: | ||||
[email protected] | 9db40b68 | 2009-05-29 00:39:59 | [diff] [blame] | 27 | void MaybeUnloadActiveLayout(); |
28 | |||||
29 | // The list of keyboard drivers that are installed on this machine. | ||||
30 | std::vector<HKL> orig_keyboard_layouts_list_; | ||||
31 | // The active keyboard driver at the time the Ctor was called. | ||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 32 | HKL original_keyboard_layout_; |
[email protected] | 9db40b68 | 2009-05-29 00:39:59 | [diff] [blame] | 33 | // The currently active driver. |
34 | HKL active_keyboard_layout_; | ||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 35 | BYTE original_keyboard_states_[256]; |
36 | |||||
[email protected] | 8b04832 | 2009-05-11 04:41:21 | [diff] [blame] | 37 | BYTE keyboard_states_[256]; |
38 | |||||
39 | DISALLOW_COPY_AND_ASSIGN(MockKeyboardDriverWin); | ||||
40 | }; | ||||
41 | |||||
[email protected] | c6d068ff | 2011-10-14 17:28:23 | [diff] [blame^] | 42 | #endif // CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_ |