claws-mail/src/imap.h

135 lines
3.4 KiB
C
Raw Normal View History

2001-04-19 14:21:46 +02:00
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
2001-06-08 12:14:40 +02:00
* Copyright (C) 1999-2001 Hiroyuki Yamamoto
2001-04-19 14:21:46 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __IMAP_H__
#define __IMAP_H__
2001-08-27 15:34:08 +02:00
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
2001-04-19 14:21:46 +02:00
#include <glib.h>
#include "folder.h"
#include "session.h"
typedef struct _IMAPSession IMAPSession;
2001-06-09 12:49:52 +02:00
typedef struct _IMAPNameSpace IMAPNameSpace;
2001-04-19 14:21:46 +02:00
#include "prefs_account.h"
#define IMAP_SESSION(obj) ((IMAPSession *)obj)
struct _IMAPSession
{
Session session;
gchar *mbox;
};
2001-06-09 12:49:52 +02:00
struct _IMAPNameSpace
{
gchar *name;
gchar separator;
};
2001-04-19 14:21:46 +02:00
#define IMAP_SUCCESS 0
#define IMAP_SOCKET 2
#define IMAP_AUTHFAIL 3
#define IMAP_PROTOCOL 4
#define IMAP_SYNTAX 5
#define IMAP_IOERR 6
#define IMAP_ERROR 7
#define IMAPBUFSIZE 8192
typedef enum
{
IMAP_FLAG_SEEN = 1 << 0,
IMAP_FLAG_ANSWERED = 1 << 1,
IMAP_FLAG_FLAGGED = 1 << 2,
IMAP_FLAG_DELETED = 1 << 3,
IMAP_FLAG_DRAFT = 1 << 4
} IMAPFlags;
#define IMAP_IS_SEEN(flags) ((flags & IMAP_FLAG_SEEN) != 0)
#define IMAP_IS_ANSWERED(flags) ((flags & IMAP_FLAG_ANSWERED) != 0)
#define IMAP_IS_FLAGGED(flags) ((flags & IMAP_FLAG_FLAGGED) != 0)
#define IMAP_IS_DELETED(flags) ((flags & IMAP_FLAG_DELETED) != 0)
#define IMAP_IS_DRAFT(flags) ((flags & IMAP_FLAG_DRAFT) != 0)
2001-08-27 15:34:08 +02:00
#if USE_SSL
2001-04-19 14:21:46 +02:00
Session *imap_session_new (const gchar *server,
gushort port,
const gchar *user,
2001-08-27 15:34:08 +02:00
const gchar *pass,
gboolean use_ssl);
#else
Session *imap_session_new (const gchar *server,
gushort port,
const gchar *user,
2001-08-27 15:34:08 +02:00
const gchar *pass);
#endif
2001-04-19 14:21:46 +02:00
void imap_session_destroy (IMAPSession *session);
void imap_session_destroy_all (void);
GSList *imap_get_msg_list (Folder *folder,
FolderItem *item,
gboolean use_cache);
gchar *imap_fetch_msg (Folder *folder,
FolderItem *item,
2001-06-20 21:10:41 +02:00
gint uid);
2001-06-08 12:14:40 +02:00
gint imap_add_msg (Folder *folder,
FolderItem *dest,
const gchar *file,
gboolean remove_source);
2001-04-19 14:21:46 +02:00
gint imap_move_msg (Folder *folder,
2001-04-27 22:27:24 +02:00
FolderItem *dest,
MsgInfo *msginfo);
gint imap_move_msgs_with_dest (Folder *folder,
FolderItem *dest,
GSList *msglist);
2001-06-08 12:14:40 +02:00
gint imap_copy_msg (Folder *folder,
FolderItem *dest,
MsgInfo *msginfo);
gint imap_copy_msgs_with_dest (Folder *folder,
FolderItem *dest,
GSList *msglist);
2001-04-19 14:21:46 +02:00
gint imap_remove_msg (Folder *folder,
FolderItem *item,
2001-06-20 21:10:41 +02:00
gint uid);
2001-04-19 14:21:46 +02:00
gint imap_remove_all_msg (Folder *folder,
FolderItem *item);
void imap_scan_folder (Folder *folder,
FolderItem *item);
2001-06-28 10:44:31 +02:00
void imap_scan_tree (Folder *folder);
2001-04-19 14:21:46 +02:00
2001-06-15 12:29:27 +02:00
gint imap_create_tree (Folder *folder);
2001-04-19 14:21:46 +02:00
FolderItem *imap_create_folder (Folder *folder,
FolderItem *parent,
const gchar *name);
2001-05-01 20:35:02 +02:00
gint imap_remove_folder (Folder *folder,
FolderItem *item);
2001-04-19 14:21:46 +02:00
#endif /* __IMAP_H__ */