Andreas Krennmair:
[apps/madmutt.git] / imap / imap.h
1 /*
2  * Copyright (C) 1996-8 Michael R. Elkins <me@mutt.org>
3  * Copyright (C) 2000-3 Brendan Cully <brendan@kublai.com>
4  * 
5  *     This program is free software; you can redistribute it and/or modify
6  *     it under the terms of the GNU General Public License as published by
7  *     the Free Software Foundation; either version 2 of the License, or
8  *     (at your option) any later version.
9  * 
10  *     This program is distributed in the hope that it will be useful,
11  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *     GNU General Public License for more details.
14  * 
15  *     You should have received a copy of the GNU General Public License
16  *     along with this program; if not, write to the Free Software
17  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
18  */
19
20 #ifndef _IMAP_H
21 #define _IMAP_H 1
22
23 #include "account.h"
24 #include "browser.h"
25 #include "mailbox.h"
26
27 /* -- data structures -- */
28 typedef struct {
29   ACCOUNT account;
30   char *mbox;
31 } IMAP_MBOX;
32
33 /* imap.c */
34 int imap_access (const char *, int);
35 int imap_check_mailbox (CONTEXT * ctx, int *index_hint, int force);
36 int imap_delete_mailbox (CONTEXT * idata, IMAP_MBOX mx);
37 int imap_open_mailbox (CONTEXT * ctx);
38 int imap_open_mailbox_append (CONTEXT * ctx);
39 int imap_sync_mailbox (CONTEXT * ctx, int expunge, int *index_hint);
40 void imap_close_mailbox (CONTEXT * ctx);
41 int imap_buffy_check (char *path);
42 int imap_mailbox_check (char *path, int new);
43 int imap_subscribe (char *path, int subscribe);
44 int imap_complete (char *dest, size_t dlen, char *path);
45
46 void imap_allow_reopen (CONTEXT * ctx);
47 void imap_disallow_reopen (CONTEXT * ctx);
48
49 /* browse.c */
50 int imap_browse (char *path, struct browser_state *state);
51 int imap_mailbox_create (const char *folder);
52 int imap_mailbox_rename (const char *mailbox);
53
54 /* message.c */
55 int imap_append_message (CONTEXT * ctx, MESSAGE * msg);
56 int imap_copy_messages (CONTEXT * ctx, HEADER * h, char *dest, int delete);
57 int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno);
58
59 /* socket.c */
60 void imap_logout_all (void);
61
62 /* util.c */
63 int imap_expand_path (char *path, size_t len);
64 int imap_parse_path (const char *path, IMAP_MBOX * mx);
65 void imap_pretty_mailbox (char *path);
66
67 int imap_wait_keepalive (pid_t pid);
68 void imap_keepalive (void);
69
70 #endif