]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-ui-utils.h
Merge back from master
[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., 51 Franklin St, Fifth Floor,
19  * Boston, MA  02110-1301  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
37 #include <libempathy/empathy-contact.h>
38 #include <libempathy/empathy-account.h>
39 #include <libempathy/empathy-ft-handler.h>
40
41 #include "empathy-chat-view.h"
42
43 G_BEGIN_DECLS
44
45 void            empathy_gtk_init                        (void);
46 GRegex *        empathy_uri_regex_dup_singleton         (void);
47
48 /* Glade */
49 GtkBuilder *    empathy_builder_get_file                (const gchar      *filename,
50                                                          const gchar      *first_object,
51                                                          ...);
52 void            empathy_builder_connect                 (GtkBuilder       *gui,
53                                                          gpointer          user_data,
54                                                          gchar            *first_object,
55                                                          ...);
56 GtkWidget     *empathy_builder_unref_and_keep_widget    (GtkBuilder       *gui,
57                                                          GtkWidget        *root);
58
59 /* Pixbufs */
60 const gchar * empathy_icon_name_for_presence            (TpConnectionPresenceType  presence);
61 const gchar * empathy_icon_name_for_contact             (EmpathyContact   *contact);
62 GdkPixbuf *   empathy_pixbuf_from_data                  (gchar            *data,
63                                                          gsize             data_size);
64 GdkPixbuf *   empathy_pixbuf_from_data_and_mime         (gchar            *data,
65                                                          gsize             data_size,
66                                                          gchar           **mime_type);
67 GdkPixbuf *   empathy_pixbuf_from_avatar_scaled         (EmpathyAvatar    *avatar,
68                                                          gint              width,
69                                                          gint              height);
70 GdkPixbuf *   empathy_pixbuf_avatar_from_contact_scaled (EmpathyContact   *contact,
71                                                          gint              width,
72                                                          gint              height);
73 GdkPixbuf *   empathy_pixbuf_scale_down_if_necessary    (GdkPixbuf        *pixbuf,
74                                                          gint              max_size);
75 GdkPixbuf *   empathy_pixbuf_from_icon_name             (const gchar      *icon_name,
76                                                          GtkIconSize       icon_size);
77 GdkPixbuf *   empathy_pixbuf_from_icon_name_sized       (const gchar      *icon_name,
78                                                          gint              size);
79 gchar *       empathy_filename_from_icon_name           (const gchar      *icon_name,
80                                                          GtkIconSize       icon_size);
81
82 /* Text view */
83 gboolean    empathy_text_iter_forward_search            (const GtkTextIter*iter,
84                                                          const gchar      *str,
85                                                          GtkTextIter      *match_start,
86                                                          GtkTextIter      *match_end,
87                                                          const GtkTextIter*limit);
88 gboolean    empathy_text_iter_backward_search           (const GtkTextIter*iter,
89                                                          const gchar      *str,
90                                                          GtkTextIter      *match_start,
91                                                          GtkTextIter      *match_end,
92                                                          const GtkTextIter*limit);
93 /* Windows */
94 gboolean    empathy_window_get_is_visible               (GtkWindow        *window);
95 void        empathy_window_present                      (GtkWindow        *window,
96                                                          gboolean          steal_focus);
97 void        empathy_window_iconify                      (GtkWindow        *window,
98                                                          GtkStatusIcon    *status_icon);
99 GtkWindow * empathy_get_toplevel_window                 (GtkWidget        *widget);
100 void        empathy_url_show                            (GtkWidget        *parent,
101                                                          const char       *url);
102 void        empathy_toggle_button_set_state_quietly     (GtkWidget        *widget,
103                                                          GCallback         callback,
104                                                          gpointer          user_data,
105                                                          gboolean          active);
106 GtkWidget * empathy_link_button_new                     (const gchar      *url,
107                                                          const gchar      *title);
108
109 void        empathy_send_file_with_file_chooser         (EmpathyContact   *contact);
110 void        empathy_receive_file_with_file_chooser      (EmpathyFTHandler *handler);
111
112 gchar *     empathy_make_absolute_url                   (const gchar *url);
113
114 G_END_DECLS
115
116 #endif /*  __EMPATHY_UI_UTILS_H__ */