summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-connection.h
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-07 14:02:45 +0100
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-06-04 13:43:09 +0200
commit5f90a8dd35be28392615de7ba15f1d552ea5c477 (patch)
tree4a036c4455965ebebd86ab2b96f9a23297ec1bee /telepathy-glib/base-connection.h
parentaa7b5e8d093c3224143659302af38eb286c94e5e (diff)
downloadtelepathy-glib-5f90a8dd35be28392615de7ba15f1d552ea5c477.tar.gz
TpBaseConnection: add method accessors for struct fields
Diffstat (limited to 'telepathy-glib/base-connection.h')
-rw-r--r--telepathy-glib/base-connection.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/telepathy-glib/base-connection.h b/telepathy-glib/base-connection.h
index ae772d044..1078e485c 100644
--- a/telepathy-glib/base-connection.h
+++ b/telepathy-glib/base-connection.h
@@ -115,6 +115,22 @@ struct _TpBaseConnectionClass {
GType tp_base_connection_get_type (void);
+_TP_AVAILABLE_IN_UNRELEASED
+const gchar *tp_base_connection_get_bus_name (TpBaseConnection *self);
+
+_TP_AVAILABLE_IN_UNRELEASED
+const gchar *tp_base_connection_get_object_path (TpBaseConnection *self);
+
+_TP_AVAILABLE_IN_UNRELEASED
+TpConnectionStatus tp_base_connection_get_status (TpBaseConnection *self);
+
+_TP_AVAILABLE_IN_UNRELEASED
+gboolean tp_base_connection_is_destroyed (TpBaseConnection *self);
+
+_TP_AVAILABLE_IN_UNRELEASED
+gboolean tp_base_connection_check_connected (TpBaseConnection *self,
+ GError **error);
+
TpHandleRepoIface *tp_base_connection_get_handles (TpBaseConnection *self,
TpHandleType handle_type);
@@ -192,17 +208,15 @@ gboolean tp_base_connection_channel_manager_iter_next (
(G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CONNECTION, \
TpBaseConnectionClass))
-/* The cast of a string literal to (gchar *) is to keep C++ compilers happy */
#define TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED(conn, context) \
G_STMT_START { \
- TpBaseConnection *c = (conn); \
+ TpBaseConnection *c_ = (conn); \
+ GError *e_ = NULL; \
\
- if (c->status != TP_CONNECTION_STATUS_CONNECTED) \
+ if (!tp_base_connection_check_connected (c_, &e_)) \
{ \
- GError e = { TP_ERROR, TP_ERROR_DISCONNECTED, \
- (gchar *) "Connection is disconnected" }; \
- \
- dbus_g_method_return_error ((context), &e); \
+ dbus_g_method_return_error ((context), e_); \
+ g_error_free (e_); \
return; \
} \
} G_STMT_END