Chromium Code Reviews| Index: chromeos/dbus/ibus/ibus_object.h |
| diff --git a/chromeos/dbus/ibus/ibus_object.h b/chromeos/dbus/ibus/ibus_object.h |
| index 8df1d0fcf6cc64ec4a552ad09a894bd47a448510..b37e09c22919bd20f1503afc12b43cf1154b0788 100644 |
| --- a/chromeos/dbus/ibus/ibus_object.h |
| +++ b/chromeos/dbus/ibus/ibus_object.h |
| @@ -25,7 +25,8 @@ namespace chromeos { |
| // |
| // DATA STRUCTURE OVERVIEW: |
| // |
| -// variant struct { |
| +// variant // Handle with top_variant_writer_/top_variant_reader_. |
| +// struct { // Handle with contents_writer_/contents_reader_. |
| // // Header section |
| // string typename // The type name of object, like "IBusText" |
| // array [] // attachement array. |
| @@ -91,9 +92,19 @@ class CHROMEOS_EXPORT IBusObjectReader { |
| bool PopString(std::string* out); |
| bool PopUint32(uint32* out); |
| bool PopArray(dbus::MessageReader* reader); |
| - bool PopIBusObject(IBusObjectReader* reader); |
| + bool PopBool(bool* out); |
| + bool PopInt32(int32* out); |
| bool HasMoreData(); |
| + // Sets up |reader| for reading an IBusObject entry. |
| + bool PopIBusObject(IBusObjectReader* reader); |
| + |
| + // Returns main reader if the specified IBusObject is valid, otherwise returns |
| + // NULL. This reader corresponds to second depth struct field(see above |
|
satorux1
2012/05/18 01:23:36
please add a space before (
Seigo Nonaka
2012/05/18 01:41:52
Done.
|
| + // description). This function is useful in the case of adding other |
| + // IBusObjects. |
| + dbus::MessageReader* GetContentsReader(); |
|
satorux1
2012/05/18 01:23:36
I'm confused. Why do we need to expose this? Canno
Seigo Nonaka
2012/05/18 01:41:52
If I want to add IBusText into some IBusObject, Ap
satorux1
2012/05/18 04:54:46
Where is the IBusObject class? Is there such a cla
Seigo Nonaka
2012/05/18 17:01:47
Sorry not IBusObject, IBusObjectWriter is correct.
|
| + |
| private: |
| enum CheckResult { |
| IBUS_OBJECT_VALID, // Already checked and valid type. |
| @@ -141,6 +152,8 @@ class CHROMEOS_EXPORT IBusObjectWriter { |
| // The following functions delegate dbus::MessageReader's functions. |
| void AppendString(const std::string& input); |
| void AppendUint32(uint32 value); |
| + void AppendInt32(int32 value); |
| + void AppendBool(bool value); |
| void OpenArray(const std::string& signature, |
| dbus::MessageWriter* writer); |
| void CloseContainer(dbus::MessageWriter* writer); |
| @@ -154,6 +167,11 @@ class CHROMEOS_EXPORT IBusObjectWriter { |
| // Returns true if writer is initialized. |
| bool IsInitialized() const; |
| + // Returns main contents writer if it is initialized, otherwise returns NULL. |
| + // this writer corresponds to second depth struct(see above description). This |
| + // function is useful in the case of appeding other IBusObjects. |
| + dbus::MessageWriter* GetContentsWriter(); |
| + |
| private: |
| friend class TestableIBusObjectWriter; |
| // Appends IBusObject headers, should be called once. |