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) 2012 Intel Corporation
5  *
6  * This library is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  * for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Authors: Nat Friedman (nat@ximian.com)
19  *          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_BOOK_CONTACTS_ENUMS_H
27 #define E_BOOK_CONTACTS_ENUMS_H
28 
29 G_BEGIN_DECLS
30 
31 /**
32  * EBookClientViewFlags:
33  * @E_BOOK_CLIENT_VIEW_FLAGS_NONE:
34  *   Symbolic value for no flags
35  * @E_BOOK_CLIENT_VIEW_FLAGS_NOTIFY_INITIAL:
36  *   If this flag is set then all contacts matching the view's query will
37  *   be sent as notifications when starting the view, otherwise only future
38  *   changes will be reported.  The default for an #EBookClientView is %TRUE.
39  *
40  * Flags that control the behaviour of an #EBookClientView.
41  *
42  * Since: 3.4
43  */
44 typedef enum { /*< flags >*/
45 	E_BOOK_CLIENT_VIEW_FLAGS_NONE = 0,
46 	E_BOOK_CLIENT_VIEW_FLAGS_NOTIFY_INITIAL = (1 << 0),
47 } EBookClientViewFlags;
48 
49 /**
50  * EBookIndexType:
51  * @E_BOOK_INDEX_PREFIX: An index suitable for searching contacts with a prefix pattern
52  * @E_BOOK_INDEX_SUFFIX: An index suitable for searching contacts with a suffix pattern
53  * @E_BOOK_INDEX_PHONE: An index suitable for searching contacts for phone numbers.
54  * <note><para>Phone numbers must be convertible into FQTN according to E.164 to be
55  * stored in this index. The number "+9999999" for instance won't be stored because
56  * the country calling code "+999" currently is not assigned.</para></note>
57  * @E_BOOK_INDEX_SORT_KEY: Indicates that a given #EContactField should be usable as a sort key.
58  *
59  * The type of index defined by e_source_backend_summary_setup_set_indexed_fields()
60  */
61 typedef enum {
62 	E_BOOK_INDEX_PREFIX = 0,
63 	E_BOOK_INDEX_SUFFIX,
64 	E_BOOK_INDEX_PHONE,
65 	E_BOOK_INDEX_SORT_KEY
66 } EBookIndexType;
67 
68 /**
69  * EBookCursorSortType:
70  * @E_BOOK_CURSOR_SORT_ASCENDING: Sort results in ascending order
71  * @E_BOOK_CURSOR_SORT_DESCENDING: Sort results in descending order
72  *
73  * Specifies the sort order of an ordered query
74  *
75  * Since: 3.12
76  */
77 typedef enum {
78 	E_BOOK_CURSOR_SORT_ASCENDING = 0,
79 	E_BOOK_CURSOR_SORT_DESCENDING
80 } EBookCursorSortType;
81 
82 /**
83  * EBookCursorOrigin:
84  * @E_BOOK_CURSOR_ORIGIN_CURRENT:  The current cursor position
85  * @E_BOOK_CURSOR_ORIGIN_BEGIN:    The beginning of the cursor results.
86  * @E_BOOK_CURSOR_ORIGIN_END:      The ending of the cursor results.
87  *
88  * Specifies the start position to in the list of traversed contacts
89  * in calls to e_book_client_cursor_step().
90  *
91  * When an #EBookClientCursor is created, the current position implied by %E_BOOK_CURSOR_ORIGIN_CURRENT
92  * is the same as %E_BOOK_CURSOR_ORIGIN_BEGIN.
93  *
94  * Since: 3.12
95  */
96 typedef enum {
97 	E_BOOK_CURSOR_ORIGIN_CURRENT,
98 	E_BOOK_CURSOR_ORIGIN_BEGIN,
99 	E_BOOK_CURSOR_ORIGIN_END
100 } EBookCursorOrigin;
101 
102 /**
103  * EBookCursorStepFlags:
104  * @E_BOOK_CURSOR_STEP_MOVE:  The cursor position should be modified while stepping
105  * @E_BOOK_CURSOR_STEP_FETCH: Traversed contacts should be listed and returned while stepping.
106  *
107  * Defines the behaviour of e_book_client_cursor_step().
108  *
109  * Since: 3.12
110  */
111 typedef enum { /*< flags >*/
112 	E_BOOK_CURSOR_STEP_MOVE = (1 << 0),
113 	E_BOOK_CURSOR_STEP_FETCH = (1 << 1)
114 } EBookCursorStepFlags;
115 
116 /**
117  * EBookOperationFlags:
118  * @E_BOOK_OPERATION_FLAG_NONE: no operation flags defined
119  * @E_BOOK_OPERATION_FLAG_CONFLICT_FAIL: conflict resolution mode, to fail and do not
120  *    do any changes, when a conflict is detected
121  * @E_BOOK_OPERATION_FLAG_CONFLICT_USE_NEWER: conflict resolution mode, to use newer
122  *    of the local and the server side data, when a conflict is detected
123  * @E_BOOK_OPERATION_FLAG_CONFLICT_KEEP_SERVER: conflict resolution mode, to use
124  *    the server data (and local changed), when a conflict is detected
125  * @E_BOOK_OPERATION_FLAG_CONFLICT_KEEP_LOCAL: conflict resolution mode, to use
126  *    local data (and always overwrite server data), when a conflict is detected
127  * @E_BOOK_OPERATION_FLAG_CONFLICT_WRITE_COPY: conflict resolution mode, to create
128  *    a copy of the data, when a conflict is detected
129  *
130  * Book operation flags, to specify behavior in certain situations. The conflict
131  * resolution mode flags cannot be combined together, where the @E_BOOK_OPERATION_FLAG_CONFLICT_KEEP_LOCAL
132  * is the default behavior (and it is used when no other conflict resolution flag is set).
133  * The flags can be ignored when the operation or the backend don't support it.
134  *
135  * Since: 3.34
136  **/
137 typedef enum { /*< flags >*/
138 	E_BOOK_OPERATION_FLAG_NONE			= 0,
139 	E_BOOK_OPERATION_FLAG_CONFLICT_FAIL		= (1 << 0),
140 	E_BOOK_OPERATION_FLAG_CONFLICT_USE_NEWER	= (1 << 1),
141 	E_BOOK_OPERATION_FLAG_CONFLICT_KEEP_SERVER	= (1 << 2),
142 	E_BOOK_OPERATION_FLAG_CONFLICT_KEEP_LOCAL	= 0,
143 	E_BOOK_OPERATION_FLAG_CONFLICT_WRITE_COPY	= (1 << 3)
144 } EBookOperationFlags;
145 
146 G_END_DECLS
147 
148 #endif /* E_BOOK_CONTACTS_ENUMS_H */
149