Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chromeos/ime/composition_text.h

Issue 727143002: Moves code from chromeos/ime to ui/base/ime/chromeos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 #ifndef CHROMEOS_IME_COMPOSITION_TEXT_H_
6 #define CHROMEOS_IME_COMPOSITION_TEXT_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/strings/string16.h"
13 #include "chromeos/chromeos_export.h"
14
15 namespace chromeos {
16
17 class CHROMEOS_EXPORT CompositionText {
18 public:
19 enum UnderlineType {
20 COMPOSITION_TEXT_UNDERLINE_SINGLE = 1,
21 COMPOSITION_TEXT_UNDERLINE_DOUBLE = 2,
22 COMPOSITION_TEXT_UNDERLINE_NONE = 4,
23 COMPOSITION_TEXT_UNDERLINE_ERROR = 8,
24 };
25
26 struct UnderlineAttribute {
27 UnderlineType type;
28 uint32 start_index; // The inclusive start index.
29 uint32 end_index; // The exclusive end index.
30 };
31
32 CompositionText();
33 virtual ~CompositionText();
34
35 // Accessors
36 const base::string16& text() const { return text_; }
37 void set_text(const base::string16& text) { text_ = text; }
38
39 const std::vector<UnderlineAttribute>& underline_attributes() const {
40 return underline_attributes_;
41 }
42
43 std::vector<UnderlineAttribute>* mutable_underline_attributes() {
44 return &underline_attributes_;
45 }
46
47 uint32 selection_start() const { return selection_start_; }
48 void set_selection_start(uint32 selection_start) {
49 selection_start_ = selection_start;
50 }
51
52 uint32 selection_end() const { return selection_end_; }
53 void set_selection_end(uint32 selection_end) {
54 selection_end_ = selection_end;
55 }
56
57 void CopyFrom(const CompositionText& obj);
58
59 private:
60 base::string16 text_;
61 std::vector<UnderlineAttribute> underline_attributes_;
62 uint32 selection_start_;
63 uint32 selection_end_;
64
65 DISALLOW_COPY_AND_ASSIGN(CompositionText);
66 };
67
68 } // namespace chromeos
69
70 #endif // CHROMEOS_IME_COMPOSITION_TEXT_H_
OLDNEW
« no previous file with comments | « chromeos/ime/component_extension_ime_manager_unittest.cc ('k') | chromeos/ime/composition_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698