File indexing completed on 2025-03-30 04:54:33

0001 /*
0002   sievedebugdialog.h
0003 
0004   SPDX-FileCopyrightText: 2005 Martijn Klingens <klingens@kde.org>
0005 
0006   SPDX-License-Identifier: GPL-2.0-only
0007 */
0008 
0009 #pragma once
0010 
0011 #include "ksieveui_export.h"
0012 #include <KSieveCore/Util>
0013 
0014 #include <KSyntaxHighlighting/Repository>
0015 #include <QDialog>
0016 #include <QUrl>
0017 
0018 #include <QStringList>
0019 
0020 namespace KManageSieve
0021 {
0022 class SieveJob;
0023 }
0024 namespace TextCustomEditor
0025 {
0026 class PlainTextEditorWidget;
0027 }
0028 namespace KSieveCore
0029 {
0030 class SieveImapPasswordProvider;
0031 }
0032 namespace KSieveUi
0033 {
0034 /**
0035  * Diagnostic info for Sieve. Only compiled when debug is enabled, it is
0036  * not useful enough for non-developers to have this in releases.
0037  */
0038 class KSIEVEUI_EXPORT SieveDebugDialog : public QDialog
0039 {
0040     Q_OBJECT
0041 public:
0042     explicit SieveDebugDialog(KSieveCore::SieveImapPasswordProvider *passwordProvider, QWidget *parent = nullptr);
0043     ~SieveDebugDialog() override;
0044 
0045 private Q_SLOTS:
0046     KSIEVEUI_NO_EXPORT void slotGetScript(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
0047     KSIEVEUI_NO_EXPORT void slotGetScriptList(KManageSieve::SieveJob *job, bool success, const QStringList &scriptList, const QString &activeScript);
0048 
0049     KSIEVEUI_NO_EXPORT void slotDiagNextAccount();
0050     KSIEVEUI_NO_EXPORT void slotDiagNextScript();
0051 
0052     KSIEVEUI_NO_EXPORT void slotShutDownJob();
0053 
0054 private:
0055     KSIEVEUI_NO_EXPORT void slotFindAccountInfoFinished(const KSieveCore::Util::AccountInfo &info);
0056     KSIEVEUI_NO_EXPORT void slotFindAccountInfoForScriptFinished(const KSieveCore::Util::AccountInfo &info);
0057     KSIEVEUI_NO_EXPORT void writeConfig();
0058     KSIEVEUI_NO_EXPORT void readConfig();
0059     KManageSieve::SieveJob *mSieveJob = nullptr;
0060     QUrl mUrl;
0061     KSyntaxHighlighting::Repository mRepo;
0062 
0063     KSieveCore::SieveImapPasswordProvider *const mPasswordProvider;
0064     TextCustomEditor::PlainTextEditorWidget *mEdit = nullptr;
0065     QStringList mResourceIdentifier;
0066     QStringList mScriptList;
0067     QTimer *mShutDownJob = nullptr;
0068 };
0069 }