Handles chatting through IRC. More...
#include <ircchatadapter.h>
Public Types | |
enum | IRCQuitType { ChannelPart, NetworkKill, NetworkQuit } |
Public Types inherited from IRCAdapterBase | |
enum | AdapterType { NetworkAdapter, ChannelAdapter, PrivAdapter } |
Defines all possible types of IRC adapters. More... | |
Public Member Functions | |
IRCChatAdapter (IRCNetworkAdapter *pNetwork, const QString &recipient) | |
void | doSendMessage (const QString &message, IRCAdapterBase *pOrigin) override |
virtual void | emitChatMessage (const QString &sender, const QString &content) |
Emits message() signal formatting it to present sender's message. More... | |
IRCNetworkAdapter * | network () override |
The idea of the adapter system is that each adapter is either a network or is a child of a network. More... | |
QString | recipient () const override |
void | setNetwork (IRCNetworkAdapter *pNetwork) |
Sets IRCNetworkAdapter for this chat window. This adapter is not detached from the old network. More... | |
QString | title () const override |
For chat adapters this will return recipientName. More... | |
virtual void | userChangesNickname (const QString &oldNickname, const QString &newNickname)=0 |
Use this to register the fact that user has changed his/hers nickname. More... | |
virtual void | userJoins (const QString &nickname, const QString &fullSignature)=0 |
Use this to register the fact that user has joined the chat. More... | |
virtual void | userLeaves (const QString &nickname, const QString &farewellMessage, IRCQuitType quitType)=0 |
Use this to register the fact that user has left the chat. More... | |
virtual void | userModeChanges (const QString &nickname, const QList< char > &addedFlags, const QList< char > &removedFlags)=0 |
Use this to register the fact that user MODE flags have changed. More... | |
Public Member Functions inherited from IRCAdapterBase | |
virtual | ~IRCAdapterBase () override |
Destructor emits terminating() signal. More... | |
virtual AdapterType | adapterType () const =0 |
Gets adapter type for this adapter instance. More... | |
void | emitError (const QString &strError) |
void | emitFocusRequest () |
void | emitMessage (const QString &strMessage) |
void | emitMessageWithClass (const QString &strMessage, const IRCMessageClass &messageClass) |
const IRCNetworkEntity & | networkEntity () const |
Protected Member Functions | |
QString | extractMessageLine (QStringList &words, int maxLength) |
void | sendChatMessage (const QString &message) |
void | setRecipient (const QString &name) |
Protected Attributes | |
IRCNetworkAdapter * | pNetwork |
QString | recipientName |
Additional Inherited Members | |
Public Slots inherited from IRCAdapterBase | |
void | emitMessageToAllChatBoxes (const QString &message, const IRCMessageClass &msgClass) |
void | sendMessage (const QString &message) |
Signals inherited from IRCAdapterBase | |
void | error (const QString &error) |
void | focusRequest () |
Called when this adapter requests UI focus. More... | |
void | message (const QString &message) |
void | messageToNetworksCurrentChatBox (const QString &message, const IRCMessageClass &msgClass) |
void | messageWithClass (const QString &message, const IRCMessageClass &messageClass) |
void | terminating () |
void | titleChange () |
Can be called when the variable returned by title() might have changed and the application should be notified of this fact. More... | |
Handles chatting through IRC.
This class covers both channel and private messaging. This can be done because the IRC protocol as stated in RFC 1459 doesn't see a difference between transmitting messages between channel and user or between user and user directly.
Definition at line 39 of file ircchatadapter.h.
IRCChatAdapter::IRCChatAdapter | ( | IRCNetworkAdapter * | pNetwork, |
const QString & | recipient | ||
) |
pNetwork | A pointer to the network this channel or user exists on. |
recipient | Full name of the entity this adapter will be talking to. |
Definition at line 28 of file ircchatadapter.cpp.
|
overridevirtual |
All messages starting with '/' character will be passed to the parent network directly. Also the pOrigin parameter for the parent network will be set to point to 'this'.
All other messages will be sent as:
Implements IRCAdapterBase.
Definition at line 46 of file ircchatadapter.cpp.
|
virtual |
Emits message() signal formatting it to present sender's message.
Reimplemented in IRCChannelAdapter.
Definition at line 73 of file ircchatadapter.cpp.
|
protected |
Makes sure the sent message will not exceed the IRC character limit.
words | A list of words from which a "sentence" will be build. This list is directly modified and only unused words are left when this method is done processing. |
Definition at line 78 of file ircchatadapter.cpp.
|
inlineoverridevirtual |
The idea of the adapter system is that each adapter is either a network or is a child of a network.
This method is supposed to return a pointer to a network to which this adapter belongs.
Implements IRCAdapterBase.
Definition at line 75 of file ircchatadapter.h.
void IRCChatAdapter::setNetwork | ( | IRCNetworkAdapter * | pNetwork | ) |
Sets IRCNetworkAdapter for this chat window. This adapter is not detached from the old network.
Definition at line 144 of file ircchatadapter.cpp.
|
overridevirtual |
For chat adapters this will return recipientName.
Implements IRCAdapterBase.
Definition at line 155 of file ircchatadapter.cpp.
|
pure virtual |
Use this to register the fact that user has changed his/hers nickname.
Implemented in IRCChannelAdapter, and IRCPrivAdapter.
|
pure virtual |
Use this to register the fact that user has joined the chat.
Implemented in IRCChannelAdapter, and IRCPrivAdapter.
|
pure virtual |
Use this to register the fact that user has left the chat.
Implemented in IRCChannelAdapter, and IRCPrivAdapter.
|
pure virtual |
Use this to register the fact that user MODE flags have changed.
Implemented in IRCChannelAdapter, and IRCPrivAdapter.