Bug #606181 - Accepting bad SSL certificate applies to any hostname
[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
24 #ifndef CAMEL_IMAPX_JOB_H
25 #define CAMEL_IMAPX_JOB_H
26
27 #include "camel-imapx-server.h"
28
29 #define CAMEL_IS_IMAPX_JOB(job) \
30         (camel_imapx_job_check (job))
31
32 G_BEGIN_DECLS
33
34 typedef struct _CamelIMAPXJob CamelIMAPXJob;
35
36 struct _uidset_state {
37         gint entries, uids;
38         gint total, limit;
39         guint32 start;
40         guint32 last;
41 };
42
43 struct _CamelIMAPXJob {
44         GCancellable *cancellable;
45         GError *error;
46
47         /* Whether to pop a status message off the
48          * GCancellable when the job is finalized. */
49         gboolean pop_operation_msg;
50
51         void            (*start)                (CamelIMAPXJob *job,
52                                                  CamelIMAPXServer *is);
53         gboolean        (*matches)              (CamelIMAPXJob *job,
54                                                  CamelFolder *folder,
55                                                  const gchar *uid);
56
57         guint noreply:1;        /* dont wait for reply */
58         guint32 type;           /* operation type */
59         gint pri;               /* the command priority */
60         gshort commands;        /* counts how many commands are outstanding */
61
62         CamelFolder *folder;
63 };
64
65 CamelIMAPXJob * camel_imapx_job_new             (GCancellable *cancellable);
66 CamelIMAPXJob * camel_imapx_job_ref             (CamelIMAPXJob *job);
67 void            camel_imapx_job_unref           (CamelIMAPXJob *job);
68 gboolean        camel_imapx_job_check           (CamelIMAPXJob *job);
69 void            camel_imapx_job_wait            (CamelIMAPXJob *job);
70 void            camel_imapx_job_done            (CamelIMAPXJob *job);
71 gboolean        camel_imapx_job_run             (CamelIMAPXJob *job,
72                                                  CamelIMAPXServer *is,
73                                                  GError **error);
74 gboolean        camel_imapx_job_matches         (CamelIMAPXJob *job,
75                                                  CamelFolder *folder,
76                                                  const gchar *uid);
77 gpointer        camel_imapx_job_get_data        (CamelIMAPXJob *job);
78 void            camel_imapx_job_set_data        (CamelIMAPXJob *job,
79                                                  gpointer data,
80                                                  GDestroyNotify destroy_data);
81
82 G_END_DECLS
83
84 #endif /* CAMEL_IMAPX_JOB_H */
85