aboutsummaryrefslogtreecommitdiff
path: root/libsylph/imap.h
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-05 10:00:53 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-05 10:00:53 +0000
commit3bf24b9336184fe9e28f7e09b9c5200a5f82b7d2 (patch)
tree51ccac6f26dcdf9fcfac1a7879477bfde2759b80 /libsylph/imap.h
parent11776e5a524745b01ac145439ac2892a29bd0826 (diff)
moved more modules to libsylph.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@548 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.h')
-rw-r--r--libsylph/imap.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/libsylph/imap.h b/libsylph/imap.h
new file mode 100644
index 00000000..c726c875
--- /dev/null
+++ b/libsylph/imap.h
@@ -0,0 +1,114 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ *
+ * 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__
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <glib.h>
+#include <time.h>
+
+#include "folder.h"
+#include "session.h"
+#include "procmsg.h"
+
+typedef struct _IMAPFolder IMAPFolder;
+typedef struct _IMAPSession IMAPSession;
+typedef struct _IMAPNameSpace IMAPNameSpace;
+
+#define IMAP_FOLDER(obj) ((IMAPFolder *)obj)
+#define IMAP_SESSION(obj) ((IMAPSession *)obj)
+
+#include "prefs_account.h"
+
+typedef enum
+{
+ IMAP_AUTH_LOGIN = 1 << 0,
+ IMAP_AUTH_CRAM_MD5 = 1 << 1
+} IMAPAuthType;
+
+struct _IMAPFolder
+{
+ RemoteFolder rfolder;
+
+ /* list of IMAPNameSpace */
+ GList *ns_personal;
+ GList *ns_others;
+ GList *ns_shared;
+};
+
+struct _IMAPSession
+{
+ Session session;
+
+ gboolean authenticated;
+
+ gchar **capability;
+ gboolean uidplus;
+
+ gchar *mbox;
+ guint cmd_count;
+};
+
+struct _IMAPNameSpace
+{
+ gchar *name;
+ gchar separator;
+};
+
+#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)
+
+FolderClass *imap_get_class (void);
+
+gint imap_msg_set_perm_flags (MsgInfo *msginfo,
+ MsgPermFlags flags);
+gint imap_msg_unset_perm_flags (MsgInfo *msginfo,
+ MsgPermFlags flags);
+gint imap_msg_list_set_perm_flags (GSList *msglist,
+ MsgPermFlags flags);
+gint imap_msg_list_unset_perm_flags (GSList *msglist,
+ MsgPermFlags flags);
+
+#endif /* __IMAP_H__ */