kmail
mailinglist-magic.h
Go to the documentation of this file.00001 // -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 #ifndef MAILINGLIST_MAGIC_H 00003 #define MAILINGLIST_MAGIC_H 00004 00005 #include <kurl.h> 00006 #include <qstring.h> 00007 00008 class KMMessage; 00009 class KConfig; 00010 00011 namespace KMail 00012 { 00013 00023 class MailingList 00024 { 00025 public: 00026 enum Handler { 00027 KMail, 00028 Browser 00029 }; 00030 00031 enum Supports { 00032 None = 0 << 0, 00033 Post = 1 << 0, 00034 Subscribe = 1 << 1, 00035 Unsubscribe = 1 << 2, 00036 Help = 1 << 3, 00037 Archive = 1 << 4, 00038 Id = 1 << 5 00039 }; 00040 public: 00041 static MailingList detect( const KMMessage* msg ); 00042 static QString name( const KMMessage *message, QCString &header_name, 00043 QString &header_value ); 00044 public: 00045 MailingList(); 00046 00047 int features() const; 00048 00049 void setHandler( Handler han ); 00050 Handler handler() const; 00051 00052 void setPostURLS ( const KURL::List& ); 00053 KURL::List postURLS() const; 00054 00055 void setSubscribeURLS( const KURL::List& ); 00056 KURL::List subscribeURLS() const; 00057 00058 void setUnsubscribeURLS ( const KURL::List& ); 00059 KURL::List unsubscribeURLS() const; 00060 00061 void setHelpURLS( const KURL::List& ); 00062 KURL::List helpURLS() const; 00063 00064 void setArchiveURLS( const KURL::List& ); 00065 KURL::List archiveURLS() const; 00066 00067 void setId( const QString& ); 00068 QString id() const; 00069 00070 void writeConfig( KConfig* config ) const; 00071 void readConfig( KConfig* config ); 00072 private: 00073 int mFeatures; 00074 Handler mHandler; 00075 KURL::List mPostURLS; 00076 KURL::List mSubscribeURLS; 00077 KURL::List mUnsubscribeURLS; 00078 KURL::List mHelpURLS; 00079 KURL::List mArchiveURLS; 00080 QString mId; 00081 }; 00082 00083 } 00084 00085 #endif