591f13c3a959424443b1b1c3254d9a79f8eb7df2
[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(void);
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 int imap_threaded_connect_cmd(Folder * folder, const char * command,
20                               const char * server, int port);
21
22 void imap_threaded_disconnect(Folder * folder);
23
24 int imap_threaded_list(Folder * folder, const char * base,
25                        const char * wildcard,
26                        clist ** p_result);
27 int imap_threaded_login(Folder * folder,
28                         const char * login, const char * password);
29 int imap_threaded_status(Folder * folder, const char * mb,
30                 struct mailimap_mailbox_data_status ** data_status);
31
32 int imap_threaded_noop(Folder * folder);
33 int imap_threaded_starttls(Folder * folder);
34 int imap_threaded_create(Folder * folder, const char * mb);
35 int imap_threaded_rename(Folder * folder,
36                          const char * mb, const char * new_name);
37 int imap_threaded_delete(Folder * folder, const char * mb);
38 int imap_threaded_select(Folder * folder, const char * mb,
39                          gint * exists, gint * recent, gint * unseen,
40                          guint32 * uid_validity);
41 int imap_threaded_examine(Folder * folder, const char * mb,
42                           gint * exists, gint * recent, gint * unseen,
43                           guint32 * uid_validity);
44
45 enum {
46         IMAP_SEARCH_TYPE_SIMPLE,
47         IMAP_SEARCH_TYPE_SEEN,
48         IMAP_SEARCH_TYPE_UNSEEN,
49         IMAP_SEARCH_TYPE_ANSWERED,
50         IMAP_SEARCH_TYPE_FLAGGED,
51 };
52
53 int imap_threaded_search(Folder * folder, int search_type,
54                          struct mailimap_set * set, clist ** result);
55
56 int imap_threaded_fetch_uid(Folder * folder, uint32_t first_index,
57                             carray ** result);
58
59 void imap_fetch_uid_list_free(carray * uid_list);
60
61 int imap_threaded_fetch_content(Folder * folder, uint32_t msg_index,
62                                 int with_body,
63                                 const char * filename);
64
65 struct imap_fetch_env_info {
66         uint32_t uid;
67         char * headers;
68         uint32_t size;
69         int flags;
70 };
71
72 int imap_threaded_fetch_env(Folder * folder, struct mailimap_set * set,
73                             carray ** p_env_list);
74
75 void imap_fetch_env_free(carray * env_list);
76
77 int imap_threaded_append(Folder * folder, const char * mailbox,
78                          const char * filename,
79                          struct mailimap_flag_list * flag_list);
80
81 int imap_threaded_expunge(Folder * folder);
82
83 int imap_threaded_copy(Folder * folder, struct mailimap_set * set,
84                        const char * mb);
85
86 int imap_threaded_store(Folder * folder, struct mailimap_set * set,
87                         struct mailimap_store_att_flags * store_att_flags);
88
89 #endif