mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00

geometry may be animated aswell in the future Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
83 lines
2.2 KiB
C++
83 lines
2.2 KiB
C++
/* This file is part of the KDE project
|
|
Copyright (C) 2023 Ivailo Monev <xakepa10@gmail.com>
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Library General Public
|
|
License version 2, as published by the Free Software Foundation.
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
along with this library; see the file COPYING.LIB. If not, write to
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#ifndef JOBSWIDGET_H
|
|
#define JOBSWIDGET_H
|
|
|
|
#include <QMutex>
|
|
#include <QGraphicsWidget>
|
|
#include <QGraphicsLinearLayout>
|
|
#include <Plasma/Label>
|
|
#include <Plasma/Frame>
|
|
#include <Plasma/IconWidget>
|
|
#include <Plasma/Meter>
|
|
#include <Plasma/DataEngine>
|
|
|
|
class NotificationsWidget;
|
|
|
|
class JobFrame : public Plasma::Frame
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit JobFrame(const QString &name, QGraphicsWidget *parent);
|
|
|
|
Plasma::IconWidget* iconwidget;
|
|
Plasma::Label* label;
|
|
Plasma::IconWidget* removewidget;
|
|
Plasma::IconWidget* openwidget;
|
|
Plasma::Meter* meter;
|
|
QString name;
|
|
|
|
void animateRemove();
|
|
private Q_SLOTS:
|
|
void slotAnimationFinished();
|
|
};
|
|
|
|
|
|
class JobsWidget : public QGraphicsWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
JobsWidget(QGraphicsItem *parent, NotificationsWidget *notificationswidget);
|
|
~JobsWidget();
|
|
|
|
int count() const;
|
|
|
|
Q_SIGNALS:
|
|
int countChanged();
|
|
void ping();
|
|
|
|
public Q_SLOTS:
|
|
void slotFrameDestroyed();
|
|
void slotRemoveActivated();
|
|
void slotOpenActivated();
|
|
|
|
private Q_SLOTS:
|
|
void sourceAdded(const QString &name);
|
|
void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data);
|
|
|
|
private:
|
|
QMutex m_mutex;
|
|
NotificationsWidget *m_notificationswidget;
|
|
QGraphicsLinearLayout* m_layout;
|
|
Plasma::Label* m_label;
|
|
QList<JobFrame*> m_frames;
|
|
Plasma::DataEngine *m_dataengine;
|
|
};
|
|
|
|
#endif // JOBSWIDGET_H
|