summaryrefslogtreecommitdiffstats
path: root/kmail/mailinglist-magic.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmail/mailinglist-magic.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/mailinglist-magic.h')
-rw-r--r--kmail/mailinglist-magic.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/kmail/mailinglist-magic.h b/kmail/mailinglist-magic.h
new file mode 100644
index 000000000..8c30c20eb
--- /dev/null
+++ b/kmail/mailinglist-magic.h
@@ -0,0 +1,85 @@
+// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
+#ifndef MAILINGLIST_MAGIC_H
+#define MAILINGLIST_MAGIC_H
+
+#include <kurl.h>
+#include <qstring.h>
+
+class KMMessage;
+class KConfig;
+
+namespace KMail
+{
+
+/**
+ * Class is used for all Mailing List handling inside
+ * KMail. The static detect method is used to detect
+ * a full set of ml informations from a message. The
+ * features() method defines which addresses the mailing
+ * has defined.
+ *
+ * @author Zack Rusin <zack@kde.org>
+ */
+class MailingList
+{
+public:
+ enum Handler {
+ KMail,
+ Browser
+ };
+
+ enum Supports {
+ None = 0 << 0,
+ Post = 1 << 0,
+ Subscribe = 1 << 1,
+ Unsubscribe = 1 << 2,
+ Help = 1 << 3,
+ Archive = 1 << 4,
+ Id = 1 << 5
+ };
+public:
+ static MailingList detect( const KMMessage* msg );
+ static QString name( const KMMessage *message, QCString &header_name,
+ QString &header_value );
+public:
+ MailingList();
+
+ int features() const;
+
+ void setHandler( Handler han );
+ Handler handler() const;
+
+ void setPostURLS ( const KURL::List& );
+ KURL::List postURLS() const;
+
+ void setSubscribeURLS( const KURL::List& );
+ KURL::List subscribeURLS() const;
+
+ void setUnsubscribeURLS ( const KURL::List& );
+ KURL::List unsubscribeURLS() const;
+
+ void setHelpURLS( const KURL::List& );
+ KURL::List helpURLS() const;
+
+ void setArchiveURLS( const KURL::List& );
+ KURL::List archiveURLS() const;
+
+ void setId( const QString& );
+ QString id() const;
+
+ void writeConfig( KConfig* config ) const;
+ void readConfig( KConfig* config );
+private:
+ int mFeatures;
+ Handler mHandler;
+ KURL::List mPostURLS;
+ KURL::List mSubscribeURLS;
+ KURL::List mUnsubscribeURLS;
+ KURL::List mHelpURLS;
+ KURL::List mArchiveURLS;
+ QString mId;
+};
+
+}
+
+#endif