[next] telepathy-glib: future-account: add service property and setter
Jonny Lamb
jonny at kemper.freedesktop.org
Fri May 11 02:41:39 PDT 2012
Module: telepathy-glib
Branch: next
Commit: d9cd4d3fb69147d9f51fd762dbca7f9b6119971c
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=d9cd4d3fb69147d9f51fd762dbca7f9b6119971c
Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date: Wed May 9 10:40:56 2012 +0100
future-account: add service property and setter
Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
docs/reference/telepathy-glib-sections.txt | 1 +
telepathy-glib/future-account.c | 46 ++++++++++++++++++++++++++++
telepathy-glib/future-account.h | 4 ++
3 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 57b8eb2..2157e1c 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -5245,6 +5245,7 @@ tp_future_account_set_enabled
tp_future_account_set_connect_automatically
tp_future_account_add_supersedes
tp_future_account_set_avatar
+tp_future_account_set_service
<SUBSECTION>
tp_future_account_set_parameter
tp_future_account_set_parameter_string
diff --git a/telepathy-glib/future-account.c b/telepathy-glib/future-account.c
index 70759db..8c86205 100644
--- a/telepathy-glib/future-account.c
+++ b/telepathy-glib/future-account.c
@@ -143,6 +143,7 @@ enum {
PROP_SUPERSEDES,
PROP_AVATAR,
PROP_AVATAR_MIME_TYPE,
+ PROP_SERVICE,
N_PROPS
};
@@ -675,6 +676,24 @@ tp_future_account_class_init (TpFutureAccountClass *klass)
"The account's avatar's mime type",
NULL,
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
+
+ /**
+ * TpFutureAccount:service:
+ *
+ * A string describing the service of the account, which must
+ * consist only of ASCII letters, numbers and hyphen/minus signs,
+ * and start with a letter (matching the requirements for
+ * Protocol). To change this property, use
+ * tp_future_account_set_service().
+ *
+ * Since: 0.UNRELEASED
+ */
+ g_object_class_install_property (object_class, PROP_SERVICE,
+ g_param_spec_string ("service",
+ "Service",
+ "The account's service",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}
/**
@@ -1061,6 +1080,33 @@ tp_future_account_set_avatar (TpFutureAccount *self,
}
/**
+ * tp_future_account_set_service:
+ * @self: a #TpFutureAccount
+ * @service: the service name for
+ *
+ * Set the service property of the account to @service. Use the
+ * #TpFutureAccount:service property to read the current value.
+ *
+ * Since: 0.UNRELEASED
+ */
+void
+tp_future_account_set_service (TpFutureAccount *self,
+ const gchar *service)
+{
+ TpFutureAccountPrivate *priv;
+
+ g_return_if_fail (TP_IS_FUTURE_ACCOUNT (self));
+ g_return_if_fail (service != NULL);
+
+ priv = self->priv;
+
+ g_return_if_fail (priv->result == NULL && !priv->created);
+
+ tp_asv_set_string (priv->properties,
+ TP_PROP_ACCOUNT_SERVICE, service);
+}
+
+/**
* tp_future_account_set_parameter:
* @self: a #TpFutureAccount
* @key: the parameter key
diff --git a/telepathy-glib/future-account.h b/telepathy-glib/future-account.h
index b1ee42f..56dcd2a 100644
--- a/telepathy-glib/future-account.h
+++ b/telepathy-glib/future-account.h
@@ -112,6 +112,10 @@ _TP_AVAILABLE_IN_0_20
void tp_future_account_set_avatar (TpFutureAccount *self,
const guchar *avatar, gsize len, const gchar *mime_type);
+_TP_AVAILABLE_IN_0_20
+void tp_future_account_set_service (TpFutureAccount *self,
+ const gchar *service);
+
/* parameters */
_TP_AVAILABLE_IN_0_20
void tp_future_account_set_parameter (TpFutureAccount *self,
More information about the telepathy-commits
mailing list