1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 
3 /* e-source-backend-summary-setup.h - Backend Summary Data Configuration.
4  *
5  * Copyright (C) 2012 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: Tristan Van Berkom <tristanvb@openismus.com>
20  */
21 
22 #if !defined (__LIBEBOOK_CONTACTS_H_INSIDE__) && !defined (LIBEBOOK_CONTACTS_COMPILATION)
23 #error "Only <libebook-contacts/libebook-contacts.h> should be included directly."
24 #endif
25 
26 #ifndef E_SOURCE_BACKEND_SUMMARY_SETUP_H
27 #define E_SOURCE_BACKEND_SUMMARY_SETUP_H
28 
29 #include <libedataserver/libedataserver.h>
30 #include <libebook-contacts/e-contact.h>
31 #include <libebook-contacts/e-book-contacts-enums.h>
32 
33 /* Standard GObject macros */
34 #define E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP \
35 	(e_source_backend_summary_setup_get_type ())
36 #define E_SOURCE_BACKEND_SUMMARY_SETUP(obj) \
37 	(G_TYPE_CHECK_INSTANCE_CAST \
38 	((obj), E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP, ESourceBackendSummarySetup))
39 #define E_SOURCE_BACKEND_SUMMARY_SETUP_CLASS(cls) \
40 	(G_TYPE_CHECK_CLASS_CAST \
41 	((cls), E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP, ESourceBackendSummarySetupClass))
42 #define E_IS_SOURCE_BACKEND_SUMMARY_SETUP(obj) \
43 	(G_TYPE_CHECK_INSTANCE_TYPE \
44 	((obj), E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP))
45 #define E_IS_SOURCE_BACKEND_SUMMARY_SETUP_CLASS(cls) \
46 	(G_TYPE_CHECK_CLASS_TYPE \
47 	((cls), E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP))
48 #define E_SOURCE_BACKEND_SUMMARY_SETUP_GET_CLASS(obj) \
49 	(G_TYPE_INSTANCE_GET_CLASS \
50 	((obj), E_TYPE_SOURCE_BACKEND_SUMMARY_SETUP, ESourceBackendSummarySetupClass))
51 
52 /**
53  * E_SOURCE_EXTENSION_BACKEND_SUMMARY_SETUP:
54  *
55  * Pass this extension name to e_source_get_extension() to access
56  * #ESourceBackendSummarySetup.  This is also used as a group name in key files.
57  *
58  * Since: 3.8
59  **/
60 #define E_SOURCE_EXTENSION_BACKEND_SUMMARY_SETUP "Backend Summary Setup"
61 
62 G_BEGIN_DECLS
63 
64 typedef struct _ESourceBackendSummarySetup ESourceBackendSummarySetup;
65 typedef struct _ESourceBackendSummarySetupClass ESourceBackendSummarySetupClass;
66 typedef struct _ESourceBackendSummarySetupPrivate ESourceBackendSummarySetupPrivate;
67 
68 /**
69  * ESourceBackendSummarySetup:
70  *
71  * Contains only private data that should be read and manipulated using the
72  * functions below.
73  *
74  * Since: 3.8
75  **/
76 struct _ESourceBackendSummarySetup {
77 	/*< private >*/
78 	ESourceBackend parent;
79 	ESourceBackendSummarySetupPrivate *priv;
80 };
81 
82 struct _ESourceBackendSummarySetupClass {
83 	ESourceBackendClass parent_class;
84 };
85 
86 GType           e_source_backend_summary_setup_get_type            (void) G_GNUC_CONST;
87 
88 EContactField  *e_source_backend_summary_setup_get_summary_fields  (ESourceBackendSummarySetup *extension,
89 								    gint                       *n_fields);
90 void            e_source_backend_summary_setup_set_summary_fieldsv (ESourceBackendSummarySetup *extension,
91 								    EContactField              *fields,
92 								    gint                        n_fields);
93 void            e_source_backend_summary_setup_set_summary_fields  (ESourceBackendSummarySetup *extension,
94 								    ...);
95 
96 EContactField  *e_source_backend_summary_setup_get_indexed_fields  (ESourceBackendSummarySetup *extension,
97 								    EBookIndexType            **types,
98 								    gint                       *n_fields);
99 void            e_source_backend_summary_setup_set_indexed_fieldsv (ESourceBackendSummarySetup *extension,
100 								    EContactField              *fields,
101 								    EBookIndexType             *types,
102 								    gint                        n_fields);
103 void            e_source_backend_summary_setup_set_indexed_fields  (ESourceBackendSummarySetup *extension,
104 								    ...);
105 
106 G_END_DECLS
107 
108 #endif /* E_SOURCE_BACKEND_SUMMARY_SETUP_H */
109