Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
ActiveSettings.h
1/*
2 * Q3270 Terminal Emulator
3 *
4 * Copyright (c) 2020–2025 Andy Styles
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * This file is part of Q3270.
8 * See the LICENSE file in the project root for full license information.
9 */
10
11#ifndef ACTIVESETTINGS_H
12#define ACTIVESETTINGS_H
13
14#include <QFont>
15#include <QObject>
16
17#include "Q3270.h"
18
19class ActiveSettings : public QObject
20{
21 Q_OBJECT
22
23 public:
24
26
27 QString getHostName() const { return hostName; }
28 int getHostPort() const { return hostPort; }
29 QString getHostLU() const { return hostLU; }
30 QString getHostAddress() const;
31 void setHostAddress(const QString &hostName, int port, const QString &hostLU);
32 void setHostAddress(const QString &address);
33 void applyUserHostChange(const QString &hostName, int port, const QString &hostLU);
34
35 bool getRulerState() const { return rulerState; }
36 void setRulerState(bool rulerOn);
37
38 Q3270::RulerStyle getRulerStyle() const { return ruler; }
39 void setRulerStyle(Q3270::RulerStyle r);
40 QString getRulerStyleName() const;
41 void setRulerStyleName(const QString &s);
42
43 bool getCursorBlink() const { return cursorBlink; }
44 void setCursorBlink(bool blink);
45
46 int getCursorBlinkSpeed() const { return cursorBlinkSpeed; }
47 void setCursorBlinkSpeed(int blinkSpeed);
48
49 bool getCursorColourInherit() const { return cursorColourInherit; }
50 void setCursorColourInherit(bool inherit);
51
52 bool getStretchScreen() const { return stretchScreen; }
53 void setStretchScreen(bool stretch);
54
55 bool getBackspaceStop() const { return backspaceStop; }
56 void setBackspaceStop(bool backspaceStop);
57
58 bool getSecureMode() const { return secureMode; }
59 void setSecureMode(bool secureMode);
60
61 bool getVerifyCerts() const { return verifyCerts; }
62 void setVerifyCerts(bool verifyCerts);
63
64 QFont getFont() const { return termFont; }
65 void setFont(const QFont &font);
66
67 Q3270::FontTweak getTweak() const { return tweaks; }
68 void setTweak(Q3270::FontTweak tweak);
69
70 int getTerminalX() const { return termX; }
71 int getTerminalY() const { return termY; }
72 int getTerminalModel() const { return termModel; }
73 QString getTerminalModelName() const;
74
75 void setTerminal(int x, int y, int model);
76 void setTerminal(int x, int y, const QString &modelName);
77
78 QString getCodePage() const { return codePage; }
79 void setCodePage(const QString &codePage);
80
81 QString getKeyboardThemeName() const { return keyboardThemeName; }
82 void setKeyboardTheme(const QString &keyboardThemeName);
83
84 QString getColourThemeName() const { return colourThemeName; }
85 void setColourTheme(const QString &colourThemeName);
86
87 QString getSessionName() const { return sessionName; }
88 void setSessionName(const QString &name);
89
90 QString getDescription() const { return description; }
91 void setDescription(const QString &description);
92
93 signals:
94
95 void rulerChanged(bool rulerOn);
96 void rulerStyleChanged(Q3270::RulerStyle r);
97
98 void cursorBlinkChanged(bool cursorBlink);
99 void cursorBlinkSpeedChanged(int b);
100
101 void cursorInheritChanged(bool cursorInherit);
102
103 void terminalModelChanged(int x, int y, int model);
104
105 void fontChanged(QFont font);
106 void fontTweakChanged(Q3270::FontTweak t);
107
108 void codePageChanged(QString codepage);
109
110 void keyboardThemeChanged(const QString &keyboardThemeName);
111 void colourThemeChanged(QString colourThemeName);
112
113 void hostChanged(const QString &hostName, const int hostPort, const QString &hostLu);
114
115 void stretchScreenChanged(bool stretchScreen);
116 void backspacesStopChanged(bool backspaceStop);
117 void cursorColourInheritChanged(bool cursorColourInherit);
118 void fontScalingChanged(bool scaling);
119
120 void secureModeChanged(bool secureMode);
121 void verifyCertsChanged(bool verifyCerts);
122
123 void sessionNameChanged(const QString name);
124
125 void descriptionChanged(const QString description);
126
127 private:
128
129// Q_ENUM(RulerStyle);
130
131 QString sessionName;
132 QString description;
133
134 QFont termFont;
135
136 // Terminal characteristics
137 int termX;
138 int termY;
139 int termModel;
140 QString termModelName;
141 QString codePage;
142
143 // Host address parts
144 QString hostName;
145 int hostPort;
146 QString hostLU;
147
148 bool secureMode;
149 bool verifyCerts;
150
151 // Themes
152 QString keyboardThemeName;
153 QString colourThemeName;
154
155 // Terminal behaviours
156 bool stretchScreen; // Whether to stretch the 3270 screen to fit the window
157 bool backspaceStop; // Whether backspace stops at the field start position
158 bool cursorColourInherit; // Whether the cursor colour matches the colour of the character underneath
159
160 bool rulerState; // Whether crosshairs are shown
161 Q3270::RulerStyle ruler; // Type of crosshairs, when shown
162
163 bool cursorBlink; // Whether the cursor blinks
164 int cursorBlinkSpeed; // How fast the cursor blinks
165
166 Q3270::FontTweak tweaks;
167};
168
169#endif // ACTIVESETTINGS_H
Definition ActiveSettings.h:20
void setCursorBlink(bool blink)
ActiveSettings::setCursorBlink.
Definition ActiveSettings.cpp:141
ActiveSettings()
ActiveSettings represents the currently active settings. This is literally just the various flags and...
Definition ActiveSettings.cpp:26
void setHostAddress(const QString &hostName, int port, const QString &hostLU)
ActiveSettings::setHostAddress.
Definition ActiveSettings.cpp:373
void setRulerState(bool rulerOn)
ActiveSettings::setRulerState - hide or display the ruler.
Definition ActiveSettings.cpp:64
void setSessionName(const QString &name)
Sets the session name.
Definition ActiveSettings.cpp:503
void setStretchScreen(bool stretch)
ActiveSettings::setStretchScreen.
Definition ActiveSettings.cpp:455
void setColourTheme(const QString &colourThemeName)
ActiveSettings::setColourTheme.
Definition ActiveSettings.cpp:354
void setCursorBlinkSpeed(int blinkSpeed)
ActiveSettings::setCursorBlinkSpeed.
Definition ActiveSettings.cpp:158
QString getHostAddress() const
ActiveSettings::getHostAddress.
Definition ActiveSettings.cpp:422
void applyUserHostChange(const QString &hostName, int port, const QString &hostLU)
ActiveSettings::applyUserHostChange.
Definition ActiveSettings.cpp:386
void setTerminal(int x, int y, int model)
ActiveSettings::setTerminal.
Definition ActiveSettings.cpp:214
void setKeyboardTheme(const QString &keyboardThemeName)
ActiveSettings::setKeyboardTheme.
Definition ActiveSettings.cpp:338
void setCodePage(const QString &codePage)
ActiveSettings::setCodePage.
Definition ActiveSettings.cpp:321
void setFont(const QFont &font)
ActiveSettings::setFont.
Definition ActiveSettings.cpp:190
void setDescription(const QString &description)
Sets the session description.
Definition ActiveSettings.cpp:519
void setRulerStyleName(const QString &s)
ActiveSettings::setRulerStyleName.
Definition ActiveSettings.cpp:107
void setRulerStyle(Q3270::RulerStyle r)
ActiveSettings::setRulerStyle.
Definition ActiveSettings.cpp:88
void setSecureMode(bool secureMode)
ActiveSettings::setSecureMode.
Definition ActiveSettings.cpp:471
void setCursorColourInherit(bool inherit)
ActiveSettings::setCursorColourInherit.
Definition ActiveSettings.cpp:176
void setVerifyCerts(bool verifyCerts)
ActiveSettings::setVerifyCerts.
Definition ActiveSettings.cpp:487
QString getTerminalModelName() const
ActiveSettings::getTerminalModelName.
Definition ActiveSettings.cpp:298
void setBackspaceStop(bool backspaceStop)
ActiveSettings::setBackspaceStop.
Definition ActiveSettings.cpp:436
QString getRulerStyleName() const
ActiveSettings::getRulerStyleName.
Definition ActiveSettings.cpp:128