File indexing completed on 2024-04-28 15:29:04

0001 /*
0002     SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef KNEWSTUFF3_ENTRYDETAILSDIALOG_P_H
0008 #define KNEWSTUFF3_ENTRYDETAILSDIALOG_P_H
0009 
0010 #include "core/entryinternal.h"
0011 #include <QObject>
0012 
0013 #include "ui_downloadwidget.h"
0014 
0015 class QListWidgetItem;
0016 
0017 namespace KNSCore
0018 {
0019 class Engine;
0020 }
0021 
0022 namespace KNS3
0023 {
0024 class EntryDetails : public QObject
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     EntryDetails(KNSCore::Engine *engine, Ui::DownloadWidget *widget);
0030     ~EntryDetails() override;
0031 
0032 public Q_SLOTS:
0033     void setEntry(const KNSCore::EntryInternal &entry);
0034 
0035 private Q_SLOTS:
0036     void slotEntryPreviewLoaded(const KNSCore::EntryInternal &entry, KNSCore::EntryInternal::PreviewType type);
0037     void install();
0038     void installAction(QAction *action);
0039     void uninstall();
0040 
0041     void ratingChanged(int rating);
0042     void becomeFan();
0043     // more details loaded
0044     void entryChanged(const KNSCore::EntryInternal &entry);
0045     // installed/updateable etc
0046     void updateButtons();
0047 
0048     void preview1Selected();
0049     void preview2Selected();
0050     void preview3Selected();
0051 
0052 private:
0053     void init();
0054     void previewSelected(int current);
0055 
0056     KNSCore::Engine *const m_engine;
0057     Ui::DownloadWidget *const ui;
0058     KNSCore::EntryInternal m_entry;
0059     QImage m_currentPreview;
0060     QListWidgetItem *m_previewItem1 = nullptr;
0061     QListWidgetItem *m_previewItem2 = nullptr;
0062     QListWidgetItem *m_previewItem3 = nullptr;
0063 };
0064 
0065 }
0066 
0067 #endif