Skip to content

Latest commit

 

History

History
153 lines (119 loc) · 4.63 KB

util.h

File metadata and controls

153 lines (119 loc) · 4.63 KB
 
Feb 20, 2013
Feb 20, 2013
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
/*
Copyright 2011-2012 Heikki Holstila <heikki.holstila@gmail.com>
This file is part of FingerTerm.
FingerTerm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FingerTerm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FingerTerm. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTIL_H
#define UTIL_H
#include <QtCore>
class Terminal;
class TextRender;
Jul 22, 2013
Jul 22, 2013
27
class QQuickView;
Feb 20, 2013
Feb 20, 2013
28
29
30
31
class Util : public QObject
{
Q_OBJECT
Jun 8, 2016
Jun 8, 2016
32
Q_PROPERTY(QString windowTitle READ windowTitle NOTIFY windowTitleChanged)
Jun 27, 2016
Jun 27, 2016
33
Q_PROPERTY(int windowOrientation READ windowOrientation WRITE setWindowOrientation NOTIFY windowOrientationChanged)
Jun 8, 2016
Jun 8, 2016
34
35
Q_PROPERTY(bool canPaste READ canPaste NOTIFY clipboardOrSelectionChanged)
Q_PROPERTY(bool terminalHasSelection READ terminalHasSelection NOTIFY clipboardOrSelectionChanged)
Jun 27, 2016
Jun 27, 2016
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Q_PROPERTY(QString fontFamily READ fontFamily CONSTANT)
Q_PROPERTY(int uiFontSize READ uiFontSize CONSTANT)
Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
Q_PROPERTY(int dragMode READ dragMode WRITE setDragMode NOTIFY dragModeChanged)
Q_PROPERTY(int keyboardMode READ keyboardMode WRITE setKeyboardMode NOTIFY keyboardModeChanged)
Q_PROPERTY(int keyboardFadeOutDelay READ keyboardFadeOutDelay WRITE setKeyboardFadeOutDelay NOTIFY keyboardFadeOutDelayChanged)
Q_PROPERTY(QString keyboardLayout READ keyboardLayout WRITE setKeyboardLayout NOTIFY keyboardLayoutChanged)
Q_PROPERTY(int extraLinesFromCursor READ extraLinesFromCursor CONSTANT)
Q_PROPERTY(QString charset READ charset CONSTANT)
Q_PROPERTY(int keyboardMargins READ keyboardMargins CONSTANT)
Q_PROPERTY(int orientationMode READ orientationMode WRITE setOrientationMode NOTIFY orientationModeChanged)
Q_PROPERTY(bool showWelcomeScreen READ showWelcomeScreen WRITE setShowWelcomeScreen NOTIFY showWelcomeScreenChanged)
Q_ENUMS(KeyboardMode)
Q_ENUMS(DragMode)
Q_ENUMS(OrientationMode)
May 4, 2016
May 4, 2016
51
Feb 20, 2013
Feb 20, 2013
52
public:
Jun 27, 2016
Jun 27, 2016
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
enum KeyboardMode {
KeyboardOff,
KeyboardFade,
KeyboardMove
};
enum DragMode {
DragOff,
DragGestures,
DragScroll,
DragSelect
};
enum OrientationMode {
OrientationAuto,
OrientationLandscape,
OrientationPortrait
};
Feb 20, 2013
Feb 20, 2013
72
73
explicit Util(QSettings* settings, QObject *parent = 0);
virtual ~Util();
May 4, 2016
May 4, 2016
74
Jul 22, 2013
Jul 22, 2013
75
void setWindow(QQuickView* win);
Feb 20, 2013
Feb 20, 2013
76
void setWindowTitle(QString title);
Jun 8, 2016
Jun 8, 2016
77
QString windowTitle();
Jun 27, 2016
Jun 27, 2016
78
79
int windowOrientation();
void setWindowOrientation(int orientation);
Jun 8, 2016
Jun 8, 2016
80
void setTerm(Terminal* term);
Feb 20, 2013
Feb 20, 2013
81
82
83
84
85
Q_INVOKABLE void openNewWindow();
Q_INVOKABLE QString versionString();
Q_INVOKABLE QString configPath();
Jun 27, 2016
Jun 27, 2016
86
QVariant settingsValue(QString key, const QVariant &defaultValue = QVariant());
Jun 27, 2016
Jun 27, 2016
87
void setSettingsValue(QString key, QVariant value);
Feb 20, 2013
Feb 20, 2013
88
Jun 27, 2016
Jun 27, 2016
89
90
91
92
int uiFontSize();
int fontSize();
void setFontSize(int size);
Feb 20, 2013
Feb 20, 2013
93
94
95
96
97
98
Q_INVOKABLE void keyPressFeedback();
Q_INVOKABLE void keyReleaseFeedback();
Q_INVOKABLE void notifyText(QString text);
Q_INVOKABLE void copyTextToClipboard(QString str);
Jun 8, 2016
Jun 8, 2016
99
100
101
bool canPaste();
bool terminalHasSelection();
Feb 20, 2013
Feb 20, 2013
102
103
104
void bellAlert();
Jun 27, 2016
Jun 27, 2016
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
QString fontFamily();
int dragMode();
void setDragMode(int mode);
int keyboardMode();
void setKeyboardMode(int mode);
int keyboardFadeOutDelay();
void setKeyboardFadeOutDelay(int delay);
QString keyboardLayout();
void setKeyboardLayout(const QString &layout);
int extraLinesFromCursor();
QString charset();
int keyboardMargins();
int orientationMode();
void setOrientationMode(int mode);
bool showWelcomeScreen();
void setShowWelcomeScreen(bool value);
Feb 20, 2013
Feb 20, 2013
129
130
signals:
void visualBell();
Jun 8, 2016
Jun 8, 2016
131
void notify(QString msg);
Feb 20, 2013
Feb 20, 2013
132
133
void clipboardOrSelectionChanged();
void windowTitleChanged();
Jun 27, 2016
Jun 27, 2016
134
void windowOrientationChanged();
Jun 27, 2016
Jun 27, 2016
135
136
137
138
139
140
141
void fontSizeChanged();
void dragModeChanged();
void keyboardModeChanged();
void keyboardFadeOutDelayChanged();
void keyboardLayoutChanged();
void orientationModeChanged();
void showWelcomeScreenChanged();
Feb 20, 2013
Feb 20, 2013
142
143
144
145
146
147
148
private:
Q_DISABLE_COPY(Util)
QString iCurrentWinTitle;
QSettings* iSettings;
May 4, 2016
May 4, 2016
149
QQuickView* iWindow;
Feb 20, 2013
Feb 20, 2013
150
151
152
153
Terminal* iTerm;
};
#endif // UTIL_H