23 #ifndef __IRCNETWORKADAPTER_H__ 24 #define __IRCNETWORKADAPTER_H__ 26 #include "irc/ircadapterbase.h" 27 #include "irc/ircclient.h" 28 #include "irc/ircnetworkconnectioninfo.h" 29 #include "irc/ircrequestparser.h" 30 #include "socketsignalsadapter.h" 56 return NetworkAdapter;
64 return this->
isOperator(this->myNickname(), channel);
87 void banUser(
const QString &nickname,
const QString &reason,
const QString &channel);
89 QList<IRCAdapterBase *> childrenAdapters();
93 return this->connectionInfo;
102 void disconnect(
const QString &farewellMessage);
124 bool hasRecipient(
const QString &recipient)
const;
133 bool isConnected()
const 135 return ircClient.isConnected();
137 bool isMyNickname(
const QString &nickname)
const;
147 bool isOperator(
const QString &nickname,
const QString &channel)
const;
149 void killAllChatWindows();
151 const QString &myNickname()
const 153 return connectionInfo.
nick;
163 return ircResponseParser;
174 void setChannelMode(
const QString &channel,
const QString &nickname,
const QString &flag,
bool bSet);
176 void sendCtcp(
const QString &nickname,
const QString &command);
183 this->bEmitAllIRCMessages = b;
188 QString
title()
const override;
210 void printMsgLiteral(
const QString &recipient,
const QString &content,
215 void print(
const QString &printWhat,
const QString &printWhere);
216 void printWithClass(
const QString &printWhat,
const QString &printWhere,
const IRCMessageClass &msgClass);
217 void printToCurrentChatBox(
const QString &printWhat,
const IRCMessageClass &msgClass);
218 void reloadNetworkEntityFromConfig();
219 void userPing(
const QString &nickname, qint64 ping);
246 bool bEmitAllIRCMessages;
256 QHash<QString, IRCChatAdapter *> chatWindows;
268 const IRCChatAdapter *getChatAdapter(
const QString &recipient)
const;
279 IRCChatAdapter *getOrCreateNewChatAdapter(
const QString &recipient);
281 void killChatWindow(
const QString &recipient);
284 void appendISupportLine(
const QString &line);
285 void echoPrivmsg(
const QString &recipient,
const QString &content);
286 void helloClient(
const QString &nickname);
287 void kick(
const QString &channel,
const QString &byWhom,
const QString &whoIsKicked,
const QString &reason);
288 void kill(
const QString &victim,
const QString &comment);
289 void ircServerResponse(
const QString &message);
290 void modeInfo(
const QString &channel,
const QString &whoSetThis,
const QString &modeParams);
291 void namesListReceived(
const QString &channel,
const QStringList &names);
292 void namesListEndReceived(
const QString &channel);
293 void nicknameInUse(
const QString &nickname);
294 void noSuchNickname(
const QString &nickname);
295 void parseError(
const QString &error);
297 void privMsgReceived(
const QString &recipient,
const QString &sender,
const QString &content);
298 void sendPong(
const QString &toWhom);
299 void userChangesNickname(
const QString &oldNickname,
const QString &newNickname);
300 void userIdleTime(
const QString &nick,
int secondsIdle);
301 void userJoinsChannel(
const QString &channel,
const QString &nickname,
const QString &fullSignature);
302 void userModeChanged(
const QString &channel,
const QString &nickname,
303 const QList<char> &addedFlags,
const QList<char> &removedFlags);
304 void userNetworkJoinDateTime(
const QString &nick,
const QDateTime &timeOfJoin);
305 void userPartsChannel(
const QString &channel,
const QString &nickname,
const QString &farewellMessage);
306 void userQuitsNetwork(
const QString &nickname,
const QString &farewellMessage);
307 void whoIsUser(
const QString &nickname,
const QString &user,
const QString &hostName,
const QString &realName);
319 this->pParent = pParent;
323 void connected()
override;
324 void disconnected()
override;
325 void errorReceived(QAbstractSocket::SocketError error)
override;
326 void infoMessage(
const QString &message);
Interprets communication between the client and the IRC server.
AdapterType adapterType() const override
Gets adapter type for this adapter instance.
Allows to perform operation on a list of users.
Parses request and interprets them in a way that emulates mIRC (or any even slightly sane IRC client ...
void openNewAdapter(const QString &recipientName)
Opens a new chat adapter for specified recipient.
void print(const QString &printWhat, const QString &printWhere)
void banUser(const QString &nickname, const QString &reason, const QString &channel)
Bans specified user from a channel.
Provides an unified communication interface between a client and IRC network entities.
void setEmitAllIRCMessagesEnabled(bool b)
QString nick
Original nickname. This variable will always store the current nickname of the client.
Struct containing information about client's connection to the IRC server.
Handles chatting through IRC.
IRCNetworkAdapter * network() override
The idea of the adapter system is that each adapter is either a network or is a child of a network...
void doSendMessage(const QString &message, IRCAdapterBase *pOrigin) override
Implemented to support direct communication between client and server.
QString title() const override
Gets title for this adapter.
bool isOperator(const QString &nickname, const QString &channel) const
Checks if user is an operator on a given channel.
AdapterType
Defines all possible types of IRC adapters.
bool amIOperator(const QString &channel) const
Checks if client is an operator on a specified channel.
void detachChatWindow(const IRCChatAdapter *pAdapter)
Detaches the specified IRCChatAdapter instance from this network without deleting it...
const IRCUserPrefix & userPrefixes() const
All allowed modes with their nickname prefixes for this network.
void setChannelMode(const QString &channel, const QString &nickname, const QString &flag, bool bSet)
Sets channel flags.
One-to-one association of visible prefixes to user mode.
Data structure that describes and defines a connection to an IRC network or server.
void newChatWindowIsOpened(IRCChatAdapter *pWindow)
Signal emitted when a new chat (priv or channel) is opened from this network.
bool isAdapterRelated(const IRCAdapterBase *pAdapter) const
Checks if pAdapter equals this or is one of chat windows of this network.