blob: 44c2b2d5bd221c08badc4a1b4c5c8586c3387880 [file] [log] [blame]
[email protected]c6d068ff2011-10-14 17:28:231// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]8b048322009-05-11 04:41:212// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]c6d068ff2011-10-14 17:28:235#ifndef CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_
6#define CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
[email protected]8b048322009-05-11 04:41:218
9#include <windows.h>
10
11#include <string>
[email protected]9db40b682009-05-29 00:39:5912#include <vector>
[email protected]8b048322009-05-11 04:41:2113#include "base/basictypes.h"
14
15// Implements the platform-dependent part of a pseudo keyboard device for
16// Windows.
17class 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]9db40b682009-05-29 00:39:5927 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]8b048322009-05-11 04:41:2132 HKL original_keyboard_layout_;
[email protected]9db40b682009-05-29 00:39:5933 // The currently active driver.
34 HKL active_keyboard_layout_;
[email protected]8b048322009-05-11 04:41:2135 BYTE original_keyboard_states_[256];
36
[email protected]8b048322009-05-11 04:41:2137 BYTE keyboard_states_[256];
38
39 DISALLOW_COPY_AND_ASSIGN(MockKeyboardDriverWin);
40};
41
[email protected]c6d068ff2011-10-14 17:28:2342#endif // CONTENT_TEST_MOCK_KEYBOARD_DRIVER_WIN_H_