00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __KMAIL_VACATION_H__
00016 #define __KMAIL_VACATION_H__
00017
00018 #include <tqobject.h>
00019
00020 #include <kurl.h>
00021
00022 class TQString;
00023 class TQStringList;
00024 template <typename T> class TQValueList;
00025 namespace KMail {
00026 class SieveJob;
00027 class VacationDialog;
00028 }
00029 namespace KMime {
00030 namespace Types {
00031 struct AddrSpec;
00032 typedef TQValueList<AddrSpec> AddrSpecList;
00033 }
00034 }
00035
00036 namespace KMail {
00037
00038 class Vacation : public TQObject {
00039 Q_OBJECT
00040
00041 public:
00042 Vacation( TQObject * parent=0, bool checkOnly = false, const char * name=0 );
00043 virtual ~Vacation();
00044
00045 bool isUsable() const { return !mUrl.isEmpty(); }
00046
00047 static TQString defaultMessageText();
00048 static int defaultNotificationInterval();
00049 static TQStringList defaultMailAliases();
00050 static bool defaultSendForSpam();
00051 static TQString defaultDomainName();
00052
00053 protected:
00054 static TQString composeScript( const TQString & messageText,
00055 int notificationInterval,
00056 const KMime::Types::AddrSpecList & aliases,
00057 bool sendForSpam, const TQString & excludeDomain );
00058 static bool parseScript( const TQString & script, TQString & messageText,
00059 int & notificationInterval, TQStringList & aliases,
00060 bool & sendForSpam, TQString & domainName );
00061 KURL findURL() const;
00062 void handlePutResult( KMail::SieveJob * job, bool success, bool );
00063
00064
00065 signals:
00066 void result( bool success );
00067
00068 void scriptActive( bool active );
00069
00070 protected slots:
00071 void slotDialogDefaults();
00072 void slotGetResult( KMail::SieveJob * job, bool success,
00073 const TQString & script, bool active );
00074 void slotDialogOk();
00075 void slotDialogCancel();
00076 void slotPutActiveResult( KMail::SieveJob *, bool );
00077 void slotPutInactiveResult( KMail::SieveJob *, bool );
00078 protected:
00079
00080 KMail::SieveJob * mSieveJob;
00081 KURL mUrl;
00082
00083 KMail::VacationDialog * mDialog;
00084 bool mWasActive;
00085 bool mCheckOnly;
00086 };
00087
00088 }
00089
00090 #endif // __KMAIL_VACATION_H__