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_TEXT_H_ | 5 #ifndef CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_ |
6 #define CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_ | 6 #define CHROMEOS_DBUS_IBUS_IBUS_TEXT_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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 // ] | 75 // ] |
76 // } | 76 // } |
77 // } | 77 // } |
78 // | 78 // |
79 class IBusText; | 79 class IBusText; |
80 | 80 |
81 // Pops a IBusText from |reader|. | 81 // Pops a IBusText from |reader|. |
82 // Returns false if an error occures. | 82 // Returns false if an error occures. |
83 bool CHROMEOS_EXPORT PopIBusText(dbus::MessageReader* reader, | 83 bool CHROMEOS_EXPORT PopIBusText(dbus::MessageReader* reader, |
84 IBusText* ibus_text); | 84 IBusText* ibus_text); |
85 // Pops a IBusText from |reader| and stores it's text field into text. Use | |
86 // PopIBusText instead in the case of using any attribute entries in IBusText. | |
87 // Return false if an error occures. | |
satorux1
2012/05/18 01:11:06
// Returns true on success.
Seigo Nonaka
2012/05/18 01:18:43
Done.
| |
88 bool CHROMEOS_EXPORT PopStringFromIBusText(dbus::MessageReader* reader, | |
89 std::string* text); | |
85 // Appends a IBusText to |writer|. | 90 // Appends a IBusText to |writer|. |
86 void CHROMEOS_EXPORT AppendIBusText(const IBusText& ibus_text, | 91 void CHROMEOS_EXPORT AppendIBusText(const IBusText& ibus_text, |
87 dbus::MessageWriter* writer); | 92 dbus::MessageWriter* writer); |
88 | 93 |
94 // Appends a string to |writer| as IBusText without any attributes. Use | |
95 // AppendIBusText instead in the case of using any attribute entries. | |
96 void CHROMEOS_EXPORT AppendStringAsIBusText(const std::string& text, | |
97 dbus::MessageWriter* writer); | |
98 | |
89 // Handles IBusText object which is used in dbus communication with ibus-daemon. | 99 // Handles IBusText object which is used in dbus communication with ibus-daemon. |
90 // The IBusAttribute has four uint32 variables and the IBusAttributes represents | 100 // The IBusAttribute has four uint32 variables and the IBusAttributes represents |
91 // three type of decoration based on it's values. | 101 // three type of decoration based on it's values. |
92 // 1. Underline decoration (corresponds to UnderlineAttribute structure) | 102 // 1. Underline decoration (corresponds to UnderlineAttribute structure) |
93 // 1st value: indicates underline attribute. | 103 // 1st value: indicates underline attribute. |
94 // 2nd value: type of decoration. Chrome only support single and double | 104 // 2nd value: type of decoration. Chrome only support single and double |
95 // underline and error line. | 105 // underline and error line. |
96 // 3rd value: the start index of this attribute in multibyte. | 106 // 3rd value: the start index of this attribute in multibyte. |
97 // 4th value: the end index of this attribute in multibyte. | 107 // 4th value: the end index of this attribute in multibyte. |
98 // | 108 // |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 std::vector<UnderlineAttribute> underline_attributes_; | 153 std::vector<UnderlineAttribute> underline_attributes_; |
144 std::vector<SelectionAttribute> selection_attributes_; | 154 std::vector<SelectionAttribute> selection_attributes_; |
145 | 155 |
146 DISALLOW_COPY_AND_ASSIGN(IBusText); | 156 DISALLOW_COPY_AND_ASSIGN(IBusText); |
147 }; | 157 }; |
148 | 158 |
149 } // namespace ibus | 159 } // namespace ibus |
150 } // namespace chromeos | 160 } // namespace chromeos |
151 | 161 |
152 #endif // CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_ | 162 #endif // CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_ |
OLD | NEW |