sievedebugdialog.h
00001 /* 00002 sievedebugdialog.h 00003 00004 KMail, the KDE mail client. 00005 Copyright (c) 2005 Martijn Klingens <klingens@kde.org> 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License, 00009 version 2.0, as published by the Free Software Foundation. 00010 You should have received a copy of the GNU General Public License 00011 along with this program; if not, write to the Free Software Foundation, 00012 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US 00013 */ 00014 00015 #ifndef __sievedebugdialog_h__ 00016 #define __sievedebugdialog_h__ 00017 00018 // This file is only compiled when debug is enabled, it is 00019 // not useful enough for non-developers to have this in releases. 00020 #if !defined(NDEBUG) 00021 00022 #include <kdialogbase.h> 00023 #include <kurl.h> 00024 00025 class TQString; 00026 class TQStringList; 00027 class TQTextEdit; 00028 template <typename T> class TQValueList; 00029 00030 class KMAccount; 00031 00032 namespace KMime 00033 { 00034 namespace Types 00035 { 00036 struct AddrSpec; 00037 typedef TQValueList<AddrSpec> AddrSpecList; 00038 } 00039 } 00040 00041 namespace KMail 00042 { 00043 class ImapAccountBase; 00044 class SieveJob; 00045 00050 class SieveDebugDialog : public KDialogBase 00051 { 00052 Q_OBJECT 00053 00054 00055 public: 00056 SieveDebugDialog( TQWidget *parent = 0, const char *name = 0 ); 00057 virtual ~SieveDebugDialog(); 00058 00059 protected: 00060 void handlePutResult( KMail::SieveJob *job, bool success, bool ); 00061 00062 signals: 00063 void result( bool success ); 00064 00065 protected slots: 00066 void slotGetScript( KMail::SieveJob *job, bool success, const TQString &script, bool active ); 00067 void slotGetScriptList( KMail::SieveJob *job, bool success, const TQStringList &scriptList, const TQString &activeScript ); 00068 00069 void slotDialogOk(); 00070 void slotPutActiveResult( KMail::SieveJob*, bool ); 00071 void slotPutInactiveResult( KMail::SieveJob*, bool ); 00072 void slotDiagNextAccount(); 00073 void slotDiagNextScript(); 00074 00075 protected: 00076 KMail::SieveJob *mSieveJob; 00077 KURL mUrl; 00078 00079 TQTextEdit *mEdit; 00080 00081 // Copied from AccountManager, because we have to do an async iteration 00082 // WARNING: When copy/pasting this code, be aware that accounts may 00083 // get removed inbetween! For debugging this is good enough 00084 // though. - Martijn 00085 TQValueList<KMAccount *> mAccountList; 00086 TQStringList mScriptList; 00087 KMail::ImapAccountBase *mAccountBase; 00088 }; 00089 00090 } // namespace KMail 00091 00092 #endif // NDEBUG 00093 00094 #endif // __sievedebugdialog_h__ 00095