-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.h
37 lines (31 loc) · 1.03 KB
/
helper.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
#ifndef HELPER_H
#define HELPER_H
#include <QObject>
#include <QRect>
#include <QSettings>
#include <windows.h>
#define POWERPAD_STRINGIFY(s) POWERPAD_STRINGIFY2(s)
#define POWERPAD_STRINGIFY2(s) #s
class Helper : public QObject
{
Q_OBJECT
protected:
QSettings m_winSystemSoundSettings;
HWND m_foregroundWindow;
private:
explicit Helper(QObject *parent = nullptr);
public:
static Helper* instance();
Q_INVOKABLE void restartApp();
Q_INVOKABLE QRect computeBestWindowRect(const QString &screenName, const QRect &r,
qint32 windowWidth, qint32 windowHeight,
qint32 hMargin = 0, qint32 vMargin = 0);
Q_INVOKABLE QString getAboutText();
Q_INVOKABLE QString getDeviceConnectSoundFilename();
Q_INVOKABLE QString getDeviceDisconnectSoundFilename();
Q_INVOKABLE void saveForegroundWindow();
Q_INVOKABLE void restoreForegroundWindow();
private slots:
void logicalDotsPerInchChanged(qreal dpi);
};
#endif // HELPER_H