This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
forked from Skycoder42/QTaskbarControl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
qtaskbarcontrol.h
61 lines (49 loc) · 1.67 KB
/
qtaskbarcontrol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef QTASKBARCONTROL_H
#define QTASKBARCONTROL_H
#include <QPointer>
#include <QScopedPointer>
class QWindow;
class QTaskbarControlPrivate;
class Q_TASKBAR_CONTROL_EXPORT QTaskbarControl : public QObject
{
Q_OBJECT
Q_PROPERTY(bool progressVisible READ progressVisible WRITE setProgressVisible NOTIFY progressVisibleChanged)
Q_PROPERTY(double progress READ progress WRITE setProgress NOTIFY progressChanged)
Q_PROPERTY(bool counterVisible READ counterVisible WRITE setCounterVisible NOTIFY counterVisibleChanged)
Q_PROPERTY(int counter READ counter WRITE setCounter NOTIFY counterChanged)
public:
enum WinProgressState {
Running,
Paused,
Stopped
};
Q_ENUM(WinProgressState)
explicit QTaskbarControl(QObject *parent);
~QTaskbarControl() override;
void setWidget(QWidget *widget);
void setWindow(QWindow *window);
WinProgressState windowsProgressState() const;
QIcon windowsBadgeIcon() const;
QColor windowsBadgeTextColor() const;
bool progressVisible() const;
double progress() const;
bool counterVisible() const;
int counter() const;
public slots:
void setWindowsProgressState(QTaskbarControl::WinProgressState state);
void setWindowsBadgeIcon(const QIcon &icon);
void setWindowsBadgeTextColor(const QColor &color);
void setProgressVisible(bool visible);
void setProgress(double value);
void setCounterVisible(bool visible);
void setCounter(int value);
signals:
void progressVisibleChanged(bool visible);
void progressChanged(double value);
void counterVisibleChanged(bool visible);
void counterChanged(int value);
private:
QScopedPointer<QTaskbarControlPrivate> d;
bool eventFilter(QObject *watched, QEvent *event) override;
};
#endif // QTASKBARCONTROL_H