1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
4  * Copyright (C) 2006 OpenedHand Ltd
5  * Copyright (C) 2009 Intel Corporation
6  *
7  * This library is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authors: Nat Friedman <nat@ximian.com>
20  *          Ross Burton <ross@linux.intel.com>
21  */
22 
23 #if !defined (__LIBEDATA_BOOK_H_INSIDE__) && !defined (LIBEDATA_BOOK_COMPILATION)
24 #error "Only <libedata-book/libedata-book.h> should be included directly."
25 #endif
26 
27 #ifndef E_DATA_BOOK_VIEW_H
28 #define E_DATA_BOOK_VIEW_H
29 
30 #include <libebook-contacts/libebook-contacts.h>
31 
32 #include <libedata-book/e-book-backend-sexp.h>
33 
34 /* Standard GObject macros */
35 #define E_TYPE_DATA_BOOK_VIEW \
36 	(e_data_book_view_get_type ())
37 #define E_DATA_BOOK_VIEW(obj) \
38 	(G_TYPE_CHECK_INSTANCE_CAST \
39 	((obj), E_TYPE_DATA_BOOK_VIEW, EDataBookView))
40 #define E_DATA_BOOK_VIEW_CLASS(cls) \
41 	(G_TYPE_CHECK_CLASS_CAST \
42 	((cls), E_TYPE_DATA_BOOK_VIEW, EDataBookViewClass))
43 #define E_IS_DATA_BOOK_VIEW(obj) \
44 	(G_TYPE_CHECK_INSTANCE_TYPE \
45 	((obj), E_TYPE_DATA_BOOK_VIEW))
46 #define E_IS_DATA_BOOK_VIEW_CLASS(cls) \
47 	(G_TYPE_CHECK_CLASS_TYPE \
48 	((cls), E_TYPE_DATA_BOOK_VIEW))
49 #define E_DATA_BOOK_VIEW_GET_CLASS(obj) \
50 	(G_TYPE_INSTANCE_GET_CLASS \
51 	((obj), E_TYPE_DATA_BOOK_VIEW, EDataBookViewClass))
52 
53 G_BEGIN_DECLS
54 
55 struct _EBookBackend;
56 
57 typedef struct _EDataBookView EDataBookView;
58 typedef struct _EDataBookViewClass EDataBookViewClass;
59 typedef struct _EDataBookViewPrivate EDataBookViewPrivate;
60 
61 struct _EDataBookView {
62 	GObject parent;
63 	EDataBookViewPrivate *priv;
64 };
65 
66 struct _EDataBookViewClass {
67 	GObjectClass parent;
68 };
69 
70 GType		e_data_book_view_get_type	(void) G_GNUC_CONST;
71 EDataBookView *	e_data_book_view_new		(struct _EBookBackend *backend,
72 						 EBookBackendSExp *sexp,
73 						 GDBusConnection *connection,
74 						 const gchar *object_path,
75 						 GError **error);
76 struct _EBookBackend *
77 		e_data_book_view_ref_backend	(EDataBookView *view);
78 #ifndef EDS_DISABLE_DEPRECATED
79 struct _EBookBackend *
80 		e_data_book_view_get_backend	(EDataBookView *view);
81 #endif /* EDS_DISABLE_DEPRECATED */
82 GDBusConnection *
83 		e_data_book_view_get_connection	(EDataBookView *view);
84 const gchar *	e_data_book_view_get_object_path
85 						(EDataBookView *view);
86 EBookBackendSExp *
87 		e_data_book_view_get_sexp	(EDataBookView *view);
88 EBookClientViewFlags
89 		e_data_book_view_get_flags	(EDataBookView *view);
90 gboolean	e_data_book_view_is_completed	(EDataBookView *view);
91 void		e_data_book_view_notify_update	(EDataBookView *view,
92 						 const EContact *contact);
93 
94 void		e_data_book_view_notify_update_vcard
95 						(EDataBookView *view,
96 						 const gchar *id,
97 						 const gchar *vcard);
98 void		e_data_book_view_notify_update_prefiltered_vcard
99 						(EDataBookView *view,
100 						 const gchar *id,
101 						 const gchar *vcard);
102 
103 void		e_data_book_view_notify_remove	(EDataBookView *view,
104 						 const gchar *id);
105 void		e_data_book_view_notify_complete
106 						(EDataBookView *view,
107 						 const GError *error);
108 void		e_data_book_view_notify_progress
109 						(EDataBookView *view,
110 						 guint percent,
111 						 const gchar *message);
112 
113 GHashTable *	e_data_book_view_get_fields_of_interest
114 						(EDataBookView *view);
115 
116 G_END_DECLS
117 
118 #endif /* E_DATA_BOOK_VIEW_H */
119