File indexing completed on 2025-01-19 04:51:22

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Akonadi/Item>
0010 #include <QDialog>
0011 class QListWidget;
0012 class KNote;
0013 class KNotePrintObject;
0014 class KNotePrintSelectThemeComboBox;
0015 class QDialogButtonBox;
0016 class QPushButton;
0017 class KNotePrintSelectedNotesDialog : public QDialog
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit KNotePrintSelectedNotesDialog(QWidget *parent = nullptr);
0022     ~KNotePrintSelectedNotesDialog() override;
0023 
0024     void setNotes(const QHash<Akonadi::Item::Id, KNote *> &notes);
0025 
0026     [[nodiscard]] QList<KNotePrintObject *> selectedNotes() const;
0027     [[nodiscard]] QString selectedTheme() const;
0028 
0029     [[nodiscard]] bool preview() const;
0030 
0031 private Q_SLOTS:
0032     void slotPreview();
0033     void slotSelectionChanged();
0034 
0035 private:
0036     enum listViewData { AkonadiId = Qt::UserRole + 1 };
0037 
0038     void writeConfig();
0039     void readConfig();
0040     QListWidget *const mListNotes;
0041     QHash<Akonadi::Item::Id, KNote *> mNotes;
0042     KNotePrintSelectThemeComboBox *mTheme = nullptr;
0043     QDialogButtonBox *mButtonBox = nullptr;
0044     QPushButton *mUser1Button = nullptr;
0045     bool mPreview = false;
0046 };