446 |
andreas |
1 |
/*
|
|
|
2 |
* Copyright (C) 2022 by Andreas Theofilu <andreas@theosys.at>
|
|
|
3 |
*
|
|
|
4 |
* This program is free software; you can redistribute it and/or modify
|
|
|
5 |
* it under the terms of the GNU General Public License as published by
|
|
|
6 |
* the Free Software Foundation; either version 3 of the License, or
|
|
|
7 |
* (at your option) any later version.
|
|
|
8 |
*
|
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
* GNU General Public License for more details.
|
|
|
13 |
*
|
|
|
14 |
* You should have received a copy of the GNU General Public License
|
|
|
15 |
* along with this program; if not, write to the Free Software Foundation,
|
|
|
16 |
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
#ifndef QASETTINGS_H
|
|
|
20 |
#define QASETTINGS_H
|
|
|
21 |
|
|
|
22 |
#include <string>
|
|
|
23 |
|
|
|
24 |
class QString;
|
|
|
25 |
class QMargins;
|
|
|
26 |
|
|
|
27 |
class QASettings
|
|
|
28 |
{
|
|
|
29 |
public:
|
|
|
30 |
QASettings();
|
|
|
31 |
~QASettings();
|
|
|
32 |
|
|
|
33 |
// register default preferences from plist file
|
|
|
34 |
void registerDefaultPrefs(void);
|
|
|
35 |
void unregisterPrefs(void);
|
|
|
36 |
|
|
|
37 |
// Settings for NetLinx
|
|
|
38 |
QString getNetlinxIP(void);
|
|
|
39 |
int getNetlinxPort(void);
|
|
|
40 |
int getNetlinxChannel(void);
|
|
|
41 |
QString getNetlinxPanelType(void);
|
|
|
42 |
QString getFTPUser(void);
|
|
|
43 |
QString getFTPPassword(void);
|
|
|
44 |
bool getFTPPassive(void);
|
|
|
45 |
QString getNetlinxSurface(void);
|
|
|
46 |
|
|
|
47 |
// Settings for SIP
|
|
|
48 |
QString getSipProxy(void);
|
|
|
49 |
int getSipNetworkPort(void);
|
|
|
50 |
int getSipNetworkTlsPort(void);
|
|
|
51 |
QString getSipStun(void);
|
|
|
52 |
QString getSipDomain(void);
|
|
|
53 |
QString getSipUser(void);
|
|
|
54 |
QString getSipPassword(void);
|
|
|
55 |
bool getSipNetworkIpv4(void);
|
|
|
56 |
bool getSipNetworkIpv6(void);
|
|
|
57 |
bool getSipEnabled(void);
|
|
|
58 |
bool getSipIntegratedPhone(void);
|
|
|
59 |
|
|
|
60 |
// Settings for View
|
|
|
61 |
bool getViewScale(void);
|
|
|
62 |
bool getViewToolbarVisible(void);
|
|
|
63 |
bool getViewToolbarForce(void);
|
|
|
64 |
bool getViewRotation(void);
|
|
|
65 |
|
|
|
66 |
// Settings for sound
|
|
|
67 |
QString getSoundSystem(void);
|
|
|
68 |
QString getSoundSingleBeep(void);
|
|
|
69 |
QString getSoundDoubleBeep(void);
|
|
|
70 |
bool getSoundEnabled(void);
|
|
|
71 |
int getSoundVolume(void);
|
|
|
72 |
int getSoundGain(void);
|
|
|
73 |
|
|
|
74 |
// Settings for logging
|
|
|
75 |
bool getLoggingInfo(void);
|
|
|
76 |
bool getLoggingWarning(void);
|
|
|
77 |
bool getLoggingError(void);
|
|
|
78 |
bool getLoggingTrace(void);
|
|
|
79 |
bool getLoggingDebug(void);
|
|
|
80 |
bool getLoggingProfile(void);
|
|
|
81 |
bool getLoggingLogFormat(void);
|
|
|
82 |
bool getLoggingLogfileEnabled(void);
|
|
|
83 |
QString getLoggingLogfile(void);
|
|
|
84 |
|
|
|
85 |
// Settings for passwords
|
|
|
86 |
QString getPassword1(void);
|
|
|
87 |
QString getPassword2(void);
|
|
|
88 |
QString getPassword3(void);
|
|
|
89 |
QString getPassword4(void);
|
|
|
90 |
|
|
|
91 |
// Some static methods
|
|
|
92 |
static QString getLibraryPath(void);
|
|
|
93 |
static QString getDocumentPath(void);
|
|
|
94 |
static QMargins getNotchSize();
|
|
|
95 |
static void openSettings();
|
|
|
96 |
|
|
|
97 |
static std::string& getOldNetlinx() { return oldNetlinx; }
|
|
|
98 |
static int getOldPort() { return oldPort; }
|
|
|
99 |
static int getOoldChannelID() { return oldChannelID; }
|
|
|
100 |
static std::string& getOldSurface() { return oldSurface; }
|
|
|
101 |
static bool getOldToolbarSuppress() { return oldToolbarSuppress; }
|
|
|
102 |
static bool getOldToolbarForce() { return oldToolbarForce; }
|
|
|
103 |
|
|
|
104 |
static void writeLog(int type, const std::string& msg);
|
|
|
105 |
|
|
|
106 |
private: /// methods
|
|
|
107 |
bool getDefaultBool(char *key, bool def);
|
|
|
108 |
int getDefaultNumber(char *key, int def);
|
|
|
109 |
|
|
|
110 |
// private variables
|
|
|
111 |
static std::string oldNetlinx;
|
|
|
112 |
static int oldPort;
|
|
|
113 |
static int oldChannelID;
|
|
|
114 |
static std::string oldSurface;
|
|
|
115 |
static bool oldToolbarSuppress;
|
|
|
116 |
static bool oldToolbarForce;
|
|
|
117 |
|
|
|
118 |
};
|
|
|
119 |
|
|
|
120 |
#endif // QASETTINGS_H
|