-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwuake_tab_page.h
83 lines (57 loc) · 1.4 KB
/
wuake_tab_page.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include <QWidget>
#include <QWindow>
#include <QProcess>
#include <QString>
typedef enum {
PAGE_STATE_START,
PAGE_STATE_CLOSE,
PAGE_STATE_ERROR
} WuakePageState;
class WuakeTabPage : public QWidget
{
Q_OBJECT
public:
WuakeTabPage(QWidget* parent = nullptr);
virtual ~WuakeTabPage();
virtual void requestFocus();
virtual void close();
virtual void startProcess();
virtual bool processRunning();
void enableFocus(bool enable);
bool isEnableFocus();
bool isFocused();
signals:
void stateChanged(WuakePageState state);
protected slots:
void onError(QProcess::ProcessError error);
void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onStarted();
protected:
bool event(QEvent *event);
virtual QString className() = 0;
virtual QString titleName() = 0;
protected:
QProcess* mProcess;
private:
HWND mHwnd;
QWindow* mWindow;
QWidget* mWidget;
bool mEnFocus;
};
class MinttyTabPage : public WuakeTabPage
{
public:
MinttyTabPage(QWidget* parent = nullptr);
~MinttyTabPage();
void startProcess();
protected:
QString className();
QString titleName();
private:
void findMintty();
private:
static quint64 sCounter;
static QString sMinttyPath;
QString mTitleName;
};