]> git.0d.be Git - empathy.git/blob - libempathy/empathy-utils.h
Updated Polish translation
[empathy.git] / libempathy / empathy-utils.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2003-2007 Imendio AB
4  * Copyright (C) 2007-2008 Collabora Ltd.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA  02110-1301  USA
20  *
21  * Authors: Richard Hult <richard@imendio.com>
22  *          Martyn Russell <martyn@imendio.com>
23  *          Xavier Claessens <xclaesse@gmail.com>
24  */
25
26 #ifndef __EMPATHY_UTILS_H__
27 #define __EMPATHY_UTILS_H__
28
29 #include <glib.h>
30 #include <glib-object.h>
31
32 #include <libxml/parser.h>
33 #include <libxml/tree.h>
34 #include <telepathy-glib/account-manager.h>
35
36 #include "empathy-contact.h"
37
38 #define EMPATHY_GET_PRIV(obj,type) ((type##Priv *) ((type *) obj)->priv)
39 #define EMP_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
40
41 G_BEGIN_DECLS
42
43 void         empathy_init                           (void);
44 /* Strings */
45 gchar *      empathy_substring                      (const gchar     *str,
46                                                     gint             start,
47                                                     gint             end);
48 gint         empathy_strcasecmp                     (const gchar     *s1,
49                                                     const gchar     *s2);
50 gint         empathy_strncasecmp                    (const gchar     *s1,
51                                                     const gchar     *s2,
52                                                     gsize            n);
53
54 /* XML */
55 gboolean     empathy_xml_validate                   (xmlDoc          *doc,
56                                                     const gchar     *dtd_filename);
57 xmlNodePtr   empathy_xml_node_get_child             (xmlNodePtr       node,
58                                                     const gchar     *child_name);
59 xmlChar *    empathy_xml_node_get_child_content     (xmlNodePtr       node,
60                                                     const gchar     *child_name);
61 xmlNodePtr   empathy_xml_node_find_child_prop_value (xmlNodePtr       node,
62                                                     const gchar     *prop_name,
63                                                     const gchar     *prop_value);
64
65 /* Others */
66 const gchar * empathy_presence_get_default_message  (TpConnectionPresenceType presence);
67 const gchar * empathy_presence_to_str               (TpConnectionPresenceType presence);
68 TpConnectionPresenceType empathy_presence_from_str  (const gchar     *str);
69 gchar *       empathy_file_lookup                   (const gchar     *filename,
70                                                      const gchar     *subdir);
71 gboolean     empathy_proxy_equal                    (gconstpointer    a,
72                                                      gconstpointer    b);
73 guint        empathy_proxy_hash                     (gconstpointer    key);
74 gboolean     empathy_check_available_state          (void);
75 gint        empathy_uint_compare                    (gconstpointer a,
76                                                      gconstpointer b);
77 const gchar * empathy_status_reason_get_default_message (TpConnectionStatusReason reason);
78
79 gchar *empathy_protocol_icon_name (const gchar *protocol);
80 const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name);
81
82 #define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ())
83 GType empathy_type_dbus_ao (void);
84
85 void empathy_signal_connect_weak (gpointer instance,
86     const gchar *detailed_signal,
87     GCallback c_handler,
88     GObject *user_data);
89
90 TpAccount * empathy_get_account_for_connection (TpConnection *connection);
91
92 gboolean empathy_account_manager_get_accounts_connected (gboolean *connecting);
93
94 void empathy_connect_new_account (TpAccount *account,
95     TpAccountManager *account_manager);
96
97 G_END_DECLS
98
99 #endif /*  __EMPATHY_UTILS_H__ */