Updated for release
[empathy-mirror.git] / libempathy-gtk / empathy-ui-utils.h
blobeb189545aafc6f425db79c9e861c7ad71dbcd1ba
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 Collabora Ltd.
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.
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.
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.
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>
26 * Part of this file is copied from GtkSourceView (gtksourceiter.c):
27 * Paolo Maggi
28 * Jeroen Zwartepoorte
31 #ifndef __EMPATHY_UI_UTILS_H__
32 #define __EMPATHY_UI_UTILS_H__
34 #include <gtk/gtk.h>
35 #include <glade/glade.h>
37 #include <libmissioncontrol/mc-account.h>
38 #include <libmissioncontrol/mc-profile.h>
40 #include <libempathy/empathy-presence.h>
41 #include <libempathy/empathy-contact.h>
42 #include <libempathy/empathy-avatar.h>
44 #include "empathy-chat-view.h"
46 G_BEGIN_DECLS
48 #define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
50 /* Glade */
51 void empathy_glade_get_file_simple (const gchar *filename,
52 const gchar *root,
53 const gchar *domain,
54 const gchar *first_required_widget,
55 ...);
56 GladeXML * empathy_glade_get_file (const gchar *filename,
57 const gchar *root,
58 const gchar *domain,
59 const gchar *first_required_widget,
60 ...);
61 void empathy_glade_connect (GladeXML *gui,
62 gpointer user_data,
63 gchar *first_widget,
64 ...);
65 void empathy_glade_setup_size_group (GladeXML *gui,
66 GtkSizeGroupMode mode,
67 gchar *first_widget,
68 ...);
69 /* Pixbufs */
70 const gchar * empathy_icon_name_from_account (McAccount *account);
71 const gchar * empathy_icon_name_for_presence_state (McPresence state);
72 const gchar * empathy_icon_name_for_presence (EmpathyPresence *presence);
73 const gchar * empathy_icon_name_for_contact (EmpathyContact *contact);
74 GdkPixbuf * empathy_pixbuf_from_data (gchar *data,
75 gsize data_size);
76 GdkPixbuf * empathy_pixbuf_from_avatar_scaled (EmpathyAvatar *avatar,
77 gint width,
78 gint height);
79 GdkPixbuf * empathy_pixbuf_avatar_from_contact_scaled (EmpathyContact *contact,
80 gint width,
81 gint height);
82 GdkPixbuf * empathy_pixbuf_scale_down_if_necessary (GdkPixbuf *pixbuf,
83 gint max_size);
84 GdkPixbuf * empathy_pixbuf_from_icon_name (const gchar *icon_name,
85 GtkIconSize icon_size);
86 /* Text view */
87 gboolean empathy_text_iter_forward_search (const GtkTextIter*iter,
88 const gchar *str,
89 GtkTextIter *match_start,
90 GtkTextIter *match_end,
91 const GtkTextIter*limit);
92 gboolean empathy_text_iter_backward_search (const GtkTextIter*iter,
93 const gchar *str,
94 GtkTextIter *match_start,
95 GtkTextIter *match_end,
96 const GtkTextIter*limit);
97 /* Windows */
98 gboolean empathy_window_get_is_visible (GtkWindow *window);
99 void empathy_window_present (GtkWindow *window,
100 gboolean steal_focus);
101 void empathy_window_iconify (GtkWindow *window,
102 GtkStatusIcon *status_icon);
103 GtkWindow * empathy_get_toplevel_window (GtkWidget *widget);
104 void empathy_url_show (const char *url);
105 void empathy_toggle_button_set_state_quietly (GtkWidget *widget,
106 GCallback callback,
107 gpointer user_data,
108 gboolean active);
109 GtkWidget *empathy_link_button_new (const gchar *url,
110 const gchar *title);
113 G_END_DECLS
115 #endif /* __EMPATHY_UI_UTILS_H__ */