2 * Copyright (C) 2002-2007 Imendio AB
3 * Copyright (C) 2007-2010 Collabora Ltd.
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.
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.
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
20 * Authors: Mikael Hallendal <micke@imendio.com>
21 * Richard Hult <richard@imendio.com>
22 * Martyn Russell <martyn@imendio.com>
23 * Xavier Claessens <xclaesse@gmail.com>
24 * Jonny Lamb <jonny.lamb@collabora.co.uk>
25 * Travis Reitter <travis.reitter@collabora.co.uk>
27 * Part of this file is copied from GtkSourceView (gtksourceiter.c):
32 #ifndef __EMPATHY_UI_UTILS_H__
33 #define __EMPATHY_UI_UTILS_H__
36 #include <folks/folks.h>
38 #include "empathy-contact.h"
39 #include "empathy-ft-handler.h"
43 #define EMPATHY_RECT_IS_ON_SCREEN(x,y,w,h) ((x) + (w) > 0 && \
45 (x) < gdk_screen_width () && \
46 (y) < gdk_screen_height ())
48 typedef void (*EmpathyPixbufAvatarFromIndividualCb
) (
49 FolksIndividual
*individual
,
53 void empathy_gtk_init (void);
56 const gchar
* empathy_icon_name_for_presence (
57 TpConnectionPresenceType presence
);
58 const gchar
* empathy_icon_name_for_contact (EmpathyContact
*contact
);
59 const gchar
* empathy_icon_name_for_individual (FolksIndividual
*individual
);
60 const gchar
* empathy_protocol_name_for_contact (EmpathyContact
*contact
);
61 void empathy_pixbuf_avatar_from_individual_scaled_async (
62 FolksIndividual
*individual
,
65 GCancellable
*cancellable
,
66 GAsyncReadyCallback callback
,
68 GdkPixbuf
* empathy_pixbuf_avatar_from_individual_scaled_finish (
69 FolksIndividual
*individual
,
72 GdkPixbuf
* empathy_pixbuf_avatar_from_contact_scaled (EmpathyContact
*contact
,
75 GdkPixbuf
* empathy_pixbuf_contact_status_icon (EmpathyContact
*contact
,
76 gboolean show_protocol
);
77 GdkPixbuf
* empathy_pixbuf_contact_status_icon_with_icon_name (
78 EmpathyContact
*contact
,
79 const gchar
*icon_name
,
80 gboolean show_protocol
);
82 void empathy_move_to_window_desktop (GtkWindow
*window
,
86 void empathy_url_show (GtkWidget
*parent
,
90 void empathy_send_file (EmpathyContact
*contact
,
92 void empathy_send_file_from_uri_list (EmpathyContact
*contact
,
93 const gchar
*uri_list
);
94 void empathy_send_file_with_file_chooser (EmpathyContact
*contact
);
95 void empathy_receive_file_with_file_chooser (EmpathyFTHandler
*handler
);
98 void empathy_make_color_whiter (GdkRGBA
*color
);
100 GtkWidget
* empathy_context_menu_new (GtkWidget
*attach_to
);
102 gint64
empathy_get_current_action_time (void);
104 gboolean
empathy_individual_match_string (
105 FolksIndividual
*individual
,
109 void empathy_launch_program (const gchar
*dir
,
113 void empathy_set_css_provider (GtkWidget
*widget
);
115 gboolean
empathy_launch_external_app (const gchar
*desktop_file
,
121 #endif /* __EMPATHY_UI_UTILS_H__ */