File indexing completed on 2024-05-19 05:11:51

0001 /*
0002   SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "akonadisearchdebugsearchpathcombobox.h"
0010 #include "search_debug_export.h"
0011 #include <Akonadi/Item>
0012 #include <QDialog>
0013 
0014 namespace Akonadi
0015 {
0016 namespace Search
0017 {
0018 class AkonadiSearchDebugDialogPrivate;
0019 /**
0020  * @brief The AkonadiSearchDebugDialog class
0021  * @author Laurent Montel <montel@kde.org>
0022  */
0023 class AKONADI_SEARCH_DEBUG_EXPORT AkonadiSearchDebugDialog : public QDialog
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit AkonadiSearchDebugDialog(QWidget *parent = nullptr);
0028     ~AkonadiSearchDebugDialog() override;
0029 
0030     void setAkonadiId(Akonadi::Item::Id akonadiId);
0031     void setSearchType(AkonadiSearchDebugSearchPathComboBox::SearchType type);
0032     void doSearch();
0033 private Q_SLOTS:
0034     AKONADI_SEARCH_DEBUG_NO_EXPORT void slotSaveAs();
0035 
0036 private:
0037     AKONADI_SEARCH_DEBUG_NO_EXPORT void readConfig();
0038     AKONADI_SEARCH_DEBUG_NO_EXPORT void writeConfig();
0039     AKONADI_SEARCH_DEBUG_NO_EXPORT void saveTextAs(const QString &text, const QString &filter);
0040     [[nodiscard]] bool saveToFile(const QString &filename, const QString &text);
0041     AkonadiSearchDebugDialogPrivate *const d;
0042 };
0043 }
0044 }