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