1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* e-contact-store.h - Contacts store with GtkTreeModel interface.
5 * Copyright (C) 2004 Novell, Inc.
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.
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.
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.
20 * Authors: Hans Petter Jansson <hpj@novell.com>
23 #ifndef E_CONTACT_STORE_H
24 #define E_CONTACT_STORE_H
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>
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))
41 typedef struct _EContactStore EContactStore;
42 typedef struct _EContactStoreClass EContactStoreClass;
44 struct _EContactStoreClass {
45 GObjectClass parent_class;
48 struct _EContactStore {
55 GArray *contact_sources;
58 GtkType e_contact_store_get_type (void);
59 EContactStore *e_contact_store_new (void);
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,
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);
69 void e_contact_store_add_book (EContactStore *contact_store, EBook *book);
70 void e_contact_store_remove_book (EContactStore *contact_store, EBook *book);
72 void e_contact_store_set_query (EContactStore *contact_store, EBookQuery *book_query);
73 EBookQuery *e_contact_store_peek_query (EContactStore *contact_store);
75 EBookView *find_contact_source_by_book_return_view(EContactStore *contact_store, EBook *book);
79 #endif /* E_CONTACT_STORE_H */