ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
QTaskBarButton.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009 - 2022 Arzel Jérôme <myst6re@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QObject>
7 #include <QImage>
8 #include <ff7tkqtwidgets_export.h>
9 
10 #if defined(Q_OS_WIN)
11  #include <shobjidl.h>
12  #include <QApplication>
13  #include <QWidget>
14  #define QTASKBAR_WIN
15 #elif defined(Q_OS_DARWIN)
16  #define QTASKBAR_APPLE
17 #endif
18 
19 class FF7TKQTWIDGETS_EXPORT QTaskBarButton : public QObject
20 {
21  Q_OBJECT
22 public:
23  enum State {
24  Invisible, Normal, Indeterminate, Paused, Error
25  };
26 
27  explicit QTaskBarButton(QObject *parent = nullptr);
28  virtual ~QTaskBarButton() override;
29  void setOverlayIcon(const QImage &image = QImage(), const QString &text = QString());
30  void setState(State state);
31  int maximum() const;
32  int minimum() const;
33  State state() const;
34  int value() const;
35 signals:
36  void valueChanged(int value);
37 public slots:
38  void reset();
39  void setMaximum(int maximum);
40  void setMinimum(int minimum);
41  void setRange(int minimum, int maximum);
42  void setValue(int value);
43 private:
44 #ifdef QTASKBAR_WIN
45  WId _winId;
46  ITaskbarList3 *pITask;
47 #endif // Q_OS_WIN
48  int _minimum;
49  int _maximum;
50  int _value;
51  State _state;
52 };
QTaskBarButton::Paused
@ Paused
Definition: QTaskBarButton.h:24
QTaskBarButton
Definition: QTaskBarButton.h:19
QTaskBarButton::State
State
Definition: QTaskBarButton.h:23