4b606b063c36cb66a4a332f0309a271b187901b0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / input_method / mock_input_method_engine.cc
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/input_method/mock_input_method_engine.h"
6
7 #include <map>
8
9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h"
14 #include "chromeos/ime/component_extension_ime_manager.h"
15 #include "chromeos/ime/extension_ime_util.h"
16 #include "chromeos/ime/ibus_keymap.h"
17 #include "chromeos/ime/ibus_text.h"
18 #include "chromeos/ime/input_method_manager.h"
19 #include "ui/base/ime/candidate_window.h"
20 #include "ui/events/event.h"
21 #include "ui/events/keycodes/dom4/keycode_converter.h"
22 #include "ui/events/keycodes/keyboard_code_conversion_x.h"
23 #include "ui/keyboard/keyboard_controller.h"
24
25 namespace chromeos {
26
27 MockInputMethodEngine::MockInputMethodEngine(
28     const input_method::InputMethodDescriptor& descriptor)
29     : descriptor_(descriptor) {}
30
31 MockInputMethodEngine::~MockInputMethodEngine() {}
32
33 const input_method::InputMethodDescriptor&
34 MockInputMethodEngine::GetDescriptor() const {
35   return descriptor_;
36 }
37
38 void MockInputMethodEngine::StartIme() {
39 }
40
41 bool MockInputMethodEngine::SetComposition(
42     int context_id,
43     const char* text,
44     int selection_start,
45     int selection_end,
46     int cursor,
47     const std::vector<SegmentInfo>& segments,
48     std::string* error) {
49   return true;
50 }
51
52 bool MockInputMethodEngine::ClearComposition(int context_id,
53                                              std::string* error)  {
54   return true;
55 }
56
57 bool MockInputMethodEngine::CommitText(int context_id,
58                                        const char* text,
59                                        std::string* error) {
60   return true;
61 }
62
63 bool MockInputMethodEngine::SendKeyEvents(
64     int context_id,
65     const std::vector<KeyboardEvent>& events) {
66   return true;
67 }
68
69 const MockInputMethodEngine::CandidateWindowProperty&
70 MockInputMethodEngine::GetCandidateWindowProperty() const {
71   return candidate_window_property_;
72 }
73
74 void MockInputMethodEngine::SetCandidateWindowProperty(
75     const CandidateWindowProperty& property) {
76 }
77
78 bool MockInputMethodEngine::SetCandidateWindowVisible(bool visible,
79                                                       std::string* error) {
80   return true;
81 }
82
83 bool MockInputMethodEngine::SetCandidates(
84     int context_id,
85     const std::vector<Candidate>& candidates,
86     std::string* error) {
87   return true;
88 }
89
90 bool MockInputMethodEngine::SetCursorPosition(int context_id,
91                                               int candidate_id,
92                                               std::string* error) {
93   return true;
94 }
95
96 bool MockInputMethodEngine::SetMenuItems(const std::vector<MenuItem>& items) {
97   return true;
98 }
99
100 bool MockInputMethodEngine::UpdateMenuItems(
101     const std::vector<MenuItem>& items) {
102   return true;
103 }
104
105 bool MockInputMethodEngine::IsActive() const {
106   return true;
107 }
108
109 void MockInputMethodEngine::KeyEventDone(input_method::KeyEventHandle* key_data,
110                                          bool handled) {
111 }
112
113 bool MockInputMethodEngine::DeleteSurroundingText(int context_id,
114                                                   int offset,
115                                                   size_t number_of_chars,
116                                                   std::string* error) {
117   return true;
118 }
119
120 void MockInputMethodEngine::HideInputView() {
121 }
122
123 void MockInputMethodEngine::FocusIn(
124     const IMEEngineHandlerInterface::InputContext& input_context) {
125 }
126
127 void MockInputMethodEngine::FocusOut() {
128 }
129
130 void MockInputMethodEngine::Enable() {
131 }
132
133 void MockInputMethodEngine::Disable() {
134 }
135
136 void MockInputMethodEngine::PropertyActivate(const std::string& property_name) {
137 }
138
139 void MockInputMethodEngine::Reset() {
140 }
141
142 void MockInputMethodEngine::ProcessKeyEvent(
143     const ui::KeyEvent& key_event,
144     const KeyEventDoneCallback& callback) {
145 }
146
147 void MockInputMethodEngine::CandidateClicked(uint32 index) {
148 }
149
150 void MockInputMethodEngine::SetSurroundingText(const std::string& text,
151                                                uint32 cursor_pos,
152                                                uint32 anchor_pos) {
153 }
154
155 }  // namespace chromeos