| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_ | 5 #ifndef CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_ |
| 6 #define CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_ | 6 #define CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // The IBusLookupTable is one of IBusObjects. IBusLookupTable contains IBusTexts | 23 // The IBusLookupTable is one of IBusObjects. IBusLookupTable contains IBusTexts |
| 24 // but all of them are used as plain string. The overview of each data | 24 // but all of them are used as plain string. The overview of each data |
| 25 // strucutres is as follows: | 25 // strucutres is as follows: |
| 26 // | 26 // |
| 27 // DATA STRUCTURE OVERVIEW: | 27 // DATA STRUCTURE OVERVIEW: |
| 28 // variant struct { | 28 // variant struct { |
| 29 // string "IBusLookupTable" | 29 // string "IBusLookupTable" |
| 30 // array [ | 30 // array [ |
| 31 // dict_entry ( | 31 // dict_entry ( |
| 32 // string "mozc.candidates" | 32 // string "window_show_at_composition" |
| 33 // variant variant array of bytes [ | 33 // variant variant boolean false |
| 34 // 08 01 10 16 ... | |
| 35 // ] | 34 // ] |
| 36 // ) | 35 // ) |
| 37 // ] | 36 // ] |
| 38 // uint32 9 // Page size | 37 // uint32 9 // Page size |
| 39 // uint32 1 // Cursor position | 38 // uint32 1 // Cursor position |
| 40 // boolean true // Cursor visibility. | 39 // boolean true // Cursor visibility. |
| 41 // boolean true // Round lookup table or not. Not used in Chrome. | 40 // boolean true // Round lookup table or not. Not used in Chrome. |
| 42 // int32 1 // Orientation | 41 // int32 1 // Orientation |
| 43 // array [ // Array of candidate text. | 42 // array [ // Array of candidate text. |
| 44 // variant struct { | 43 // variant struct { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 115 |
| 117 // Returns the orientation of lookup table. | 116 // Returns the orientation of lookup table. |
| 118 Orientation orientation() const { return orientation_; } | 117 Orientation orientation() const { return orientation_; } |
| 119 void set_orientation(Orientation orientation) { | 118 void set_orientation(Orientation orientation) { |
| 120 orientation_ = orientation; | 119 orientation_ = orientation; |
| 121 } | 120 } |
| 122 | 121 |
| 123 const std::vector<Entry>& candidates() const { return candidates_; } | 122 const std::vector<Entry>& candidates() const { return candidates_; } |
| 124 std::vector<Entry>* mutable_candidates() { return &candidates_; } | 123 std::vector<Entry>* mutable_candidates() { return &candidates_; } |
| 125 | 124 |
| 126 const std::string& serialized_mozc_candidates_data() { | 125 bool show_window_at_composition() { return show_window_at_composition_; } |
| 127 return serialized_mozc_candidates_data_; | 126 void set_show_window_at_composition(bool show_window_at_composition) { |
| 128 } | 127 show_window_at_composition_ = show_window_at_composition; |
| 129 void set_serialized_mozc_candidates_data( | |
| 130 const std::string& serialized_mozc_candidates_data) { | |
| 131 serialized_mozc_candidates_data_ = serialized_mozc_candidates_data; | |
| 132 } | 128 } |
| 133 | 129 |
| 134 private: | 130 private: |
| 135 uint32 page_size_; | 131 uint32 page_size_; |
| 136 uint32 cursor_position_; | 132 uint32 cursor_position_; |
| 137 bool is_cursor_visible_; | 133 bool is_cursor_visible_; |
| 138 Orientation orientation_; | 134 Orientation orientation_; |
| 139 std::vector<Entry> candidates_; | 135 std::vector<Entry> candidates_; |
| 140 | 136 bool show_window_at_composition_; |
| 141 // TODO(nona): Refine data structure(crbug.com/129403). | |
| 142 std::string serialized_mozc_candidates_data_; | |
| 143 | 137 |
| 144 DISALLOW_COPY_AND_ASSIGN(IBusLookupTable); | 138 DISALLOW_COPY_AND_ASSIGN(IBusLookupTable); |
| 145 }; | 139 }; |
| 146 | 140 |
| 147 } // namespace ibus | 141 } // namespace ibus |
| 148 } // namespace chromeos | 142 } // namespace chromeos |
| 149 | 143 |
| 150 #endif // CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_ | 144 #endif // CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_ |
| OLD | NEW |