QXmpp  Version:0.6.2
 All Classes Functions Variables Enumerations Enumerator Properties Groups
QXmppConfiguration.h
1 /*
2  * Copyright (C) 2008-2012 The QXmpp developers
3  *
4  * Author:
5  * Manjeet Dahiya
6  *
7  * Source:
8  * http://code.google.com/p/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 
25 #ifndef QXMPPCONFIGURATION_H
26 #define QXMPPCONFIGURATION_H
27 
28 #include <QString>
29 #include <QSharedDataPointer>
30 
31 #include "QXmppGlobal.h"
32 
33 class QNetworkProxy;
34 class QSslCertificate;
35 class QXmppConfigurationPrivate;
36 
47 
48 class QXMPP_EXPORT QXmppConfiguration
49 {
50 public:
55  {
56  TLSEnabled = 0,
58  TLSRequired
59 
60  };
61 
66  {
67  NonSASLPlain = 0,
68  NonSASLDigest
69  };
70 
75 
79  QXmppConfiguration& operator=(const QXmppConfiguration &other);
80 
81  QString host() const;
82  void setHost(const QString&);
83 
84  QString domain() const;
85  void setDomain(const QString&);
86 
87  int port() const;
88  void setPort(int);
89 
90  QString user() const;
91  void setUser(const QString&);
92 
93  QString password() const;
94  void setPassword(const QString&);
95 
96  QString resource() const;
97  void setResource(const QString&);
98 
99  QString jid() const;
100  void setJid(const QString &jid);
101 
102  QString jidBare() const;
103 
104  QString facebookAccessToken() const;
105  void setFacebookAccessToken(const QString&);
106 
107  QString facebookAppId() const;
108  void setFacebookAppId(const QString&);
109 
110  bool autoAcceptSubscriptions() const;
111  void setAutoAcceptSubscriptions(bool);
112 
113  bool autoReconnectionEnabled() const;
114  void setAutoReconnectionEnabled(bool);
115 
116  bool useSASLAuthentication() const;
117  void setUseSASLAuthentication(bool);
118 
119  bool ignoreSslErrors() const;
120  void setIgnoreSslErrors(bool);
121 
122  QXmppConfiguration::StreamSecurityMode streamSecurityMode() const;
123  void setStreamSecurityMode(QXmppConfiguration::StreamSecurityMode mode);
124 
125  QXmppConfiguration::NonSASLAuthMechanism nonSASLAuthMechanism() const;
126  void setNonSASLAuthMechanism(QXmppConfiguration::NonSASLAuthMechanism);
127 
128  QString saslAuthMechanism() const;
129  void setSaslAuthMechanism(const QString &mechanism);
130 
131  QNetworkProxy networkProxy() const;
132  void setNetworkProxy(const QNetworkProxy& proxy);
133 
134  int keepAliveInterval() const;
135  void setKeepAliveInterval(int secs);
136 
137  int keepAliveTimeout() const;
138  void setKeepAliveTimeout(int secs);
139 
140  QList<QSslCertificate> caCertificates() const;
141  void setCaCertificates(const QList<QSslCertificate> &);
142 
144  // deprecated since 0.6.0
145  enum SASLAuthMechanism
146  {
147  SASLPlain = 0,
148  SASLDigestMD5,
149  SASLAnonymous,
150  SASLXFacebookPlatform
151  };
152  QXmppConfiguration::SASLAuthMechanism Q_DECL_DEPRECATED sASLAuthMechanism() const;
153  void Q_DECL_DEPRECATED setSASLAuthMechanism(QXmppConfiguration::SASLAuthMechanism);
155 
156 private:
157  QSharedDataPointer<QXmppConfigurationPrivate> d;
158 };
159 
160 #endif // QXMPPCONFIGURATION_H