diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-02-28 16:57:35 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-02-28 16:57:35 +0100 |
commit | de7f581297e8cc50d5fe9694bbccfb7e131ee009 (patch) | |
tree | d95f34f7e892253eefdbdac67afa3d4eb2e8cd4d /telepathy-glib | |
parent | 2d8217676a5765fa580d48f37310ecc0b2c8a5f1 (diff) | |
download | telepathy-glib-de7f581297e8cc50d5fe9694bbccfb7e131ee009.tar.gz |
protocol: add TpProtocol:protocol-properties-vardict
Diffstat (limited to 'telepathy-glib')
-rw-r--r-- | telepathy-glib/protocol.c | 44 | ||||
-rw-r--r-- | telepathy-glib/protocol.h | 2 |
2 files changed, 46 insertions, 0 deletions
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c index 0c39f873e..766beda4d 100644 --- a/telepathy-glib/protocol.c +++ b/telepathy-glib/protocol.c @@ -156,6 +156,7 @@ enum { PROP_PROTOCOL_NAME = 1, PROP_PROTOCOL_PROPERTIES, + PROP_PROTOCOL_PROPERTIES_VARDICT, PROP_ENGLISH_NAME, PROP_VCARD_FIELD, PROP_ICON_NAME, @@ -277,6 +278,11 @@ tp_protocol_get_property (GObject *object, g_value_set_boxed (value, self->priv->protocol_properties); break; + case PROP_PROTOCOL_PROPERTIES_VARDICT: + g_value_take_variant (value, + tp_protocol_dup_immutable_properties (self)); + break; + case PROP_ENGLISH_NAME: g_value_set_string (value, tp_protocol_get_english_name (self)); break; @@ -752,6 +758,28 @@ tp_protocol_class_init (TpProtocolClass *klass) G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** + * TpProtocol:protocol-properties-vardict: + * + * The immutable properties of this Protocol, as provided at construction + * time. This is a #G_VARIANT_TYPE_VARDICT #GVariant, + * which must not be modified. + * + * If the immutable properties were not provided at construction time, + * the %TP_PROTOCOL_FEATURE_PARAMETERS and %TP_PROTOCOL_FEATURE_CORE features + * will both be unavailable, and this #TpProtocol object will only be useful + * as a way to access lower-level D-Bus calls. + * + * Since: UNRELEASED + */ + g_object_class_install_property (object_class, + PROP_PROTOCOL_PROPERTIES_VARDICT, + g_param_spec_variant ("protocol-properties-vardict", + "Protocol properties", + "The immutable properties of this Protocol", + G_VARIANT_TYPE_VARDICT, NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** * TpProtocol:english-name: * * The name of the protocol in a form suitable for display to users, @@ -2346,3 +2374,19 @@ tp_protocol_dup_presence_statuses (TpProtocol *self) return g_list_reverse (l); } + +/** + * tp_protocol_dup_immutable_properties: + * @self: a #TpProtocol object + * + * Return the #TpProtocol:protocol-properties-vardict property. + * + * Returns: (transfer full): the value of + * #TpProtocol:protocol-properties-vardict + * Since: UNRELEASED + */ +GVariant * +tp_protocol_dup_immutable_properties (TpProtocol *self) +{ + return _tp_asv_to_vardict (self->priv->protocol_properties); +} diff --git a/telepathy-glib/protocol.h b/telepathy-glib/protocol.h index 1a06c7fe2..5d964ea5f 100644 --- a/telepathy-glib/protocol.h +++ b/telepathy-glib/protocol.h @@ -102,6 +102,8 @@ GStrv tp_protocol_dup_param_names (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_18 GList *tp_protocol_dup_params (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT; +GVariant * tp_protocol_dup_immutable_properties (TpProtocol *self); + #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_protocol_dup_params) _TP_AVAILABLE_IN_0_18 |