telepathy: introduce TLS info data structure
[siplcs.git] / src / telepathy / telepathy-private.h
bloba8529c6060db49119f4bc4ac87ab716a29d46711
1 /**
2 * @file telepathy-private.h
4 * pidgin-sipe
6 * Copyright (C) 2012-2013 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct _GObject;
25 struct _GObjectClass;
26 struct _GTlsCertificate;
27 struct _SipeConnection;
28 struct _SipeContactList;
29 struct _SipeTLSManager;
30 struct _TpBaseConnection;
31 struct _TpBaseConnectionManager;
32 struct _TpBaseProtocol;
33 struct sipe_tls_info;
34 struct sipe_transport_telepathy;
36 /* constants */
37 #define SIPE_TELEPATHY_DOMAIN "sipe"
39 struct sipe_backend_private {
40 struct sipe_core_public *public;
42 /* buddies */
43 struct _SipeContactList *contact_list;
45 /* connection */
46 struct _SipeConnection *connection;
48 /* photo */
49 gchar *cache_dir;
51 /* status */
52 guint activity;
53 gchar *message;
55 /* TLS certificate verification */
56 struct _SipeTLSManager *tls_manager;
58 /* transport */
59 struct sipe_transport_telepathy *transport;
60 gchar *ipaddress;
63 /* buddy */
64 struct _SipeContactList *sipe_telepathy_contact_list_new(struct _TpBaseConnection *connection);
65 const gchar *sipe_telepathy_buddy_get_alias(struct _SipeContactList *contact_list,
66 const guint contact);
67 void sipe_telepathy_buddy_set_alias(struct _SipeContactList *contact_list,
68 const guint contact,
69 const gchar *alias);
70 const gchar *sipe_telepathy_buddy_get_hash(struct _SipeContactList *contact_list,
71 const guint contact);
72 guint sipe_telepathy_buddy_get_presence(struct _SipeContactList *contact_list,
73 guint contact);
74 void sipe_telepathy_avatars_iface_init(gpointer g_iface,
75 gpointer iface_data);
76 void sipe_telepathy_contact_info_iface_init(gpointer g_iface,
77 gpointer iface_data);
78 GPtrArray *sipe_telepathy_contact_info_fields(void);
79 /* TpDBusPropertiesMixinPropImpl is a broken typedef */
80 gpointer sipe_telepathy_contact_info_props(void);
82 /* connection */
83 struct _TpBaseConnection *sipe_telepathy_connection_new(struct _TpBaseProtocol *protocol,
84 GHashTable *params,
85 GError **error);
86 void sipe_telepathy_connection_alias_updated(struct _TpBaseConnection *connection,
87 guint contact,
88 const gchar *alias);
89 struct sipe_backend_private *sipe_telepathy_connection_private(GObject *object);
91 /* debugging */
92 void sipe_telepathy_debug_init(void);
93 void sipe_telepathy_debug_finalize(void);
95 /* protocol */
96 void sipe_telepathy_protocol_init(struct _TpBaseConnectionManager *cm);
97 gchar *sipe_telepathy_protocol_normalize_contact(struct _TpBaseProtocol *self,
98 const gchar *contact,
99 GError **error);
101 /* contact search */
102 GType sipe_search_manager_get_type(void);
103 #define SIPE_TYPE_SEARCH_MANAGER (sipe_search_manager_get_type())
104 struct _GObject *sipe_telepathy_search_new(struct _TpBaseConnection *connection);
106 /* status */
107 void sipe_telepathy_status_init(struct _GObjectClass *object_class,
108 gsize struct_offset);
110 /* TLS certificate verification */
111 struct _SipeTLSManager *sipe_telepathy_tls_new(struct _TpBaseConnection *connection);
112 struct sipe_tls_info *sipe_telepathy_tls_info_new(const gchar *hostname,
113 struct _GTlsCertificate *certificate);
114 void sipe_telepathy_tls_info_free(struct sipe_tls_info *tls_info);
115 void sipe_telepathy_tls_verify_async(struct _GObject *connection,
116 struct sipe_tls_info *tls_info,
117 GAsyncReadyCallback callback,
118 gpointer user_data);
121 Local Variables:
122 mode: c
123 c-file-style: "bsd"
124 indent-tabs-mode: t
125 tab-width: 8
126 End: