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

Side by Side Diff: chromeos/dbus/ibus/ibus_property.cc

Issue 11361210: Extends IBusObject to handle attachment field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix include order Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/ibus/ibus_object_unittest.cc ('k') | chromeos/dbus/ibus/ibus_text.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chromeos/dbus/ibus/ibus_property.h" 5 #include "chromeos/dbus/ibus/ibus_property.h"
6 6
7 #include <string> 7 #include <string>
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chromeos/dbus/ibus/ibus_constants.h" 9 #include "chromeos/dbus/ibus/ibus_constants.h"
10 #include "chromeos/dbus/ibus/ibus_object.h" 10 #include "chromeos/dbus/ibus/ibus_object.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 property_list->push_back(property); 133 property_list->push_back(property);
134 } 134 }
135 135
136 return true; 136 return true;
137 } 137 }
138 138
139 void CHROMEOS_EXPORT AppendIBusProperty(const IBusProperty& property, 139 void CHROMEOS_EXPORT AppendIBusProperty(const IBusProperty& property,
140 dbus::MessageWriter* writer) { 140 dbus::MessageWriter* writer) {
141 IBusObjectWriter ibus_property_writer("IBusProperty", "suvsvbbuv", writer); 141 IBusObjectWriter ibus_property_writer("IBusProperty", "suvsvbbuv", writer);
142 ibus_property_writer.CloseHeader();
143
142 ibus_property_writer.AppendString(property.key()); 144 ibus_property_writer.AppendString(property.key());
143 ibus_property_writer.AppendUint32(static_cast<uint32>(property.type())); 145 ibus_property_writer.AppendUint32(static_cast<uint32>(property.type()));
144 ibus_property_writer.AppendStringAsIBusText(property.label()); 146 ibus_property_writer.AppendStringAsIBusText(property.label());
145 ibus_property_writer.AppendString(""); // The icon path is not supported. 147 ibus_property_writer.AppendString(""); // The icon path is not supported.
146 ibus_property_writer.AppendStringAsIBusText(property.tooltip()); 148 ibus_property_writer.AppendStringAsIBusText(property.tooltip());
147 // The event sensitive field is not supported. 149 // The event sensitive field is not supported.
148 ibus_property_writer.AppendBool(false); 150 ibus_property_writer.AppendBool(false);
149 ibus_property_writer.AppendBool(property.visible()); 151 ibus_property_writer.AppendBool(property.visible());
150 ibus_property_writer.AppendUint32(static_cast<uint32>(property.checked())); 152 ibus_property_writer.AppendUint32(static_cast<uint32>(property.checked()));
151 ibus_property_writer.AppendIBusPropertyList(property.sub_properties()); 153 ibus_property_writer.AppendIBusPropertyList(property.sub_properties());
152 ibus_property_writer.CloseAll(); 154 ibus_property_writer.CloseAll();
153 } 155 }
154 156
155 void CHROMEOS_EXPORT AppendIBusPropertyList( 157 void CHROMEOS_EXPORT AppendIBusPropertyList(
156 const IBusPropertyList& property_list, 158 const IBusPropertyList& property_list,
157 dbus::MessageWriter* writer) { 159 dbus::MessageWriter* writer) {
158 IBusObjectWriter ibus_property_list_writer("IBusPropList", "av", writer); 160 IBusObjectWriter ibus_property_list_writer("IBusPropList", "av", writer);
161 ibus_property_list_writer.CloseHeader();
159 dbus::MessageWriter property_list_writer(NULL); 162 dbus::MessageWriter property_list_writer(NULL);
160 ibus_property_list_writer.OpenArray("v", &property_list_writer); 163 ibus_property_list_writer.OpenArray("v", &property_list_writer);
161 for (size_t i = 0; i < property_list.size(); ++i) { 164 for (size_t i = 0; i < property_list.size(); ++i) {
162 AppendIBusProperty(*(property_list[i]), &property_list_writer); 165 AppendIBusProperty(*(property_list[i]), &property_list_writer);
163 } 166 }
164 ibus_property_list_writer.CloseContainer(&property_list_writer); 167 ibus_property_list_writer.CloseContainer(&property_list_writer);
165 ibus_property_list_writer.CloseAll(); 168 ibus_property_list_writer.CloseAll();
166 } 169 }
167 170
168 171
169 /////////////////////////////////////////////////////////////////////////////// 172 ///////////////////////////////////////////////////////////////////////////////
170 // IBusProperty 173 // IBusProperty
171 IBusProperty::IBusProperty() 174 IBusProperty::IBusProperty()
172 : type_(IBUS_PROPERTY_TYPE_NORMAL), 175 : type_(IBUS_PROPERTY_TYPE_NORMAL),
173 visible_(false), 176 visible_(false),
174 checked_(false) { 177 checked_(false) {
175 } 178 }
176 179
177 IBusProperty::~IBusProperty() { 180 IBusProperty::~IBusProperty() {
178 } 181 }
179 182
180 } // namespace ibus 183 } // namespace ibus
181 } // namespace chromeos 184 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/ibus/ibus_object_unittest.cc ('k') | chromeos/dbus/ibus/ibus_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698