summaryrefslogtreecommitdiffstats
path: root/kmail/sievedebugdialog.h
blob: e565cd6ebbe13651b02b664cf92e9dea10089ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
    sievedebugdialog.h

    KMail, the KDE mail client.
    Copyright (c) 2005 Martijn Klingens <[email protected]>

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License,
    version 2.0, as published by the Free Software Foundation.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
*/

#ifndef __sievedebugdialog_h__
#define __sievedebugdialog_h__

// This file is only compiled when debug is enabled, it is
// not useful enough for non-developers to have this in releases.
#if !defined(NDEBUG)

#include <kdialogbase.h>
#include <kurl.h>

class TQString;
class TQStringList;
class TQTextEdit;
template <typename T> class TQValueList;

class KMAccount;

namespace KMime
{
  namespace Types
  {
    struct AddrSpec;
    typedef TQValueList<AddrSpec> AddrSpecList;
  }
}

namespace KMail
{
class ImapAccountBase;
class SieveJob;

/**
 * Diagnostic info for Sieve. Only compiled when debug is enabled, it is
 * not useful enough for non-developers to have this in releases.
 */
class SieveDebugDialog : public KDialogBase
{
    TQ_OBJECT
  

public:
    SieveDebugDialog( TQWidget *parent = 0, const char *name = 0 );
    virtual ~SieveDebugDialog();

protected:
    void handlePutResult( KMail::SieveJob *job, bool success, bool );

signals:
    void result( bool success );

protected slots:
    void slotGetScript( KMail::SieveJob *job, bool success, const TQString &script, bool active );
    void slotGetScriptList( KMail::SieveJob *job, bool success, const TQStringList &scriptList, const TQString &activeScript );

    void slotDialogOk();
    void slotPutActiveResult( KMail::SieveJob*, bool );
    void slotPutInactiveResult( KMail::SieveJob*, bool );
    void slotDiagNextAccount();
    void slotDiagNextScript();

protected:
    KMail::SieveJob *mSieveJob;
    KURL mUrl;

    TQTextEdit *mEdit;

    // Copied from AccountManager, because we have to do an async iteration
    // WARNING: When copy/pasting this code, be aware that accounts may
    //          get removed inbetween! For debugging this is good enough
    //          though. - Martijn
    TQValueList<KMAccount *> mAccountList;
    TQStringList mScriptList;
    KMail::ImapAccountBase *mAccountBase;
};

} // namespace KMail

#endif // NDEBUG

#endif // __sievedebugdialog_h__