summaryrefslogtreecommitdiff
path: root/tests/lib/contacts-conn.h
blob: c596e3e6cc0e1b6f6d5d6b2e95669465f8715e99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
 * contacts-conn.h - header for a connection with contact info
 *
 * Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
 * Copyright (C) 2007-2008 Nokia Corporation
 *
 * Copying and distribution of this file, with or without modification,
 * are permitted in any medium without royalty provided the copyright
 * notice and this notice are preserved.
 */

#ifndef __TP_TESTS_CONTACTS_CONN_H__
#define __TP_TESTS_CONTACTS_CONN_H__

#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>

#include "simple-conn.h"
#include "contact-list-manager.h"

G_BEGIN_DECLS

typedef struct _TpTestsContactsConnection TpTestsContactsConnection;
typedef struct _TpTestsContactsConnectionClass TpTestsContactsConnectionClass;
typedef struct _TpTestsContactsConnectionPrivate TpTestsContactsConnectionPrivate;

struct _TpTestsContactsConnectionClass {
    TpTestsSimpleConnectionClass parent_class;

    TpPresenceMixinClass presence_mixin;
    TpContactsMixinClass contacts_mixin;
    TpDBusPropertiesMixinClass properties_class;

    TpContactsMixinFillContactAttributesFunc fill_client_types;
};

struct _TpTestsContactsConnection {
    TpTestsSimpleConnection parent;

    TpPresenceMixin presence_mixin;
    TpContactsMixin contacts_mixin;

    TpTestsContactsConnectionPrivate *priv;
};

GType tp_tests_contacts_connection_get_type (void);

/* Must match my_statuses in the .c */
typedef enum {
    TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE,
    TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY,
    TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY,
    TP_TESTS_CONTACTS_CONNECTION_STATUS_OFFLINE,
    TP_TESTS_CONTACTS_CONNECTION_STATUS_UNKNOWN,
    TP_TESTS_CONTACTS_CONNECTION_STATUS_ERROR
} TpTestsContactsConnectionPresenceStatusIndex;

/* TYPE MACROS */
#define TP_TESTS_TYPE_CONTACTS_CONNECTION \
  (tp_tests_contacts_connection_get_type ())
#define TP_TESTS_CONTACTS_CONNECTION(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_CONTACTS_CONNECTION, \
                              TpTestsContactsConnection))
#define TP_TESTS_CONTACTS_CONNECTION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_CONTACTS_CONNECTION, \
                           TpTestsContactsConnectionClass))
#define TP_TESTS_IS_CONTACTS_CONNECTION(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_CONTACTS_CONNECTION))
#define TP_TESTS_IS_CONTACTS_CONNECTION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_CONTACTS_CONNECTION))
#define TP_TESTS_CONTACTS_CONNECTION_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_CONTACTS_CONNECTION, \
                              TpTestsContactsConnectionClass))

TpTestsContactListManager *tp_tests_contacts_connection_get_contact_list_manager (
    TpTestsContactsConnection *self);

void tp_tests_contacts_connection_change_aliases (
    TpTestsContactsConnection *self, guint n,
    const TpHandle *handles, const gchar * const *aliases);

void tp_tests_contacts_connection_change_presences (
    TpTestsContactsConnection *self, guint n, const TpHandle *handles,
    const TpTestsContactsConnectionPresenceStatusIndex *indexes,
    const gchar * const *messages);

void tp_tests_contacts_connection_change_avatar_tokens (
    TpTestsContactsConnection *self, guint n, const TpHandle *handles,
    const gchar * const *tokens);

void tp_tests_contacts_connection_change_avatar_data (
    TpTestsContactsConnection *self,
    TpHandle handle,
    GArray *data,
    const gchar *mime_type,
    const gchar *token);

void tp_tests_contacts_connection_change_locations (
    TpTestsContactsConnection *self,
    guint n,
    const TpHandle *handles,
    GHashTable **locations);

void tp_tests_contacts_connection_change_capabilities (
    TpTestsContactsConnection *self, GHashTable *capabilities);

void tp_tests_contacts_connection_change_contact_info (
    TpTestsContactsConnection *self, TpHandle handle, GPtrArray *info);

void tp_tests_contacts_connection_set_default_contact_info (
    TpTestsContactsConnection *self,
    GPtrArray *info);

/* Legacy version (no Contacts interface, and no immortal handles) */

typedef struct _TpTestsLegacyContactsConnection TpTestsLegacyContactsConnection;
typedef struct _TpTestsLegacyContactsConnectionClass TpTestsLegacyContactsConnectionClass;
typedef struct _TpTestsLegacyContactsConnectionPrivate
  TpTestsLegacyContactsConnectionPrivate;

struct _TpTestsLegacyContactsConnectionClass {
    TpTestsContactsConnectionClass parent_class;
};

struct _TpTestsLegacyContactsConnection {
    TpTestsContactsConnection parent;

    TpTestsLegacyContactsConnectionPrivate *priv;
};

GType tp_tests_legacy_contacts_connection_get_type (void);

/* TYPE MACROS */
#define TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION \
  (tp_tests_legacy_contacts_connection_get_type ())
#define LEGACY_TP_TESTS_CONTACTS_CONNECTION(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, \
                              TpTestsLegacyContactsConnection))
#define LEGACY_TP_TESTS_CONTACTS_CONNECTION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, \
                           TpTestsLegacyContactsConnectionClass))
#define TP_TESTS_LEGACY_CONTACTS_IS_CONNECTION(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION))
#define TP_TESTS_LEGACY_CONTACTS_IS_CONNECTION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION))
#define LEGACY_TP_TESTS_CONTACTS_CONNECTION_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, \
                              TpTestsLegacyContactsConnectionClass))

/* No Requests version */

typedef struct _TpTestsNoRequestsConnection TpTestsNoRequestsConnection;
typedef struct _TpTestsNoRequestsConnectionClass TpTestsNoRequestsConnectionClass;
typedef struct _TpTestsNoRequestsConnectionPrivate
  TpTestsNoRequestsConnectionPrivate;

struct _TpTestsNoRequestsConnectionClass {
    TpTestsContactsConnectionClass parent_class;
};

struct _TpTestsNoRequestsConnection {
    TpTestsContactsConnection parent;

    TpTestsNoRequestsConnectionPrivate *priv;
};

GType tp_tests_no_requests_connection_get_type (void);

/* TYPE MACROS */
#define TP_TESTS_TYPE_NO_REQUESTS_CONNECTION \
  (tp_tests_no_requests_connection_get_type ())
#define TP_TESTS_NO_REQUESTS_CONNECTION(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, \
                              TpTestsNoRequestsConnection))
#define TP_TESTS_NO_REQUESTS_CONNECTION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, \
                           TpTestsNoRequestsConnectionClass))
#define TP_TESTS_NO_REQUESTS_IS_CONNECTION(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION))
#define TP_TESTS_NO_REQUESTS_IS_CONNECTION_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION))
#define TP_TESTS_NO_REQUESTS_CONNECTION_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, \
                              TpTestsNoRequestsConnectionClass))

G_END_DECLS

#endif /* ifndef __TP_TESTS_CONTACTS_CONN_H__ */