2007-01-16 [colin] 2.7.1cvs8
[claws.git] / src / etpan / imap-thread.h
1 #ifndef IMAP_THREAD_H
2
3 #define IMAP_THREAD_H
4
5 #include <libetpan/libetpan.h>
6 #include "folder.h"
7
8 #define IMAP_SET_MAX_COUNT 100
9
10 void imap_main_set_timeout(int sec);
11 void imap_main_init(gboolean skip_ssl_cert_check);
12 void imap_main_done(void);
13
14 void imap_init(Folder * folder);
15 void imap_done(Folder * folder);
16
17 int imap_threaded_connect(Folder * folder, const char * server, int port);
18 int imap_threaded_connect_ssl(Folder * folder, const char * server, int port);
19 struct mailimap_capability_data * imap_threaded_capability(Folder *folder, int *ok);
20 int imap_threaded_connect_cmd(Folder * folder, const char * command,
21                               const char * server, int port);
22
23 void imap_threaded_disconnect(Folder * folder);
24
25 int imap_threaded_list(Folder * folder, const char * base,
26                        const char * wildcard,
27                        clist ** p_result);
28 int imap_threaded_lsub(Folder * folder, const char * base,
29                        const char * wildcard,
30                        clist ** p_result);
31 int imap_threaded_login(Folder * folder,
32                         const char * login, const char * password,
33                         const char * type);
34 int imap_threaded_status(Folder * folder, const char * mb,
35                 struct mailimap_mailbox_data_status ** data_status,
36                 guint mask);
37
38 int imap_threaded_noop(Folder * folder, unsigned int * p_exists);
39 int imap_threaded_starttls(Folder * folder, const gchar *host, int port);
40 int imap_threaded_create(Folder * folder, const char * mb);
41 int imap_threaded_rename(Folder * folder,
42                          const char * mb, const char * new_name);
43 int imap_threaded_delete(Folder * folder, const char * mb);
44 int imap_threaded_select(Folder * folder, const char * mb,
45                          gint * exists, gint * recent, gint * unseen,
46                          guint32 * uid_validity);
47 int imap_threaded_examine(Folder * folder, const char * mb,
48                           gint * exists, gint * recent, gint * unseen,
49                           guint32 * uid_validity);
50 int imap_threaded_subscribe(Folder * folder, const char * mb,
51                        gboolean subscribe);
52
53 enum {
54         IMAP_SEARCH_TYPE_SIMPLE,
55         IMAP_SEARCH_TYPE_SEEN,
56         IMAP_SEARCH_TYPE_UNSEEN,
57         IMAP_SEARCH_TYPE_ANSWERED,
58         IMAP_SEARCH_TYPE_FLAGGED,
59         IMAP_SEARCH_TYPE_DELETED,
60 };
61
62 int imap_threaded_search(Folder * folder, int search_type,
63                          struct mailimap_set * set, clist ** result);
64
65 int imap_threaded_fetch_uid(Folder * folder, uint32_t first_index,
66                             carray ** result);
67
68 void imap_fetch_uid_list_free(carray * uid_list);
69
70 int imap_threaded_fetch_content(Folder * folder, uint32_t msg_index,
71                                 int with_body,
72                                 const char * filename);
73
74 struct imap_fetch_env_info {
75         uint32_t uid;
76         char * headers;
77         uint32_t size;
78         int flags;
79 };
80
81 int imap_threaded_fetch_env(Folder * folder, struct mailimap_set * set,
82                             carray ** p_env_list);
83
84 void imap_fetch_env_free(carray * env_list);
85
86 int imap_threaded_append(Folder * folder, const char * mailbox,
87                          const char * filename,
88                          struct mailimap_flag_list * flag_list,
89                          int *uid);
90
91 int imap_threaded_expunge(Folder * folder);
92
93 int imap_threaded_copy(Folder * folder, struct mailimap_set * set,
94                        const char * mb, struct mailimap_set **source,
95                        struct mailimap_set **dest);
96
97 int imap_threaded_store(Folder * folder, struct mailimap_set * set,
98                         struct mailimap_store_att_flags * store_att_flags);
99
100 #endif