]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-contact-list-store.h
add 'Ungrouped' fake contact
[empathy.git] / libempathy-gtk / empathy-contact-list-store.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2005-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  *          Martyn Russell <martyn@imendio.com>
23  *          Xavier Claessens <xclaesse@gmail.com>
24  */
25
26 #ifndef __EMPATHY_CONTACT_LIST_STORE_H__
27 #define __EMPATHY_CONTACT_LIST_STORE_H__
28
29 #include <gtk/gtk.h>
30
31 #include <libempathy/empathy-contact-list.h>
32 #include <libempathy/empathy-contact.h>
33
34 G_BEGIN_DECLS
35
36 #define EMPATHY_TYPE_CONTACT_LIST_STORE         (empathy_contact_list_store_get_type ())
37 #define EMPATHY_CONTACT_LIST_STORE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONTACT_LIST_STORE, EmpathyContactListStore))
38 #define EMPATHY_CONTACT_LIST_STORE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_CONTACT_LIST_STORE, EmpathyContactListStoreClass))
39 #define EMPATHY_IS_CONTACT_LIST_STORE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONTACT_LIST_STORE))
40 #define EMPATHY_IS_CONTACT_LIST_STORE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CONTACT_LIST_STORE))
41 #define EMPATHY_CONTACT_LIST_STORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CONTACT_LIST_STORE, EmpathyContactListStoreClass))
42
43 typedef struct _EmpathyContactListStore      EmpathyContactListStore;
44 typedef struct _EmpathyContactListStoreClass EmpathyContactListStoreClass;
45
46 typedef enum {
47         EMPATHY_CONTACT_LIST_STORE_SORT_STATE,
48         EMPATHY_CONTACT_LIST_STORE_SORT_NAME
49 } EmpathyContactListStoreSort;
50
51 typedef enum {
52         EMPATHY_CONTACT_LIST_STORE_COL_ICON_STATUS,
53         EMPATHY_CONTACT_LIST_STORE_COL_PIXBUF_AVATAR,
54         EMPATHY_CONTACT_LIST_STORE_COL_PIXBUF_AVATAR_VISIBLE,
55         EMPATHY_CONTACT_LIST_STORE_COL_NAME,
56         EMPATHY_CONTACT_LIST_STORE_COL_STATUS,
57         EMPATHY_CONTACT_LIST_STORE_COL_STATUS_VISIBLE,
58         EMPATHY_CONTACT_LIST_STORE_COL_CONTACT,
59         EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP,
60         EMPATHY_CONTACT_LIST_STORE_COL_IS_ACTIVE,
61         EMPATHY_CONTACT_LIST_STORE_COL_IS_ONLINE,
62         EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR,
63         EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL,
64         EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
65         EMPATHY_CONTACT_LIST_STORE_COL_FLAGS,
66         EMPATHY_CONTACT_LIST_STORE_COL_IS_FAVOURITE,
67         EMPATHY_CONTACT_LIST_STORE_COL_COUNT,
68 } EmpathyContactListStoreCol;
69
70 #define EMPATHY_CONTACT_LIST_STORE_UNGROUPED _("Ungrouped")
71
72 struct _EmpathyContactListStore {
73         GtkTreeStore parent;
74         gpointer priv;
75 };
76
77 struct _EmpathyContactListStoreClass {
78         GtkTreeStoreClass parent_class;
79 };
80
81 GType                      empathy_contact_list_store_get_type           (void) G_GNUC_CONST;
82 EmpathyContactListStore *  empathy_contact_list_store_new                (EmpathyContactList         *list_iface);
83 EmpathyContactList *       empathy_contact_list_store_get_list_iface     (EmpathyContactListStore     *store);
84 gboolean                   empathy_contact_list_store_get_show_offline   (EmpathyContactListStore     *store);
85 void                       empathy_contact_list_store_set_show_offline   (EmpathyContactListStore     *store,
86                                                                          gboolean                    show_offline);
87 gboolean                   empathy_contact_list_store_get_show_avatars   (EmpathyContactListStore     *store);
88 void                       empathy_contact_list_store_set_show_avatars   (EmpathyContactListStore     *store,
89                                                                          gboolean                    show_avatars);
90 gboolean                   empathy_contact_list_store_get_show_groups   (EmpathyContactListStore     *store);
91 void                       empathy_contact_list_store_set_show_groups   (EmpathyContactListStore     *store,
92                                                                          gboolean                    show_groups);
93 gboolean                   empathy_contact_list_store_get_is_compact     (EmpathyContactListStore     *store);
94 void                       empathy_contact_list_store_set_is_compact     (EmpathyContactListStore     *store,
95                                                                          gboolean                    is_compact);
96 gboolean                   empathy_contact_list_store_get_show_protocols   (EmpathyContactListStore     *store);
97 void                       empathy_contact_list_store_set_show_protocols   (EmpathyContactListStore     *store,
98                                                                          gboolean                    show_protocols);
99 EmpathyContactListStoreSort empathy_contact_list_store_get_sort_criterium (EmpathyContactListStore     *store);
100 void                       empathy_contact_list_store_set_sort_criterium (EmpathyContactListStore     *store,
101                                                                          EmpathyContactListStoreSort  sort_criterium);
102 gboolean                   empathy_contact_list_store_row_separator_func (GtkTreeModel               *model,
103                                                                          GtkTreeIter                *iter,
104                                                                          gpointer                    data);
105 gchar *                    empathy_contact_list_store_get_parent_group   (GtkTreeModel               *model,
106                                                                          GtkTreePath                *path,
107                                                                          gboolean                   *path_is_group);
108 gboolean                   empathy_contact_list_store_search_equal_func  (GtkTreeModel               *model,
109                                                                          gint                        column,
110                                                                          const gchar                *key,
111                                                                          GtkTreeIter                *iter,
112                                                                          gpointer                    search_data);
113 GdkPixbuf *                contact_list_store_get_contact_status_icon ( EmpathyContactListStore *store,
114                                                                          EmpathyContact             *contact);
115
116 G_END_DECLS
117
118 #endif /* __EMPATHY_CONTACT_LIST_STORE_H__ */
119