15 #ifndef IRCCONNECTION_H
16 #define IRCCONNECTION_H
21 #include <QtCore/qobject.h>
22 #include <QtCore/qmetatype.h>
23 #include <QtCore/qscopedpointer.h>
24 #include <QtNetwork/qabstractsocket.h>
30 class IrcConnectionPrivate;
36 Q_PROPERTY(
QString host READ host WRITE setHost NOTIFY hostChanged)
37 Q_PROPERTY(
int port READ port WRITE setPort NOTIFY portChanged)
38 Q_PROPERTY(
QString userName READ userName WRITE setUserName NOTIFY userNameChanged)
39 Q_PROPERTY(
QString nickName READ nickName WRITE setNickName NOTIFY nickNameChanged)
40 Q_PROPERTY(
QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
41 Q_PROPERTY(
QString password READ password WRITE setPassword NOTIFY passwordChanged)
42 Q_PROPERTY(
QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged)
43 Q_PROPERTY(
QByteArray encoding READ encoding WRITE setEncoding)
44 Q_PROPERTY(
Status status READ status NOTIFY statusChanged)
45 Q_PROPERTY(
bool active READ isActive NOTIFY statusChanged)
46 Q_PROPERTY(
bool connected READ isConnected NOTIFY statusChanged)
47 Q_PROPERTY(
bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
48 Q_PROPERTY(
int reconnectDelay READ reconnectDelay WRITE setReconnectDelay NOTIFY reconnectDelayChanged)
50 Q_PROPERTY(
bool secure READ isSecure WRITE setSecure NOTIFY secureChanged)
51 Q_PROPERTY(
QString saslMechanism READ saslMechanism WRITE setSaslMechanism NOTIFY saslMechanismChanged)
52 Q_PROPERTY(
QStringList supportedSaslMechanisms READ supportedSaslMechanisms CONSTANT)
62 void setHost(const
QString& host);
65 void setPort(
int port);
68 void setUserName(const
QString& name);
71 void setNickName(const
QString& name);
74 void setRealName(const
QString& name);
77 void setPassword(const
QString& password);
80 void setDisplayName(const
QString& name);
94 Status status()
const;
95 bool isActive()
const;
96 bool isConnected()
const;
97 bool isEnabled()
const;
99 int reconnectDelay()
const;
100 void setReconnectDelay(
int seconds);
105 bool isSecure()
const;
106 void setSecure(
bool secure);
109 void setSaslMechanism(
const QString& mechanism);
115 void installMessageFilter(
QObject* filter);
116 void removeMessageFilter(
QObject* filter);
118 void installCommandFilter(
QObject* filter);
119 void removeCommandFilter(
QObject* filter);
125 void setEnabled(
bool enabled =
true);
126 void setDisabled(
bool disabled =
true);
130 bool sendRaw(
const QString& message);
134 void nickNameReserved(
QString* alternate);
138 void socketError(QAbstractSocket::SocketError error);
139 void socketStateChanged(QAbstractSocket::SocketState state);
161 void hostChanged(
const QString& host);
162 void portChanged(
int port);
163 void userNameChanged(
const QString& name);
164 void nickNameChanged(
const QString& name);
165 void realNameChanged(
const QString& name);
166 void passwordChanged(
const QString& password);
167 void displayNameChanged(
const QString& name);
169 void reconnectDelayChanged(
int seconds);
170 void enabledChanged(
bool enabled);
171 void secureChanged(
bool secure);
172 void saslMechanismChanged(
const QString& mechanism);
178 IrcProtocol* protocol()
const;
179 void setProtocol(IrcProtocol* protocol);
182 friend class IrcProtocol;
183 friend class IrcProtocolPrivate;
188 Q_PRIVATE_SLOT(d_func(),
void _irc_connected())
189 Q_PRIVATE_SLOT(d_func(),
void _irc_disconnected())
190 Q_PRIVATE_SLOT(d_func(),
void _irc_error(
QAbstractSocket::SocketError))
191 Q_PRIVATE_SLOT(d_func(),
void _irc_state(
QAbstractSocket::SocketState))
192 Q_PRIVATE_SLOT(d_func(),
void _irc_reconnect())
193 Q_PRIVATE_SLOT(d_func(),
void _irc_readData())
194 Q_PRIVATE_SLOT(d_func(),
void _irc_filterDestroyed(
QObject*))
197 #ifndef QT_NO_DEBUG_STREAM
200 #endif // QT_NO_DEBUG_STREAM
205 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(
IrcConnection::Status))
207 #endif // IRCCONNECTION_H
Represents a join message.
Definition: ircmessage.h:174
Provides the most common commands.
Definition: irccommand.h:29
Represents a kick message.
Definition: ircmessage.h:190
Represents a part message.
Definition: ircmessage.h:327
The connection is being closed.
Definition: ircconnection.h:90
Represents a notice message.
Definition: ircmessage.h:289
The connection has been established.
Definition: ircconnection.h:89
Represents a names list message.
Definition: ircmessage.h:253
The connection is inactive.
Definition: ircconnection.h:86
Represents a capability message.
Definition: ircmessage.h:122
Provides means to establish a connection to an IRC server.
Definition: ircconnection.h:32
The connection has been closed.
Definition: ircconnection.h:91
Represents a mode message.
Definition: ircmessage.h:210
Represents a ping message.
Definition: ircmessage.h:345
Represents a quit message.
Definition: ircmessage.h:401
The base class of all messages.
Definition: ircmessage.h:32
Represents a pong message.
Definition: ircmessage.h:361
Represents a numeric message.
Definition: ircmessage.h:311
Represents an error message.
Definition: ircmessage.h:140
Status
Definition: ircconnection.h:85
The connection is being established.
Definition: ircconnection.h:88
Represents a private message.
Definition: ircmessage.h:377
Represents a message of the day.
Definition: ircmessage.h:237
The connection is waiting for a reconnect.
Definition: ircconnection.h:87
Represents a nick message.
Definition: ircmessage.h:271
Represents a topic message.
Definition: ircmessage.h:417
Represents an invite message.
Definition: ircmessage.h:156
Provides network information and capability management.
Definition: ircnetwork.h:29