Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserverui / e-contact-store.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* e-contact-store.h - Contacts store with GtkTreeModel interface.
4  *
5  * Copyright (C) 2004 Novell, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of version 2 of the GNU Lesser General Public
9  * License as published by the Free Software Foundation.
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
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * Authors: Hans Petter Jansson <hpj@novell.com>
21  */
22
23 #ifndef E_CONTACT_STORE_H
24 #define E_CONTACT_STORE_H
25
26 #include <gtk/gtktreemodel.h>
27 #include <libebook/e-contact.h>
28 #include <libebook/e-book.h>
29 #include <libebook/e-book-query.h>
30 #include <libebook/e-book-types.h>
31
32 G_BEGIN_DECLS
33
34 #define E_TYPE_CONTACT_STORE            (e_contact_store_get_type ())
35 #define E_CONTACT_STORE(obj)            (GTK_CHECK_CAST ((obj), E_TYPE_CONTACT_STORE, EContactStore))
36 #define E_CONTACT_STORE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_STORE, EContactStoreClass))
37 #define E_IS_CONTACT_STORE(obj)         (GTK_CHECK_TYPE ((obj), E_TYPE_CONTACT_STORE))
38 #define E_IS_CONTACT_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_CONTACT_STORE))
39 #define E_CONTACT_STORE_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), E_TYPE_CONTACT_STORE, EContactStoreClass))
40
41 typedef struct _EContactStore       EContactStore;
42 typedef struct _EContactStoreClass  EContactStoreClass;
43
44 struct _EContactStoreClass {
45         GObjectClass parent_class;
46 };
47
48 struct _EContactStore {
49         GObject     parent;
50
51         /* Private */
52
53         gint        stamp;
54         EBookQuery *query;
55         GArray     *contact_sources;
56 };
57
58 GtkType        e_contact_store_get_type     (void);
59 EContactStore *e_contact_store_new          (void);
60
61 EBook         *e_contact_store_get_book     (EContactStore *contact_store, GtkTreeIter *iter);
62 EContact      *e_contact_store_get_contact  (EContactStore *contact_store, GtkTreeIter *iter);
63 gboolean       e_contact_store_find_contact (EContactStore *contact_store, const gchar *uid,
64                                              GtkTreeIter *iter);
65
66 /* Returns a shallow copy; free the list when done, but don't unref elements */
67 GList         *e_contact_store_get_books    (EContactStore *contact_store);
68
69 void           e_contact_store_add_book     (EContactStore *contact_store, EBook *book);
70 void           e_contact_store_remove_book  (EContactStore *contact_store, EBook *book);
71
72 void           e_contact_store_set_query    (EContactStore *contact_store, EBookQuery *book_query);
73 EBookQuery    *e_contact_store_peek_query   (EContactStore *contact_store);
74
75 EBookView     *find_contact_source_by_book_return_view(EContactStore *contact_store, EBook *book);
76
77 G_END_DECLS
78
79 #endif  /* E_CONTACT_STORE_H */