Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / addressbook / libedata-book / e-book-backend-summary.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* 
3  * pas-backend-summary.h
4  * Copyright 2000, 2001, Ximian, Inc.
5  *
6  * Authors:
7  *   Chris Toshok <toshok@ximian.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License, version 2, as published by the Free Software Foundation.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301, USA.
22  */
23
24 #ifndef __E_BOOK_BACKEND_SUMMARY_H__
25 #define __E_BOOK_BACKEND_SUMMARY_H__
26
27 #include <glib.h>
28 #include <glib-object.h>
29 #include <libedata-book/e-data-book-types.h>
30 #include <libebook/e-contact.h>
31
32 G_BEGIN_DECLS
33
34 #define E_TYPE_BACKEND_SUMMARY        (e_book_backend_summary_get_type ())
35 #define E_BOOK_BACKEND_SUMMARY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BACKEND_SUMMARY, EBookBackendSummary))
36 #define E_BOOK_BACKEND_SUMMARY_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_BOOK_BACKEND_TYPE, EBookBackendSummaryClass))
37 #define E_IS_BACKEND_SUMMARY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BACKEND_SUMMARY))
38 #define E_IS_BACKEND_SUMMARY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BACKEND_SUMMARY))
39 #define E_BOOK_BACKEND_SUMMARY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BACKEND_SUMMARY, EBookBackendSummaryClass))
40
41 typedef struct _EBookBackendSummaryPrivate EBookBackendSummaryPrivate;
42
43 struct _EBookBackendSummary{
44         GObject parent_object;
45         EBookBackendSummaryPrivate *priv;
46 };
47
48 struct _EBookBackendSummaryClass{
49         GObjectClass parent_class;
50 };
51
52 EBookBackendSummary* e_book_backend_summary_new              (const char *summary_path,
53                                                          int flush_timeout_millis);
54 GType              e_book_backend_summary_get_type         (void);
55
56 /* returns FALSE if the load fails for any reason (including that the
57    summary is out of date), TRUE if it succeeds */
58 gboolean           e_book_backend_summary_load             (EBookBackendSummary *summary);
59 /* returns FALSE if the save fails, TRUE if it succeeds (or isn't required due to no changes) */
60 gboolean           e_book_backend_summary_save              (EBookBackendSummary *summary);
61
62 void               e_book_backend_summary_add_contact       (EBookBackendSummary *summary, EContact *contact);
63 void               e_book_backend_summary_remove_contact    (EBookBackendSummary *summary, const char *id);
64 gboolean           e_book_backend_summary_check_contact     (EBookBackendSummary *summary, const char *id);
65
66 void               e_book_backend_summary_touch             (EBookBackendSummary *summary);
67
68 /* returns TRUE if the summary's mtime is >= @t. */
69 gboolean           e_book_backend_summary_is_up_to_date     (EBookBackendSummary *summary, time_t t);
70
71 gboolean           e_book_backend_summary_is_summary_query  (EBookBackendSummary *summary, const char *query);
72 GPtrArray*         e_book_backend_summary_search            (EBookBackendSummary *summary, const char *query);
73 char*              e_book_backend_summary_get_summary_vcard (EBookBackendSummary *summary, const char *id);
74
75 G_END_DECLS
76
77 #endif /* __E_BOOK_BACKEND_SUMMARY_H__ */