2 #ifdef TF_USE_GUI_MODULE
3 #include <QApplication>
5 #include <QCoreApplication>
8 #include "qplatformdefs.h"
18 #ifdef TF_USE_GUI_MODULE
21 :
public QCoreApplication
37 bool webRootExists()
const;
38 QString publicPath()
const;
39 QString configPath()
const;
40 QString libPath()
const;
41 QString logPath()
const;
42 QString pluginPath()
const;
43 QString tmpPath()
const;
45 void setDatabaseEnvironment(
const QString &environment);
47 bool appSettingsFileExists()
const;
48 QString appSettingsFilePath()
const;
49 const QVariantMap &sqlDatabaseSettings(
int databaseId)
const;
50 int sqlDatabaseSettingsCount()
const;
53 bool cacheEnabled()
const;
54 QString cacheBackend()
const;
55 int databaseIdForCache()
const;
58 QString validationErrorMessage(
int rule)
const;
59 QByteArray internetMediaType(
const QString &ext,
bool appendCharset =
false);
62 int maxNumberOfAppServers()
const;
63 int maxNumberOfThreadsPerAppServer()
const;
64 QString routesConfigFilePath()
const;
65 QString systemLogFilePath()
const;
66 QString accessLogFilePath()
const;
67 QString sqlQueryLogFilePath()
const;
68 #if QT_VERSION < 0x060000
69 QTextCodec *codecForInternal()
const {
return _codecInternal; }
70 QTextCodec *codecForHttpOutput()
const {
return _codecHttp; }
76 QThread *databaseContextMainThread()
const;
78 const QVariantMap &getConfig(
const QString &configName);
79 QVariant getConfigValue(
const QString &configName,
const QString &key,
const QVariant &defaultValue = QVariant());
80 void initializeCache();
83 #if defined(Q_OS_UNIX)
84 void watchUnixSignal(
int sig,
bool watch =
true);
85 void ignoreUnixSignal(
int sig,
bool ignore =
true);
89 void watchConsoleSignal();
90 void ignoreConsoleSignal();
91 void watchLocalSocket();
92 static bool sendLocalCtrlMessage(
const QByteArray &msg,
int targetProcess);
95 void recvLocalSocket();
99 void timerEvent(QTimerEvent *event);
100 static int signalNumber();
103 QString _webRootAbsolutePath;
104 QString _dbEnvironment;
105 QVector<QVariantMap> _sqlSettings;
107 QVariantMap _loggerSetting;
108 QVariantMap _validationSetting;
109 QVariantMap _mediaTypes;
110 #if QT_VERSION < 0x060000
111 QTextCodec *_codecInternal {
nullptr};
112 QTextCodec *_codecHttp {
nullptr};
117 int _appServerId {-1};
119 QMap<QString, QVariantMap> _configMap;
120 int _cacheSqlDbIndex {-1};
123 static void resetSignalNumber();
136 _dbEnvironment = environment;
140 #if defined(Q_OS_WIN)
141 #include <QAbstractNativeEventFilter>
143 class T_CORE_EXPORT TNativeEventFilter :
public QAbstractNativeEventFilter {
145 #if QT_VERSION < 0x060000
146 virtual bool nativeEventFilter(
const QByteArray &eventType,
void *message,
long *);
148 virtual bool nativeEventFilter(
const QByteArray &eventType,
void *message, qintptr *);
The TDatabaseContext class is the base class of contexts for database access.
Definition: tdatabasecontext.h:11
The TWebApplication class provides an event loop for TreeFrog applications.
Definition: twebapplication.h:23
QString databaseEnvironment() const
Returns the database environment, which string is used to load the settings in database....
Definition: twebapplication.h:44
QStringConverter::Encoding encodingForInternal() const
Definition: twebapplication.h:72
void setMultiProcessingModule(MultiProcessingModule mpm)
Definition: twebapplication.h:61
MultiProcessingModule
Definition: twebapplication.h:26
int applicationServerId() const
Definition: twebapplication.h:75
QStringConverter::Encoding encodingForHttpOutput() const
Definition: twebapplication.h:73
const QVariantMap & validationSettings() const
Returns a reference to the QSettings object for settings of the validation, which file is validation....
Definition: twebapplication.h:57
QString webRootPath() const
Returns the absolute path of the web root directory.
Definition: twebapplication.h:36
const QVariantMap & loggerSettings() const
Returns a reference to the QSettings object for settings of the logger, which file is logger....
Definition: twebapplication.h:56
void setDatabaseEnvironment(const QString &environment)
Sets the database environment to environment.
Definition: twebapplication.h:134
@ Invalid
Definition: tfnamespace.h:22
KvsEngine
Definition: tfnamespace.h:239
@ Encoding
Definition: tfnamespace.h:86
@ MultiProcessingModule
Definition: tfnamespace.h:143
#define T_CORE_EXPORT
Definition: tdeclexport.h:28
#define T_DISABLE_COPY(Class)
Definition: tdeclexport.h:37
#define T_DISABLE_MOVE(Class)
Definition: tdeclexport.h:41