diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-04-16 12:32:07 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-04-16 12:32:07 +0200 |
commit | 03220d5f92836c156d26a3a9e98b3d61808fb4ff (patch) | |
tree | 0bf07967e4cc51385d93f4223fcd40ea2240a9a4 | |
parent | c8b799af142472ae45b7f2c683095ad0ec99752e (diff) |
contacts-conn: add CM not supporting Requests and ContactCapabilities
-rw-r--r-- | tests/lib/contacts-conn.c | 27 | ||||
-rw-r--r-- | tests/lib/contacts-conn.h | 36 |
2 files changed, 63 insertions, 0 deletions
diff --git a/tests/lib/contacts-conn.c b/tests/lib/contacts-conn.c index 3973b8149..46ca198b6 100644 --- a/tests/lib/contacts-conn.c +++ b/tests/lib/contacts-conn.c @@ -857,3 +857,30 @@ legacy_contacts_connection_class_init (LegacyContactsConnectionClass *klass) base_class->interfaces_always_present = interfaces_always_present; } + +/* =============== No Requests and no ContactCapabilities ================= */ + +G_DEFINE_TYPE (NoRequestsConnection, no_requests_connection, + CONTACTS_TYPE_CONNECTION); + +static void +no_requests_connection_init (NoRequestsConnection *self) +{ +} + +static void +no_requests_connection_class_init (NoRequestsConnectionClass *klass) +{ + static const gchar *interfaces_always_present[] = { + TP_IFACE_CONNECTION_INTERFACE_ALIASING, + TP_IFACE_CONNECTION_INTERFACE_AVATARS, + TP_IFACE_CONNECTION_INTERFACE_CONTACTS, + TP_IFACE_CONNECTION_INTERFACE_PRESENCE, + TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, + TP_IFACE_CONNECTION_INTERFACE_LOCATION, + NULL }; + TpBaseConnectionClass *base_class = + (TpBaseConnectionClass *) klass; + + base_class->interfaces_always_present = interfaces_always_present; +} diff --git a/tests/lib/contacts-conn.h b/tests/lib/contacts-conn.h index 21e658d61..0b6dd24ad 100644 --- a/tests/lib/contacts-conn.h +++ b/tests/lib/contacts-conn.h @@ -125,6 +125,42 @@ GType legacy_contacts_connection_get_type (void); (G_TYPE_INSTANCE_GET_CLASS ((obj), LEGACY_CONTACTS_TYPE_CONNECTION, \ LegacyContactsConnectionClass)) +/* No Requests version */ + +typedef struct _NoRequestsConnection NoRequestsConnection; +typedef struct _NoRequestsConnectionClass NoRequestsConnectionClass; +typedef struct _NoRequestsConnectionPrivate + NoRequestsConnectionPrivate; + +struct _NoRequestsConnectionClass { + ContactsConnectionClass parent_class; +}; + +struct _NoRequestsConnection { + ContactsConnection parent; + + NoRequestsConnectionPrivate *priv; +}; + +GType no_requests_connection_get_type (void); + +/* TYPE MACROS */ +#define NO_REQUESTS_TYPE_CONNECTION \ + (no_requests_connection_get_type ()) +#define NO_REQUESTS_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), NO_REQUESTS_TYPE_CONNECTION, \ + NoRequestsConnection)) +#define NO_REQUESTS_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NO_REQUESTS_TYPE_CONNECTION, \ + NoRequestsConnectionClass)) +#define NO_REQUESTS_IS_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), NO_REQUESTS_TYPE_CONNECTION)) +#define NO_REQUESTS_IS_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), NO_REQUESTS_TYPE_CONNECTION)) +#define NO_REQUESTS_CONNECTION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), NO_REQUESTS_TYPE_CONNECTION, \ + NoRequestsConnectionClass)) + G_END_DECLS #endif |