kmail

sievedebugdialog.h

Go to the documentation of this file.
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 QString;
00026 class QStringList;
00027 class QTextEdit;
00028 template <typename T> class QValueList;
00029 
00030 class KMAccount;
00031 
00032 namespace KMime
00033 {
00034   namespace Types
00035   {
00036     struct AddrSpec;
00037     typedef QValueList<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 public:
00055     SieveDebugDialog( QWidget *parent = 0, const char *name = 0 );
00056     virtual ~SieveDebugDialog();
00057 
00058 protected:
00059     void handlePutResult( KMail::SieveJob *job, bool success, bool );
00060 
00061 signals:
00062     void result( bool success );
00063 
00064 protected slots:
00065     void slotGetScript( KMail::SieveJob *job, bool success, const QString &script, bool active );
00066     void slotGetScriptList( KMail::SieveJob *job, bool success, const QStringList &scriptList, const QString &activeScript );
00067 
00068     void slotDialogOk();
00069     void slotPutActiveResult( KMail::SieveJob*, bool );
00070     void slotPutInactiveResult( KMail::SieveJob*, bool );
00071     void slotDiagNextAccount();
00072     void slotDiagNextScript();
00073 
00074 protected:
00075     KMail::SieveJob *mSieveJob;
00076     KURL mUrl;
00077 
00078     QTextEdit *mEdit;
00079 
00080     // Copied from AccountManager, because we have to do an async iteration
00081     // WARNING: When copy/pasting this code, be aware that accounts may
00082     //          get removed inbetween! For debugging this is good enough
00083     //          though. - Martijn
00084     QValueList<KMAccount *> mAccountList;
00085     QStringList mScriptList;
00086     KMail::ImapAccountBase *mAccountBase;
00087 };
00088 
00089 } // namespace KMail
00090 
00091 #endif // NDEBUG
00092 
00093 #endif // __sievedebugdialog_h__
00094