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.
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.
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
19 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
20 #error "Only <camel/camel.h> can be included directly."
23 #ifndef CAMEL_OPERATION_H
24 #define CAMEL_OPERATION_H
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))
49 typedef struct _CamelOperation CamelOperation;
50 typedef struct _CamelOperationClass CamelOperationClass;
51 typedef struct _CamelOperationPrivate CamelOperationPrivate;
53 struct _CamelOperation {
55 CamelOperationPrivate *priv;
58 struct _CamelOperationClass {
59 GCancellableClass parent_class;
62 void (*status) (CamelOperation *operation,
67 GType camel_operation_get_type (void);
68 GCancellable * camel_operation_new (void);
69 void camel_operation_cancel_all (void);
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. */
76 void camel_operation_push_message (GCancellable *cancellable,
78 ...) G_GNUC_PRINTF (2, 3);
79 void camel_operation_pop_message (GCancellable *cancellable);
80 void camel_operation_progress (GCancellable *cancellable,
85 #endif /* CAMEL_OPERATION_H */