]> git.0d.be Git - empathy.git/blob - libempathy-gtk/gossip-ui-utils.h
[darcs-to-svn @ Adding salut profile]
[empathy.git] / libempathy-gtk / gossip-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  *
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.
9  *
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.
14  *
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., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  * 
20  * Authors: Mikael Hallendal <micke@imendio.com>
21  *          Richard Hult <richard@imendio.com>
22  *          Martyn Russell <martyn@imendio.com>
23  * 
24  *          Part of this file is copied from GtkSourceView (gtksourceiter.c):
25  *          Paolo Maggi
26  *          Jeroen Zwartepoorte
27  */
28
29 #ifndef __GOSSIP_UI_UTILS_H__
30 #define __GOSSIP_UI_UTILS_H__
31
32 #include <gtk/gtk.h>
33 #include <glade/glade.h>
34
35 #include <libmissioncontrol/mc-account.h>
36 #include <libmissioncontrol/mc-profile.h>
37
38 #include <libempathy/gossip-presence.h>
39 #include <libempathy/gossip-contact.h>
40 #include <libempathy/gossip-avatar.h>
41
42 #include "gossip-chat-view.h"
43
44 G_BEGIN_DECLS
45
46 #define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
47
48 /* Glade */
49 void            gossip_glade_get_file_simple             (const gchar         *filename,
50                                                           const gchar         *root,
51                                                           const gchar         *domain,
52                                                           const gchar         *first_required_widget,
53                                                           ...);
54 GladeXML *      gossip_glade_get_file                    (const gchar         *filename,
55                                                           const gchar         *root,
56                                                           const gchar         *domain,
57                                                           const gchar         *first_required_widget,
58                                                           ...);
59 void            gossip_glade_connect                     (GladeXML            *gui,
60                                                           gpointer             user_data,
61                                                           gchar               *first_widget,
62                                                           ...);
63 void            gossip_glade_setup_size_group            (GladeXML            *gui,
64                                                           GtkSizeGroupMode     mode,
65                                                           gchar               *first_widget,
66                                                           ...);
67 /* Pixbufs */
68 GdkPixbuf *     gossip_pixbuf_from_smiley                (GossipSmiley         type,
69                                                           GtkIconSize          icon_size);
70 GdkPixbuf *     gossip_pixbuf_from_profile               (McProfile           *account,
71                                                           GtkIconSize          icon_size);
72 GdkPixbuf *     gossip_pixbuf_from_account               (McAccount           *account,
73                                                           GtkIconSize          icon_size);
74 GdkPixbuf *     gossip_pixbuf_for_presence_state         (GossipPresenceState  state);
75 GdkPixbuf *     gossip_pixbuf_for_presence               (GossipPresence      *presence);
76 GdkPixbuf *     gossip_pixbuf_for_contact                (GossipContact       *contact);
77 GdkPixbuf *     gossip_pixbuf_offline                    (void);
78 GdkPixbuf *     gossip_pixbuf_from_avatar_scaled         (GossipAvatar        *avatar,
79                                                           gint                 width,
80                                                           gint                 height);
81 GdkPixbuf *     gossip_pixbuf_avatar_from_contact        (GossipContact       *contact);
82 GdkPixbuf *     gossip_pixbuf_avatar_from_contact_scaled (GossipContact       *contact,
83                                                           gint                 width,
84                                                           gint                 height);
85 /* Text view */
86 gboolean   gossip_text_iter_forward_search          (const GtkTextIter   *iter,
87                                                      const gchar         *str,
88                                                      GtkTextIter         *match_start,
89                                                      GtkTextIter         *match_end,
90                                                      const GtkTextIter   *limit);
91 gboolean   gossip_text_iter_backward_search         (const GtkTextIter   *iter,
92                                                      const gchar         *str,
93                                                      GtkTextIter         *match_start,
94                                                      GtkTextIter         *match_end,
95                                                      const GtkTextIter   *limit);
96
97 /* Windows */
98 gboolean   gossip_window_get_is_visible             (GtkWindow           *window);
99 void       gossip_window_present                    (GtkWindow           *window,
100                                                      gboolean             steal_focus);
101 void       gossip_window_set_default_icon_name      (const gchar         *name);
102
103 void       gossip_url_show                          (const char          *url);
104
105 void       gossip_toggle_button_set_state_quietly   (GtkWidget           *widget,
106                                                      GCallback            callback,
107                                                      gpointer             user_data,
108                                                      gboolean             active);
109 GtkWidget *gossip_link_button_new                   (const gchar         *url,
110                                                      const gchar         *title);
111
112
113 G_END_DECLS
114
115 #endif /*  __GOSSIP_UI_UTILS_H__ */