- add sources.
[platform/framework/web/crosswalk.git] / src / chromeos / ime / mock_ime_engine_handler.h
1 // Copyright 2013 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 #ifndef CHROMEOS_IME_MOCK_IME_ENGINE_HANDLER_H_
6 #define CHROMEOS_IME_MOCK_IME_ENGINE_HANDLER_H_
7
8 #include "chromeos/ime/ibus_bridge.h"
9
10 namespace chromeos {
11
12 class MockIMEEngineHandler : public IBusEngineHandlerInterface {
13  public:
14   MockIMEEngineHandler();
15   virtual ~MockIMEEngineHandler();
16
17   virtual void FocusIn(ibus::TextInputType text_input_type) OVERRIDE;
18   virtual void FocusOut() OVERRIDE;
19   virtual void Enable() OVERRIDE;
20   virtual void Disable() OVERRIDE;
21   virtual void PropertyActivate(const std::string& property_name) OVERRIDE;
22   virtual void PropertyShow(const std::string& property_name) OVERRIDE;
23   virtual void PropertyHide(const std::string& property_name) OVERRIDE;
24   virtual void SetCapability(IBusCapability capability) OVERRIDE;
25   virtual void Reset() OVERRIDE;
26   virtual void ProcessKeyEvent(uint32 keysym, uint32 keycode, uint32 state,
27                                const KeyEventDoneCallback& callback) OVERRIDE;
28   virtual void CandidateClicked(uint32 index, ibus::IBusMouseButton button,
29                                 uint32 state) OVERRIDE;
30   virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos,
31                                   uint32 anchor_pos) OVERRIDE;
32
33   int focus_in_call_count() const { return focus_in_call_count_; }
34   int focus_out_call_count() const { return focus_out_call_count_; }
35   int reset_call_count() const { return reset_call_count_; }
36   int set_surrounding_text_call_count() const {
37     return set_surrounding_text_call_count_;
38   }
39   int process_key_event_call_count() const {
40     return process_key_event_call_count_;
41   }
42
43   ibus::TextInputType last_text_input_type() const {
44     return last_text_input_type_;
45   }
46
47   std::string last_set_surrounding_text() const {
48     return last_set_surrounding_text_;
49   }
50
51   uint32 last_set_surrounding_cursor_pos() const {
52     return last_set_surrounding_cursor_pos_;
53   }
54
55   uint32 last_set_surrounding_anchor_pos() const {
56     return last_set_surrounding_anchor_pos_;
57   }
58
59   uint32 last_processed_keysym() const {
60     return last_processed_keysym_;
61   }
62
63   uint32 last_processed_keycode() const {
64     return last_processed_keycode_;
65   }
66
67   uint32 last_processed_state() const {
68     return last_processed_state_;
69   }
70
71   const KeyEventDoneCallback& last_passed_callback() const {
72     return last_passed_callback_;
73   }
74
75  private:
76   int focus_in_call_count_;
77   int focus_out_call_count_;
78   int set_surrounding_text_call_count_;
79   int process_key_event_call_count_;
80   int reset_call_count_;
81   ibus::TextInputType last_text_input_type_;
82   std::string last_set_surrounding_text_;
83   uint32 last_set_surrounding_cursor_pos_;
84   uint32 last_set_surrounding_anchor_pos_;
85   uint32 last_processed_keysym_;
86   uint32 last_processed_keycode_;
87   uint32 last_processed_state_;
88   KeyEventDoneCallback last_passed_callback_;
89 };
90
91 }  // namespace chromeos
92
93 #endif  // CHROMEOS_IME_MOCK_IME_ENGINE_HANDLER_H_