QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
QxConnect.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** https://www.qxorm.com/
4** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
5**
6** This file is part of the QxOrm library
7**
8** This software is provided 'as-is', without any express or implied
9** warranty. In no event will the authors be held liable for any
10** damages arising from the use of this software
11**
12** Commercial Usage
13** Licensees holding valid commercial QxOrm licenses may use this file in
14** accordance with the commercial license agreement provided with the
15** Software or, alternatively, in accordance with the terms contained in
16** a written agreement between you and Lionel Marty
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3.0 as published by the Free Software
21** Foundation and appearing in the file 'license.gpl3.txt' included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU General Public License version 3.0 requirements will be
24** met : http://www.gnu.org/copyleft/gpl.html
25**
26** If you are unsure which license is appropriate for your use, or
27** if you have questions regarding the use of this file, please contact :
28** contact@qxorm.com
29**
30****************************************************************************/
31
32#ifdef _QX_ENABLE_QT_NETWORK
33#ifndef _QX_SERVICE_CONNECT_H_
34#define _QX_SERVICE_CONNECT_H_
35
36#ifdef _MSC_VER
37#pragma once
38#endif
39
47#ifndef QT_NO_SSL
48#include <QtNetwork/qsslsocket.h>
49#include <QtNetwork/qsslconfiguration.h>
50#include <QtNetwork/qsslcertificate.h>
51#include <QtNetwork/qsslerror.h>
52#include <QtNetwork/qsslkey.h>
53#endif // QT_NO_SSL
54
55#ifndef Q_MOC_RUN
57#endif // Q_MOC_RUN
58
59namespace qx {
60namespace service {
61
68class QX_DLL_EXPORT QxConnect : public qx::QxSingleton<QxConnect>
69{
70
71 friend class qx::QxSingleton<QxConnect>;
72
73public:
74
75 enum serialization_type { serialization_binary, serialization_xml, serialization_text, serialization_portable_binary,
76 serialization_wide_binary, serialization_wide_xml, serialization_wide_text,
77 serialization_polymorphic_binary, serialization_polymorphic_xml, serialization_polymorphic_text,
78 serialization_qt, serialization_json };
79
80private:
81
82 struct QxConnectImpl;
83 std::unique_ptr<QxConnectImpl> m_pImpl;
84
86 virtual ~QxConnect();
87
88public:
89
90 QString getIp();
91 long getPort();
97 quint64 getEncryptKey();
100 qlonglong getSessionTimeOut();
101
102#ifndef QT_NO_SSL
104 QSslConfiguration getSSLConfiguration();
105 QList<QSslCertificate> getSSLCACertificates();
106 QSslCertificate getSSLLocalCertificate();
108 QList<QSslError> getSSLIgnoreErrors();
109 QSsl::SslProtocol getSSLProtocol();
111 QSslSocket::PeerVerifyMode getSSLPeerVerifyMode();
113#endif // QT_NO_SSL
114
115 void setIp(const QString & s);
116 void setPort(long l);
118 void setThreadCount(long l);
119 void setMaxWait(int i);
120 void setCompressData(bool b);
121 void setEncryptData(bool b, quint64 key = 0);
122 void setKeepAlive(long l);
123 void setModeHTTP(bool b);
124 void setSessionTimeOut(qlonglong l);
125
126#ifndef QT_NO_SSL
127 void setSSLEnabled(bool b);
128 void setSSLConfiguration(QSslConfiguration cfg);
129 void setSSLCACertificates(QList<QSslCertificate> lst);
130 void setSSLLocalCertificate(QSslCertificate cert);
131 void setSSLPrivateKey(QSslKey key);
132 void setSSLIgnoreErrors(QList<QSslError> lst);
133 void setSSLProtocol(QSsl::SslProtocol e);
134 void setSSLPeerVerifyName(const QString & s);
135 void setSSLPeerVerifyMode(QSslSocket::PeerVerifyMode e);
137#endif // QT_NO_SSL
138
139};
140
141} // namespace service
142} // namespace qx
143
145
146#endif // _QX_SERVICE_CONNECT_H_
147#endif // _QX_ENABLE_QT_NETWORK
#define QX_DLL_EXPORT
Definition QxMacro.h:182
#define QX_DLL_EXPORT_QX_SINGLETON_HPP(x)
Definition QxMacro.h:190
Concrete class to define a thread-safe singleton of QxOrm library.
qx::QxSingleton<T> : concrete class to define a thread-safe singleton of type T
Definition QxSingleton.h:59
qx::service::QxConnect : define connection parameters used by QxService module of QxOrm library (this...
Definition QxConnect.h:69
QSsl::SslProtocol getSSLProtocol()
QSslSocket::PeerVerifyMode getSSLPeerVerifyMode()
void setEncryptData(bool b, quint64 key=0)
void setSSLPeerVerifyMode(QSslSocket::PeerVerifyMode e)
void setCompressData(bool b)
QList< QSslCertificate > getSSLCACertificates()
void setKeepAlive(long l)
void setSSLEnabled(bool b)
QString getSSLPeerVerifyName()
void setSerializationType(serialization_type e)
serialization_type getSerializationType()
void setSSLIgnoreErrors(QList< QSslError > lst)
void setSSLPeerVerifyDepth(int i)
QList< QSslError > getSSLIgnoreErrors()
void setThreadCount(long l)
QSslConfiguration getSSLConfiguration()
void setIp(const QString &s)
QSslCertificate getSSLLocalCertificate()
void setSSLCACertificates(QList< QSslCertificate > lst)
void setSSLLocalCertificate(QSslCertificate cert)
void setSSLConfiguration(QSslConfiguration cfg)
qlonglong getSessionTimeOut()
void setSSLPrivateKey(QSslKey key)
void setSessionTimeOut(qlonglong l)
void setSSLProtocol(QSsl::SslProtocol e)
std::unique_ptr< QxConnectImpl > m_pImpl
Private implementation idiom.
Definition QxConnect.h:83
void setSSLPeerVerifyName(const QString &s)
void setModeHTTP(bool b)
Root namespace for all QxOrm library features.