X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fimap.h;h=50569e0cf5fb3f4164db2875b33dcaf70def9d06;hp=8bc2389706de0c7a5c5147700c5750f190e7dfcb;hb=74e15427f6a0e237ff74f2a001ca3c5759bf2320;hpb=036b63d8fc5a8c6e1ff150737226122c174c39cb diff --git a/src/imap.h b/src/imap.h index 8bc238970..50569e0cf 100644 --- a/src/imap.h +++ b/src/imap.h @@ -1,10 +1,10 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999,2000 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team * * 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 + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -13,88 +13,41 @@ * 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. + * along with this program. If not, see . + * */ #ifndef __IMAP_H__ #define __IMAP_H__ -#include - #include "folder.h" -#include "session.h" - -typedef struct _IMAPSession IMAPSession; - -#include "prefs_account.h" - -#define IMAP_SESSION(obj) ((IMAPSession *)obj) - -struct _IMAPSession -{ - Session session; - - gchar *mbox; -}; - -#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) - -Session *imap_session_new (const gchar *server, - gushort port, - const gchar *user, - const gchar *pass); -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, - gint num); - -gint imap_move_msg (Folder *folder, - FolderItem *dest, - MsgInfo *msginfo); - -gint imap_move_msgs_with_dest (Folder *folder, - FolderItem *dest, - GSList *msglist); -gint imap_remove_msg (Folder *folder, - FolderItem *item, - gint num); -gint imap_remove_all_msg (Folder *folder, - FolderItem *item); - -void imap_scan_folder (Folder *folder, - FolderItem *item); - -FolderItem *imap_create_folder (Folder *folder, - FolderItem *parent, - const gchar *name); + IMAP_AUTH_PLAINTEXT = 1 << 0, + IMAP_AUTH_CRAM_MD5 = 1 << 1, + IMAP_AUTH_ANON = 1 << 2, + IMAP_AUTH_GSSAPI = 1 << 3, + IMAP_AUTH_DIGEST_MD5 = 1 << 4, + IMAP_AUTH_SCRAM_SHA1 = 1 << 5, + IMAP_AUTH_PLAIN = 1 << 6, + IMAP_AUTH_LOGIN = 1 << 7 +} IMAPAuthType; + +FolderClass *imap_get_class (void); +guint imap_folder_get_refcnt(Folder *folder); +void imap_folder_ref(Folder *folder); +void imap_folder_unref(Folder *folder); +gchar imap_get_path_separator_for_item (FolderItem *item); +void imap_disconnect_all(gboolean have_connectivity); +gint imap_subscribe(Folder *folder, FolderItem *item, gchar *rpath, gboolean sub); +GList *imap_scan_subtree(Folder *folder, FolderItem *item, gboolean unsubs_only, gboolean recursive); +void imap_cache_msg(FolderItem *item, gint msgnum); + +void imap_cancel_all(void); +gboolean imap_cancel_all_enabled(void); + +char* imap_modified_utf7_to_utf8(const char *mbox, gboolean change_spaces); +char* imap_utf8_to_modified_utf7(const char *src, gboolean change_spaces); #endif /* __IMAP_H__ */