kmail

mailinglist-magic.h
1 // -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 #ifndef MAILINGLIST_MAGIC_H
3 #define MAILINGLIST_MAGIC_H
4 
5 #include <kurl.h>
6 #include <tqstring.h>
7 
8 class KMMessage;
9 class TDEConfig;
10 
11 namespace KMail
12 {
13 
24 {
25 public:
26  enum Handler {
27  KMail,
28  Browser
29  };
30 
31  enum Supports {
32  None = 0 << 0,
33  Post = 1 << 0,
34  Subscribe = 1 << 1,
35  Unsubscribe = 1 << 2,
36  Help = 1 << 3,
37  Archive = 1 << 4,
38  Id = 1 << 5
39  };
40 public:
41  static MailingList detect( const KMMessage* msg );
42  static TQString name( const KMMessage *message, TQCString &header_name,
43  TQString &header_value );
44 public:
45  MailingList();
46 
47  int features() const;
48 
49  void setHandler( Handler han );
50  Handler handler() const;
51 
52  void setPostURLS ( const KURL::List& );
53  KURL::List postURLS() const;
54 
55  void setSubscribeURLS( const KURL::List& );
56  KURL::List subscribeURLS() const;
57 
58  void setUnsubscribeURLS ( const KURL::List& );
59  KURL::List unsubscribeURLS() const;
60 
61  void setHelpURLS( const KURL::List& );
62  KURL::List helpURLS() const;
63 
64  void setArchiveURLS( const KURL::List& );
65  KURL::List archiveURLS() const;
66 
67  void setId( const TQString& );
68  TQString id() const;
69 
70  void writeConfig( TDEConfig* config ) const;
71  void readConfig( TDEConfig* config );
72 private:
73  int mFeatures;
74  Handler mHandler;
75  KURL::List mPostURLS;
76  KURL::List mSubscribeURLS;
77  KURL::List mUnsubscribeURLS;
78  KURL::List mHelpURLS;
79  KURL::List mArchiveURLS;
80  TQString mId;
81 };
82 
83 }
84 
85 #endif