Whitespace cleanups.
[platform/upstream/evolution-data-server.git] / camel / camel-imapx-job.h
1 /*
2  * camel-imapx-job.h
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) version 3.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with the program; if not, see <http://www.gnu.org/licenses/>
16  *
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_IMAPX_JOB_H
24 #define CAMEL_IMAPX_JOB_H
25
26 #include "camel-imapx-server.h"
27
28 #define CAMEL_IS_IMAPX_JOB(job) \
29         (camel_imapx_job_check (job))
30
31 G_BEGIN_DECLS
32
33 typedef struct _CamelIMAPXJob CamelIMAPXJob;
34
35 struct _uidset_state {
36         gint entries, uids;
37         gint total, limit;
38         guint32 start;
39         guint32 last;
40 };
41
42 struct _CamelIMAPXJob {
43         GCancellable *cancellable;
44         GError *error;
45
46         /* Whether to pop a status message off the
47          * GCancellable when the job is finalized. */
48         gboolean pop_operation_msg;
49
50         void            (*start)                (CamelIMAPXJob *job,
51                                                  CamelIMAPXServer *is);
52         gboolean        (*matches)              (CamelIMAPXJob *job,
53                                                  CamelFolder *folder,
54                                                  const gchar *uid);
55
56         guint noreply:1;        /* dont wait for reply */
57         guint32 type;           /* operation type */
58         gint pri;               /* the command priority */
59         gshort commands;        /* counts how many commands are outstanding */
60
61         CamelFolder *folder;
62 };
63
64 CamelIMAPXJob * camel_imapx_job_new             (GCancellable *cancellable);
65 CamelIMAPXJob * camel_imapx_job_ref             (CamelIMAPXJob *job);
66 void            camel_imapx_job_unref           (CamelIMAPXJob *job);
67 gboolean        camel_imapx_job_check           (CamelIMAPXJob *job);
68 void            camel_imapx_job_wait            (CamelIMAPXJob *job);
69 void            camel_imapx_job_done            (CamelIMAPXJob *job);
70 gboolean        camel_imapx_job_run             (CamelIMAPXJob *job,
71                                                  CamelIMAPXServer *is,
72                                                  GError **error);
73 gboolean        camel_imapx_job_matches         (CamelIMAPXJob *job,
74                                                  CamelFolder *folder,
75                                                  const gchar *uid);
76 gpointer        camel_imapx_job_get_data        (CamelIMAPXJob *job);
77 void            camel_imapx_job_set_data        (CamelIMAPXJob *job,
78                                                  gpointer data,
79                                                  GDestroyNotify destroy_data);
80
81 G_END_DECLS
82
83 #endif /* CAMEL_IMAPX_JOB_H */
84