Camel: Allow SSL certificate resave and use detailed errors from SSL stream
[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 (C) 1999-2008 Novell, Inc. (www.novell.com)
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 <libedata-book/e-data-book-types.h>
28 #include <libebook/e-contact.h>
29
30 /* Standard GObject macros */
31 #define E_TYPE_BOOK_BACKEND_SUMMARY \
32         (e_book_backend_summary_get_type ())
33 #define E_BOOK_BACKEND_SUMMARY(obj) \
34         (G_TYPE_CHECK_INSTANCE_CAST \
35         ((obj), E_TYPE_BOOK_BACKEND_SUMMARY, EBookBackendSummary))
36 #define E_BOOK_BACKEND_SUMMARY_CLASS(cls) \
37         (G_TYPE_CHECK_CLASS_CAST \
38         ((cls), E_TYPE_BOOK_BACKEND_SUMMARY, EBookBackendSummaryClass))
39 #define E_IS_BOOK_BACKEND_SUMMARY(obj) \
40         (G_TYPE_CHECK_INSTANCE_TYPE \
41         ((obj), E_TYPE_BOOK_BACKEND_SUMMARY))
42 #define E_IS_BOOK_BACKEND_SUMMARY_CLASS(cls) \
43         (G_TYPE_CHECK_CLASS_TYPE \
44         ((cls), E_TYPE_BOOK_BACKEND_SUMMARY))
45 #define E_BOOK_BACKEND_SUMMARY_GET_CLASS(cls) \
46         (G_TYPE_INSTANCE_GET_CLASS \
47         ((obj), E_TYPE_BOOK_BACKEND_SUMMARY, EBookBackendSummaryClass))
48
49 G_BEGIN_DECLS
50
51 typedef struct _EBookBackendSummary EBookBackendSummary;
52 typedef struct _EBookBackendSummaryClass EBookBackendSummaryClass;
53 typedef struct _EBookBackendSummaryPrivate EBookBackendSummaryPrivate;
54
55 struct _EBookBackendSummary{
56         GObject parent_object;
57         EBookBackendSummaryPrivate *priv;
58 };
59
60 struct _EBookBackendSummaryClass{
61         GObjectClass parent_class;
62 };
63
64 GType           e_book_backend_summary_get_type (void) G_GNUC_CONST;
65 EBookBackendSummary *
66                 e_book_backend_summary_new      (const gchar *summary_path,
67                                                  gint flush_timeout_millis);
68
69 /* returns FALSE if the load fails for any reason (including that the
70  * summary is out of date), TRUE if it succeeds */
71 gboolean        e_book_backend_summary_load     (EBookBackendSummary *summary);
72 /* returns FALSE if the save fails, TRUE if it succeeds (or isn't required due to no changes) */
73 gboolean        e_book_backend_summary_save     (EBookBackendSummary *summary);
74
75 void            e_book_backend_summary_add_contact
76                                                 (EBookBackendSummary *summary,
77                                                  EContact *contact);
78 void            e_book_backend_summary_remove_contact
79                                                 (EBookBackendSummary *summary,
80                                                  const gchar *id);
81 gboolean        e_book_backend_summary_check_contact
82                                                 (EBookBackendSummary *summary,
83                                                  const gchar *id);
84
85 void            e_book_backend_summary_touch    (EBookBackendSummary *summary);
86
87 /* returns TRUE if the summary's mtime is >= @t. */
88 gboolean        e_book_backend_summary_is_up_to_date
89                                                 (EBookBackendSummary *summary,
90                                                  time_t t);
91
92 gboolean        e_book_backend_summary_is_summary_query
93                                                 (EBookBackendSummary *summary,
94                                                  const gchar *query);
95 GPtrArray *     e_book_backend_summary_search   (EBookBackendSummary *summary,
96                                                  const gchar *query);
97 gchar *         e_book_backend_summary_get_summary_vcard
98                                                 (EBookBackendSummary *summary,
99                                                  const gchar *id);
100
101 G_END_DECLS
102
103 #endif /* E_BOOK_BACKEND_SUMMARY_H */