]> git.0d.be Git - empathy.git/blob - libempathy/empathy-utils.h
libempathy: Remove empathy_create_individual_from_tp_contact()
[empathy.git] / libempathy / empathy-utils.h
1 /*
2  * Copyright (C) 2003-2007 Imendio AB
3  * Copyright (C) 2007-2011 Collabora Ltd.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA  02110-1301  USA
19  *
20  * Authors: Richard Hult <richard@imendio.com>
21  *          Martyn Russell <martyn@imendio.com>
22  *          Xavier Claessens <xclaesse@gmail.com>
23  */
24
25 #ifndef __EMPATHY_UTILS_H__
26 #define __EMPATHY_UTILS_H__
27
28 #include <glib.h>
29 #include <glib-object.h>
30 #include <gnutls/x509.h>
31 #include <libxml/tree.h>
32 #include <folks/folks.h>
33 #include <folks/folks-telepathy.h>
34 #include <telepathy-glib/telepathy-glib.h>
35
36 #include "empathy-contact.h"
37
38 #define EMPATHY_GET_PRIV(obj,type) ((type##Priv *) ((type *) obj)->priv)
39
40 G_BEGIN_DECLS
41
42 void empathy_init (void);
43
44 /* XML */
45 xmlNodePtr empathy_xml_node_get_child (xmlNodePtr node,
46     const gchar *child_name);
47 xmlChar * empathy_xml_node_get_child_content (xmlNodePtr node,
48     const gchar *child_name);
49 xmlNodePtr empathy_xml_node_find_child_prop_value (xmlNodePtr node,
50     const gchar *prop_name,
51     const gchar *prop_value);
52
53 /* Others */
54 const gchar * empathy_presence_get_default_message (
55     TpConnectionPresenceType presence);
56 const gchar * empathy_presence_to_str (TpConnectionPresenceType presence);
57 TpConnectionPresenceType empathy_presence_from_str (const gchar *str);
58 gchar * empathy_file_lookup (const gchar *filename,
59     const gchar *subdir);
60 gint empathy_uint_compare (gconstpointer a,
61     gconstpointer b);
62
63 const gchar * empathy_account_get_error_message (TpAccount *account,
64     gboolean *user_requested);
65
66 #define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ())
67 GType empathy_type_dbus_ao (void);
68
69 gboolean empathy_account_manager_get_accounts_connected (gboolean *connecting);
70
71 TpConnectionPresenceType empathy_folks_presence_type_to_tp (
72     FolksPresenceType type);
73 gboolean empathy_folks_individual_contains_contact (
74     FolksIndividual *individual);
75 EmpathyContact * empathy_contact_dup_from_folks_individual (
76     FolksIndividual *individual);
77 TpChannelGroupChangeReason tp_channel_group_change_reason_from_folks_groups_change_reason (
78     FolksGroupDetailsChangeReason reason);
79 TpfPersonaStore * empathy_dup_persona_store_for_connection (
80     TpConnection *connection);
81 gboolean empathy_connection_can_add_personas (TpConnection *connection);
82 gboolean empathy_connection_can_alias_personas (TpConnection *connection,
83                                                 FolksIndividual *individual);
84 gboolean empathy_connection_can_group_personas (TpConnection *connection,
85                                                 FolksIndividual *individual);
86 gboolean empathy_folks_persona_is_interesting (FolksPersona *persona);
87
88 gchar * empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert);
89
90 gchar *empathy_format_currency (gint amount,
91     guint scale,
92     const gchar *currency);
93
94 TpContact * empathy_get_tp_contact_for_individual (FolksIndividual *individual,
95     TpConnection *conn);
96
97 void empathy_individual_can_audio_video_call (FolksIndividual *individual,
98     gboolean *can_audio_call,
99     gboolean *can_video_call,
100     EmpathyContact **out_contact);
101
102 gboolean empathy_client_types_contains_mobile_device (
103     const GStrv types);
104
105 FolksIndividual * empathy_ensure_individual_from_tp_contact (
106     TpContact *contact);
107
108 const gchar * const * empathy_individual_get_client_types (
109     FolksIndividual *individual);
110
111 GVariant * empathy_asv_to_vardict (const GHashTable *asv);
112
113 GVariant * empathy_boxed_to_variant (GType gtype,
114     const gchar *variant_type,
115     gpointer boxed);
116
117 G_END_DECLS
118
119 #endif /*  __EMPATHY_UTILS_H__ */