mirror of
https://github.com/ModOrganizer2/modorganizer-uibase.git
synced 2026-07-27 14:03:49 -07:00
* Add proper CMake packaging for UIBase. * Add alias mo2::uibase target for uibase. * Add a few string methods to remove boost dependencies.
51 lines
825 B
C++
51 lines
825 B
C++
#ifndef TASKPROGRESSMANAGER_H
|
|
#define TASKPROGRESSMANAGER_H
|
|
|
|
#include "dllimport.h"
|
|
#include <QMutexLocker>
|
|
#include <QObject>
|
|
#include <QTime>
|
|
#include <QTimer>
|
|
#include <Windows.h>
|
|
#include <map>
|
|
#include <shobjidl.h>
|
|
|
|
namespace MOBase
|
|
{
|
|
|
|
class QDLLEXPORT TaskProgressManager : QObject
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static TaskProgressManager& instance();
|
|
|
|
void forgetMe(quint32 id);
|
|
void updateProgress(quint32 id, qint64 value, qint64 max);
|
|
|
|
quint32 getId();
|
|
|
|
public slots:
|
|
bool tryCreateTaskbar();
|
|
|
|
private:
|
|
TaskProgressManager();
|
|
void showProgress();
|
|
|
|
private:
|
|
std::map<quint32, std::pair<QTime, qint64>> m_Percentages;
|
|
QMutex m_Mutex;
|
|
quint32 m_NextId;
|
|
QTimer m_CreateTimer;
|
|
int m_CreateTries;
|
|
|
|
HWND m_WinId;
|
|
|
|
ITaskbarList3* m_Taskbar;
|
|
};
|
|
|
|
} // namespace MOBase
|
|
|
|
#endif // TASKPROGRESSMANAGER_H
|