29 #ifndef IRCCONNECTION_H
30 #define IRCCONNECTION_H
35 #include <QtCore/qobject.h>
36 #include <QtCore/qvariant.h>
37 #include <QtCore/qmetatype.h>
38 #include <QtCore/qscopedpointer.h>
39 #include <QtNetwork/qabstractsocket.h>
45 class IrcConnectionPrivate;
51 Q_PROPERTY(
QString host READ host WRITE setHost NOTIFY hostChanged)
52 Q_PROPERTY(
int port READ port WRITE setPort NOTIFY portChanged)
53 Q_PROPERTY(
QString userName READ userName WRITE setUserName NOTIFY userNameChanged)
54 Q_PROPERTY(
QString nickName READ nickName WRITE setNickName NOTIFY nickNameChanged)
55 Q_PROPERTY(
QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
56 Q_PROPERTY(
QString password READ password WRITE setPassword NOTIFY passwordChanged)
57 Q_PROPERTY(
QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged)
58 Q_PROPERTY(QVariantMap userData READ userData WRITE setUserData NOTIFY userDataChanged)
59 Q_PROPERTY(
QByteArray encoding READ encoding WRITE setEncoding)
60 Q_PROPERTY(
Status status READ status NOTIFY statusChanged)
61 Q_PROPERTY(
bool active READ isActive NOTIFY statusChanged)
62 Q_PROPERTY(
bool connected READ isConnected NOTIFY statusChanged)
63 Q_PROPERTY(
bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
64 Q_PROPERTY(
int reconnectDelay READ reconnectDelay WRITE setReconnectDelay NOTIFY reconnectDelayChanged)
66 Q_PROPERTY(
bool secure READ isSecure WRITE setSecure NOTIFY secureChanged)
67 Q_PROPERTY(
bool secureSupported READ isSecureSupported)
68 Q_PROPERTY(
QString saslMechanism READ saslMechanism WRITE setSaslMechanism NOTIFY saslMechanismChanged)
69 Q_PROPERTY(
QStringList supportedSaslMechanisms READ supportedSaslMechanisms CONSTANT)
71 Q_PROPERTY(
IrcProtocol* protocol READ protocol WRITE setProtocol)
80 void setHost(const
QString& host);
83 void setPort(
int port);
86 void setUserName(const
QString& name);
89 void setNickName(const
QString& name);
92 void setRealName(const
QString& name);
95 void setPassword(const
QString& password);
98 void setDisplayName(const
QString& name);
100 QVariantMap userData() const;
101 void setUserData(const QVariantMap& data);
115 Status status()
const;
116 bool isActive()
const;
117 bool isConnected()
const;
118 bool isEnabled()
const;
120 int reconnectDelay()
const;
121 void setReconnectDelay(
int seconds);
126 bool isSecure()
const;
127 void setSecure(
bool secure);
128 static bool isSecureSupported();
131 void setSaslMechanism(
const QString& mechanism);
140 void installMessageFilter(
QObject* filter);
141 void removeMessageFilter(
QObject* filter);
143 void installCommandFilter(
QObject* filter);
144 void removeCommandFilter(
QObject* filter);
153 void setEnabled(
bool enabled =
true);
154 void setDisabled(
bool disabled =
true);
158 bool sendRaw(
const QString& message);
165 void socketError(QAbstractSocket::SocketError error);
166 void socketStateChanged(QAbstractSocket::SocketState state);
169 void nickNameReserved(
QString* alternate);
170 void nickNameRequired(
const QString& reserved,
QString* alternate);
194 void hostChanged(
const QString& host);
195 void portChanged(
int port);
196 void userNameChanged(
const QString& name);
197 void nickNameChanged(
const QString& name);
198 void realNameChanged(
const QString& name);
199 void passwordChanged(
const QString& password);
200 void displayNameChanged(
const QString& name);
201 void userDataChanged(
const QVariantMap& data);
203 void reconnectDelayChanged(
int seconds);
204 void enabledChanged(
bool enabled);
205 void secureChanged(
bool secure);
206 void saslMechanismChanged(
const QString& mechanism);
215 friend class IrcProtocolPrivate;
220 Q_PRIVATE_SLOT(d_func(),
void _irc_connected())
221 Q_PRIVATE_SLOT(d_func(),
void _irc_disconnected())
222 Q_PRIVATE_SLOT(d_func(),
void _irc_error(
QAbstractSocket::SocketError))
223 Q_PRIVATE_SLOT(d_func(),
void _irc_state(
QAbstractSocket::SocketState))
224 Q_PRIVATE_SLOT(d_func(),
void _irc_sslErrors())
225 Q_PRIVATE_SLOT(d_func(),
void _irc_reconnect())
226 Q_PRIVATE_SLOT(d_func(),
void _irc_readData())
227 Q_PRIVATE_SLOT(d_func(),
void _irc_filterDestroyed(
QObject*))
230 #ifndef QT_NO_DEBUG_STREAM
233 #endif // QT_NO_DEBUG_STREAM
238 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(
IrcConnection::Status))
240 #endif // IRCCONNECTION_H
Represents an invite message.
Definition: ircmessage.h:181
Represents a private message.
Definition: ircmessage.h:404
Represents a names list message.
Definition: ircmessage.h:280
Provides means to establish a connection to an IRC server.
Definition: ircconnection.h:47
Provides network information and capability management.
Definition: ircnetwork.h:43
The connection is being established.
Definition: ircconnection.h:109
Represents a numeric message.
Definition: ircmessage.h:338
Represents an error message.
Definition: ircmessage.h:165
Represents a quit message.
Definition: ircmessage.h:428
Represents a join message.
Definition: ircmessage.h:199
The connection is being closed.
Definition: ircconnection.h:111
Represents a pong message.
Definition: ircmessage.h:388
Q_INVOKABLE QString version()
Definition: irc.cpp:56
Represents a nick message.
Definition: ircmessage.h:298
Represents a ping message.
Definition: ircmessage.h:372
The connection is inactive.
Definition: ircconnection.h:107
The connection has been established.
Definition: ircconnection.h:110
Provides the most common commands.
Definition: irccommand.h:43
Status
Definition: ircconnection.h:106
The connection has been closed.
Definition: ircconnection.h:112
Represents a kick message.
Definition: ircmessage.h:215
Implements the IRC protocol and provides means for implementing support for custom protocols...
Definition: ircprotocol.h:45
Represents a reply message to a WHO command.
Definition: ircmessage.h:464
Represents a capability message.
Definition: ircmessage.h:147
Represents a part message.
Definition: ircmessage.h:354
Represents a topic message.
Definition: ircmessage.h:444
The base class of all messages.
Definition: ircmessage.h:47
Represents a mode message.
Definition: ircmessage.h:235
Represents a message of the day.
Definition: ircmessage.h:264
The connection is waiting for a reconnect.
Definition: ircconnection.h:108
void destroyed(QObject *obj)
Represents a notice message.
Definition: ircmessage.h:316