]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-ui-utils.h
Add en_GB in gitignore
[empathy.git] / libempathy-gtk / empathy-ui-utils.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2002-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., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  * 
21  * Authors: Mikael Hallendal <micke@imendio.com>
22  *          Richard Hult <richard@imendio.com>
23  *          Martyn Russell <martyn@imendio.com>
24  *          Xavier Claessens <xclaesse@gmail.com>
25  *          Jonny Lamb <jonny.lamb@collabora.co.uk>
26  * 
27  *          Part of this file is copied from GtkSourceView (gtksourceiter.c):
28  *          Paolo Maggi
29  *          Jeroen Zwartepoorte
30  */
31
32 #ifndef __EMPATHY_UI_UTILS_H__
33 #define __EMPATHY_UI_UTILS_H__
34
35 #include <gtk/gtk.h>
36 #include <glade/glade.h>
37
38 #include <canberra-gtk.h>
39
40 #include <libmissioncontrol/mc-account.h>
41 #include <libmissioncontrol/mc-profile.h>
42
43
44 #include <libempathy/empathy-contact.h>
45
46 #include "empathy-chat-view.h"
47
48 G_BEGIN_DECLS
49
50 /* NOTE: Keep this sync with sound_entries in empathy-ui-utils.c */
51 typedef enum {
52         EMPATHY_SOUND_MESSAGE_INCOMING = 0,
53         EMPATHY_SOUND_MESSAGE_OUTGOING,
54         EMPATHY_SOUND_CONVERSATION_NEW,
55         EMPATHY_SOUND_CONTACT_CONNECTED,
56         EMPATHY_SOUND_CONTACT_DISCONNECTED,
57         EMPATHY_SOUND_ACCOUNT_CONNECTED,
58         EMPATHY_SOUND_ACCOUNT_DISCONNECTED,
59         EMPATHY_SOUND_PHONE_INCOMING,
60         EMPATHY_SOUND_PHONE_OUTGOING,
61         EMPATHY_SOUND_PHONE_HANGUP,
62         LAST_EMPATHY_SOUND,
63 } EmpathySound;
64
65 void            empathy_gtk_init                        (void);
66 GRegex *        empathy_uri_regex_dup_singleton         (void);
67
68 /* Glade */
69 void            empathy_glade_get_file_simple           (const gchar      *filename,
70                                                          const gchar      *root,
71                                                          const gchar      *domain,
72                                                          const gchar      *first_required_widget,
73                                                          ...);
74 GladeXML *      empathy_glade_get_file                  (const gchar      *filename,
75                                                          const gchar      *root,
76                                                          const gchar      *domain,
77                                                          const gchar      *first_required_widget,
78                                                          ...);
79 void            empathy_glade_connect                   (GladeXML         *gui,
80                                                          gpointer          user_data,
81                                                          gchar            *first_widget,
82                                                          ...);
83 void            empathy_glade_setup_size_group          (GladeXML         *gui,
84                                                          GtkSizeGroupMode  mode,
85                                                          gchar            *first_widget,
86                                                          ...);
87 /* Pixbufs */
88 const gchar * empathy_icon_name_from_account            (McAccount        *account);
89 const gchar * empathy_icon_name_for_presence            (McPresence        presence);
90 const gchar * empathy_icon_name_for_contact             (EmpathyContact   *contact);
91 GdkPixbuf *   empathy_pixbuf_from_data                  (gchar            *data,
92                                                          gsize             data_size);
93 GdkPixbuf *   empathy_pixbuf_from_data_and_mime         (gchar            *data,
94                                                          gsize             data_size,
95                                                          gchar           **mime_type);
96 GdkPixbuf *   empathy_pixbuf_from_avatar_scaled         (EmpathyAvatar    *avatar,
97                                                          gint              width,
98                                                          gint              height);
99 GdkPixbuf *   empathy_pixbuf_avatar_from_contact_scaled (EmpathyContact   *contact,
100                                                          gint              width,
101                                                          gint              height);
102 GdkPixbuf * empathy_pixbuf_scale_down_if_necessary      (GdkPixbuf        *pixbuf,
103                                                          gint              max_size);
104 GdkPixbuf * empathy_pixbuf_from_icon_name               (const gchar      *icon_name,
105                                                          GtkIconSize       icon_size);
106 GdkPixbuf * empathy_pixbuf_from_icon_name_sized         (const gchar      *icon_name,
107                                                          gint              size);
108 /* Text view */
109 gboolean    empathy_text_iter_forward_search            (const GtkTextIter*iter,
110                                                          const gchar      *str,
111                                                          GtkTextIter      *match_start,
112                                                          GtkTextIter      *match_end,
113                                                          const GtkTextIter*limit);
114 gboolean    empathy_text_iter_backward_search           (const GtkTextIter*iter,
115                                                          const gchar      *str,
116                                                          GtkTextIter      *match_start,
117                                                          GtkTextIter      *match_end,
118                                                          const GtkTextIter*limit);
119 /* Windows */
120 gboolean    empathy_window_get_is_visible               (GtkWindow        *window);
121 void        empathy_window_present                      (GtkWindow        *window,
122                                                          gboolean          steal_focus);
123 void        empathy_window_iconify                      (GtkWindow        *window,
124                                                          GtkStatusIcon    *status_icon);
125 GtkWindow * empathy_get_toplevel_window                 (GtkWidget        *widget);
126 void        empathy_url_show                            (GtkWidget        *parent,
127                                                          const char       *url);
128 void        empathy_toggle_button_set_state_quietly     (GtkWidget        *widget,
129                                                          GCallback         callback,
130                                                          gpointer          user_data,
131                                                          gboolean          active);
132 GtkWidget * empathy_link_button_new                     (const gchar      *url,
133                                                          const gchar      *title);
134
135 void        empathy_send_file_with_file_chooser         (EmpathyContact   *contact);
136
137 /* Sounds */
138 void        empathy_sound_play                          (GtkWidget        *widget,
139                                                          EmpathySound      sound_id);
140 gboolean    empathy_sound_play_full                     (GtkWidget *widget,
141                                                          EmpathySound sound_id,
142                                                          ca_finish_callback_t callback,
143                                                          gpointer user_data);
144 void        empathy_sound_stop                          (EmpathySound sound_id);
145
146 G_END_DECLS
147
148 #endif /*  __EMPATHY_UI_UTILS_H__ */