Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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_CANDIDATE_WINDOW_HANDLER_H_ | |
| 6 #define CHROMEOS_IME_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_ | |
| 7 | |
| 8 #include "chromeos/dbus/ibus/ibus_lookup_table.h" | |
| 9 #include "chromeos/ime/ibus_bridge.h" | |
| 10 | |
| 11 namespace chromeos { | |
| 12 | |
| 13 class MockIMECandidateWindowHandler | |
| 14 : public IBusPanelCandidateWindowHandlerInterface { | |
|
satorux1
2013/09/02 01:45:40
IBusPanel? Is this name still relevant? Are you go
Seigo Nonaka
2013/09/02 03:03:10
Yes I will remove or rename IBus prefixed classes.
| |
| 15 public: | |
| 16 struct UpdateLookupTableArg { | |
| 17 IBusLookupTable lookup_table; | |
| 18 bool is_visible; | |
| 19 }; | |
| 20 | |
| 21 struct UpdateAuxiliaryTextArg { | |
| 22 std::string text; | |
| 23 bool is_visible; | |
| 24 }; | |
| 25 | |
| 26 MockIMECandidateWindowHandler(); | |
| 27 virtual ~MockIMECandidateWindowHandler(); | |
| 28 | |
| 29 // IBusPanelCandidateWindowHandlerInterface override. | |
| 30 virtual void UpdateLookupTable(const IBusLookupTable& table, | |
| 31 bool visible) OVERRIDE; | |
| 32 virtual void HideLookupTable() OVERRIDE; | |
| 33 virtual void UpdateAuxiliaryText(const std::string& text, | |
| 34 bool visible) OVERRIDE; | |
| 35 virtual void HideAuxiliaryText() OVERRIDE; | |
| 36 virtual void UpdatePreeditText(const std::string& text, uint32 cursor_pos, | |
| 37 bool visible) OVERRIDE; | |
| 38 virtual void HidePreeditText() OVERRIDE; | |
| 39 virtual void SetCursorLocation(const ibus::Rect& cursor_location, | |
| 40 const ibus::Rect& composition_head) OVERRIDE; | |
| 41 | |
| 42 int set_cursor_location_call_count() const { | |
| 43 return set_cursor_location_call_count_; | |
| 44 } | |
| 45 | |
| 46 int update_lookup_table_call_count() const { | |
| 47 return update_lookup_table_call_count_; | |
| 48 } | |
| 49 | |
| 50 int update_auxiliary_text_call_count() const { | |
| 51 return update_auxiliary_text_call_count_; | |
| 52 } | |
| 53 | |
| 54 const UpdateLookupTableArg& last_update_lookup_table_arg() { | |
| 55 return last_update_lookup_table_arg_; | |
| 56 } | |
| 57 | |
| 58 const UpdateAuxiliaryTextArg& last_update_auxiliary_text_arg() { | |
| 59 return last_update_auxiliary_text_arg_; | |
| 60 } | |
| 61 | |
| 62 // Resets all call count. | |
| 63 void Reset(); | |
| 64 | |
| 65 private: | |
| 66 int set_cursor_location_call_count_; | |
| 67 int update_lookup_table_call_count_; | |
| 68 int update_auxiliary_text_call_count_; | |
| 69 UpdateLookupTableArg last_update_lookup_table_arg_; | |
| 70 UpdateAuxiliaryTextArg last_update_auxiliary_text_arg_; | |
| 71 }; | |
| 72 | |
| 73 } // namespace chromeos | |
| 74 | |
| 75 #endif // CHROMEOS_IME_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_ | |
| OLD | NEW |