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

0001 /*
0002     This file is part of KNewStuff2.
0003     SPDX-FileCopyrightText: 2007 Josef Spillner <spillner@kde.org>
0004     SPDX-FileCopyrightText: 2008 Jeremy Whiting <jpwhiting@kde.org>
0005     SPDX-FileCopyrightText: 2009-2010 Frederik Gladhorn <gladhorn@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.1-or-later
0008 */
0009 
0010 #ifndef KNEWSTUFF3_PROGRESSINDICATOR_P_H
0011 #define KNEWSTUFF3_PROGRESSINDICATOR_P_H
0012 
0013 #include "errorcode.h"
0014 
0015 #include <KPixmapSequence>
0016 #include <QFrame>
0017 
0018 class QLabel;
0019 class QString;
0020 class KPixmapSequenceWidget;
0021 
0022 namespace KNS3
0023 {
0024 /**
0025  * Embedded progress indicator for the download dialog.
0026  *
0027  * The indicator can display various asynchronous operations at once.
0028  * Each operation can also individually be cancelled.
0029  *
0030  * @internal
0031  */
0032 class ProgressIndicator : public QFrame
0033 {
0034     Q_OBJECT
0035 public:
0036     explicit ProgressIndicator(QWidget *parent);
0037 
0038 public Q_SLOTS:
0039     void busy(const QString &message);
0040     void error(const KNSCore::ErrorCode &errorCode, const QString &message, const QVariant &metadata);
0041     void idle(const QString &message);
0042 
0043 private:
0044     QLabel *m_statusLabel = nullptr;
0045     KPixmapSequenceWidget *busyWidget = nullptr;
0046 
0047     const KPixmapSequence m_busyPixmap;
0048     const KPixmapSequence m_errorPixmap;
0049 };
0050 }
0051 
0052 #endif