Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-operation.h
1 /*
2  * camel-operation.h
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of version 2 of the GNU Lesser General Public
6  * License as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
16  * USA
17  */
18
19 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
20 #error "Only <camel/camel.h> can be included directly."
21 #endif
22
23 #ifndef CAMEL_OPERATION_H
24 #define CAMEL_OPERATION_H
25
26 #include <gio/gio.h>
27
28 /* Standard GObject macros */
29 #define CAMEL_TYPE_OPERATION \
30         (camel_operation_get_type ())
31 #define CAMEL_OPERATION(obj) \
32         (G_TYPE_CHECK_INSTANCE_CAST \
33         ((obj), CAMEL_TYPE_OPERATION, CamelOperation))
34 #define CAMEL_OPERATION_CLASS(cls) \
35         (G_TYPE_CHECK_CLASS_CAST \
36         ((cls), CAMEL_TYPE_OPERATION, CamelOperationClass))
37 #define CAMEL_IS_OPERATION(obj) \
38         (G_TYPE_CHECK_INSTANCE_TYPE \
39         ((obj), CAMEL_TYPE_OPERATION))
40 #define CAMEL_IS_OPERATION_CLASS(cls) \
41         (G_TYPE_CHECK_CLASS_TYPE \
42         ((cls), CAMEL_TYPE_OPERATION))
43 #define CAMEL_OPERATION_GET_CLASS(obj) \
44         (G_TYPE_INSTANCE_GET_CLASS \
45         ((obj), CAMEL_TYPE_OPERATION, CamelOperationClass))
46
47 G_BEGIN_DECLS
48
49 typedef struct _CamelOperation CamelOperation;
50 typedef struct _CamelOperationClass CamelOperationClass;
51 typedef struct _CamelOperationPrivate CamelOperationPrivate;
52
53 struct _CamelOperation {
54         GCancellable parent;
55         CamelOperationPrivate *priv;
56 };
57
58 struct _CamelOperationClass {
59         GCancellableClass parent_class;
60
61         /* Signals */
62         void            (*status)               (CamelOperation *operation,
63                                                  const gchar *what,
64                                                  gint pc);
65 };
66
67 GType           camel_operation_get_type        (void);
68 GCancellable *  camel_operation_new             (void);
69 void            camel_operation_cancel_all      (void);
70
71 /* Since Camel methods pass around GCancellable pointers instead of
72  * CamelOperation pointers, it's more convenient to callers to take
73  * a GCancellable pointer and just return silently if the pointer is
74  * NULL or the pointed to object actually is a plain GCancellable. */
75
76 void            camel_operation_push_message    (GCancellable *cancellable,
77                                                  const gchar *format,
78                                                  ...) G_GNUC_PRINTF (2, 3);
79 void            camel_operation_pop_message     (GCancellable *cancellable);
80 void            camel_operation_progress        (GCancellable *cancellable,
81                                                  gint percent);
82
83 G_END_DECLS
84
85 #endif /* CAMEL_OPERATION_H */