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 UI_BASE_IME_COMPOSITION_TEXT_H_ | 5 #ifndef UI_BASE_IME_COMPOSITION_TEXT_H_ |
6 #define UI_BASE_IME_COMPOSITION_TEXT_H_ | 6 #define UI_BASE_IME_COMPOSITION_TEXT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "ui/base/ime/composition_underline.h" | 11 #include "ui/base/ime/composition_underline.h" |
12 #include "ui/base/ime/ui_base_ime_export.h" | 12 #include "ui/base/ime/ui_base_ime_export.h" |
13 #include "ui/gfx/range/range.h" | 13 #include "ui/gfx/range/range.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 | 16 |
17 // A struct represents the status of an ongoing composition text. | 17 // A struct represents the status of an ongoing composition text. |
18 struct UI_BASE_IME_EXPORT CompositionText { | 18 struct UI_BASE_IME_EXPORT CompositionText { |
19 CompositionText(); | 19 CompositionText(); |
| 20 CompositionText(const CompositionText& other); |
20 ~CompositionText(); | 21 ~CompositionText(); |
21 | 22 |
22 bool operator==(const CompositionText& rhs) const { | 23 bool operator==(const CompositionText& rhs) const { |
23 if ((this->text != rhs.text) || | 24 if ((this->text != rhs.text) || |
24 (this->selection != rhs.selection) || | 25 (this->selection != rhs.selection) || |
25 (this->underlines.size() != rhs.underlines.size())) | 26 (this->underlines.size() != rhs.underlines.size())) |
26 return false; | 27 return false; |
27 for (size_t i = 0; i < this->underlines.size(); ++i) { | 28 for (size_t i = 0; i < this->underlines.size(); ++i) { |
28 if (this->underlines[i] != rhs.underlines[i]) | 29 if (this->underlines[i] != rhs.underlines[i]) |
29 return false; | 30 return false; |
(...skipping 20 matching lines...) Expand all Loading... |
50 // Selection range in the composition text. It represents the caret position | 51 // Selection range in the composition text. It represents the caret position |
51 // if the range length is zero. Usually it's used for representing the target | 52 // if the range length is zero. Usually it's used for representing the target |
52 // clause (on Windows). Gtk doesn't have such concept, so background color is | 53 // clause (on Windows). Gtk doesn't have such concept, so background color is |
53 // usually used instead. | 54 // usually used instead. |
54 gfx::Range selection; | 55 gfx::Range selection; |
55 }; | 56 }; |
56 | 57 |
57 } // namespace ui | 58 } // namespace ui |
58 | 59 |
59 #endif // UI_BASE_IME_COMPOSITION_TEXT_H_ | 60 #endif // UI_BASE_IME_COMPOSITION_TEXT_H_ |
OLD | NEW |