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

Unified Diff: chromeos/ime/ibus_text.h

Issue 61003004: Delete ibus_object and move ibus_text to chromeos/ime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified based on the review. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/ibus/ibus_text_unittest.cc ('k') | chromeos/ime/ibus_text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/ibus_text.h
diff --git a/chromeos/ime/ibus_text.h b/chromeos/ime/ibus_text.h
new file mode 100644
index 0000000000000000000000000000000000000000..b34a54c7d8b776e449bfc4c952581b65bac2b5cf
--- /dev/null
+++ b/chromeos/ime/ibus_text.h
@@ -0,0 +1,86 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_IME_IBUS_TEXT_H_
+#define CHROMEOS_IME_IBUS_TEXT_H_
+
+#include <string>
+#include <vector>
+#include "base/basictypes.h"
+#include "chromeos/chromeos_export.h"
+
+namespace chromeos {
+
+class CHROMEOS_EXPORT IBusText {
+ public:
+ enum IBusTextUnderlineType {
+ IBUS_TEXT_UNDERLINE_SINGLE = 1,
+ IBUS_TEXT_UNDERLINE_DOUBLE = 2,
+ IBUS_TEXT_UNDERLINE_ERROR = 4,
+ };
+
+ struct UnderlineAttribute {
+ IBusTextUnderlineType type;
+ uint32 start_index; // The inclusive start index.
+ uint32 end_index; // The exclusive end index.
+ };
+
+ struct SelectionAttribute {
+ uint32 start_index; // The inclusive start index.
+ uint32 end_index; // The exclusive end index.
+ };
+
+ // Accessors
+ IBusText();
+ virtual ~IBusText();
+
+ const std::string& text() const { return text_; }
+ void set_text(const std::string& text) { text_ = text; }
+
+ const std::string& annotation() const { return annotation_; }
+ void set_annotation(const std::string& annotation) {
+ annotation_ = annotation;
+ }
+
+ const std::string& description_title() const { return description_title_; }
+ void set_description_title(const std::string& title) {
+ description_title_ = title;
+ }
+
+ const std::string& description_body() const { return description_body_; }
+ void set_description_body(const std::string& body) {
+ description_body_ = body;
+ }
+
+ const std::vector<UnderlineAttribute>& underline_attributes() const {
+ return underline_attributes_;
+ }
+
+ std::vector<UnderlineAttribute>* mutable_underline_attributes() {
+ return &underline_attributes_;
+ }
+
+ const std::vector<SelectionAttribute>& selection_attributes() const {
+ return selection_attributes_;
+ }
+ std::vector<SelectionAttribute>* mutable_selection_attributes() {
+ return &selection_attributes_;
+ }
+
+ void CopyFrom(const IBusText& obj);
+
+ private:
+ std::string text_;
+ std::string annotation_;
+ std::string description_title_;
+ std::string description_body_;
+ std::vector<UnderlineAttribute> underline_attributes_;
+ std::vector<SelectionAttribute> selection_attributes_;
+
+ DISALLOW_COPY_AND_ASSIGN(IBusText);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_IME_IBUS_TEXT_H_
« no previous file with comments | « chromeos/dbus/ibus/ibus_text_unittest.cc ('k') | chromeos/ime/ibus_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698