IRCChannelAdapter Class Reference

Class type that is used for conversations within a channel. More...

#include <ircchanneladapter.h>

+ Inheritance diagram for IRCChannelAdapter:

Signals

void myNicknameUsed ()
 Emitted when nickname is used in a message.
 
void nameAdded (const IRCUserInfo &userInfo)
 
void nameListUpdated (const IRCUserList &names)
 
void nameRemoved (const IRCUserInfo &userInfo)
 
void nameUpdated (const IRCUserInfo &userInfo)
 

Public Member Functions

 IRCChannelAdapter (IRCNetworkAdapter *pNetwork, const QString &recipient)
 
AdapterType adapterType () const override
 Gets adapter type for this adapter instance.
 
bool amIOperator () const
 Checks if this client is an operator on this channel.
 
void appendNamesToCachedList (const QStringList &names)
 Appends a list of names to cachedNames list. This ensures that no duplicate names are found on the list.
 
void appendNameToCachedList (const QString &name)
 Appends a single name to the sorted cachedNames list.
 
void banUser (const QString &nickname, const QString &reason)
 Bans and kicks user from the channel.
 
void emitCachedNameListUpdated ()
 Emits cached list of names. This should be called when end of names list message is received for this channel.
 
void emitChatMessage (const QString &sender, const QString &content) override
 Emits message() signal formatting it to present sender's message.
 
bool hasUser (const QString &nickname)
 
bool isOperator (const QString &nickname) const
 Checks if user is an operator on this channel.
 
void kickUser (const QString &nickname, const QString &reason)
 Kicks user from the channel.
 
void removeNameFromCachedList (const QString &name)
 Removes a name from the sortecd cachedNames list.
 
void setHalfOp (const QString &nickname, bool bSet)
 Sets half op mode for given user.
 
void setOp (const QString &nickname, bool bSet)
 Sets op mode for given user.
 
void setVoiced (const QString &nickname, bool bSet)
 Sets voice mode for given user.
 
void userChangesNickname (const QString &oldNickname, const QString &newNickname) override
 
void userJoins (const QString &nickname, const QString &fullSignature) override
 Use this to register the fact that user has joined the chat.
 
void userLeaves (const QString &nickname, const QString &farewellMessage, IRCQuitType quitType) override
 Use this to register the fact that user has left the chat.
 
void userModeChanges (const QString &nickname, const QList< char > &addedFlags, const QList< char > &removedFlags) override
 
- Public Member Functions inherited from IRCChatAdapter
 IRCChatAdapter (IRCNetworkAdapter *pNetwork, const QString &recipient)
 
void doSendMessage (const QString &message, IRCAdapterBase *pOrigin) override
 
IRCNetworkAdapternetwork () override
 The idea of the adapter system is that each adapter is either a network or is a child of a network.
 
QString recipient () const override
 
void setNetwork (IRCNetworkAdapter *pNetwork)
 Sets IRCNetworkAdapter for this chat window. This adapter is not detached from the old network.
 
QString title () const override
 For chat adapters this will return recipientName.
 
- Public Member Functions inherited from IRCAdapterBase
virtual ~IRCAdapterBase () override
 Destructor emits terminating() signal.
 
void emitError (const QString &strError)
 
void emitFocusRequest ()
 
void emitMessage (const QString &strMessage)
 
void emitMessageWithClass (const QString &strMessage, const IRCMessageClass &messageClass)
 
const IRCNetworkEntitynetworkEntity () const
 

Additional Inherited Members

- Public Types inherited from IRCChatAdapter
enum  IRCQuitType { ChannelPart, NetworkKill, NetworkQuit }
 
- Public Slots inherited from IRCAdapterBase
void emitMessageToAllChatBoxes (const QString &message, const IRCMessageClass &msgClass)
 
void sendMessage (const QString &message)
 
- Protected Member Functions inherited from IRCChatAdapter
QString extractMessageLine (QStringList &words, int maxLength)
 
void sendChatMessage (const QString &message)
 
void setRecipient (const QString &name)
 
- Protected Attributes inherited from IRCChatAdapter
IRCNetworkAdapterpNetwork
 
QString recipientName
 

Detailed Description

Class type that is used for conversations within a channel.

Definition at line 35 of file ircchanneladapter.h.

Member Function Documentation

AdapterType IRCChannelAdapter::adapterType ( ) const
inlineoverridevirtual

Gets adapter type for this adapter instance.

Implements IRCAdapterBase.

Definition at line 43 of file ircchanneladapter.h.

bool IRCChannelAdapter::amIOperator ( ) const

Checks if this client is an operator on this channel.

Definition at line 45 of file ircchanneladapter.cpp.

void IRCChannelAdapter::appendNamesToCachedList ( const QStringList &  names)

Appends a list of names to cachedNames list. This ensures that no duplicate names are found on the list.

Definition at line 60 of file ircchanneladapter.cpp.

void IRCChannelAdapter::appendNameToCachedList ( const QString &  name)

Appends a single name to the sorted cachedNames list.

Ensures that no duplicate names are found on the list. This will emit nameAdded() signal.

Definition at line 51 of file ircchanneladapter.cpp.

void IRCChannelAdapter::banUser ( const QString &  nickname,
const QString &  reason 
)

Bans and kicks user from the channel.

Op privileges required.

Parameters
nicknameVictim's nick.
reasonReason for ban (this will be delivered to /kick message).

Definition at line 68 of file ircchanneladapter.cpp.

void IRCChannelAdapter::emitCachedNameListUpdated ( )

Emits cached list of names. This should be called when end of names list message is received for this channel.

Definition at line 73 of file ircchanneladapter.cpp.

void IRCChannelAdapter::emitChatMessage ( const QString &  sender,
const QString &  content 
)
overridevirtual

Emits message() signal formatting it to present sender's message.

Reimplemented from IRCChatAdapter.

Definition at line 78 of file ircchanneladapter.cpp.

bool IRCChannelAdapter::isOperator ( const QString &  nickname) const

Checks if user is an operator on this channel.

Definition at line 104 of file ircchanneladapter.cpp.

void IRCChannelAdapter::kickUser ( const QString &  nickname,
const QString &  reason 
)

Kicks user from the channel.

Op privileges required.

Parameters
nicknameVictim's nick.
reasonReason for kick.

Definition at line 113 of file ircchanneladapter.cpp.

void IRCChannelAdapter::myNicknameUsed ( )
signal

Emitted when nickname is used in a message.

This is played for other user's chat messages.

void IRCChannelAdapter::removeNameFromCachedList ( const QString &  name)

Removes a name from the sortecd cachedNames list.

This will emit nameRemoved() signal.

Definition at line 122 of file ircchanneladapter.cpp.

void IRCChannelAdapter::setHalfOp ( const QString &  nickname,
bool  bSet 
)

Sets half op mode for given user.

Definition at line 132 of file ircchanneladapter.cpp.

void IRCChannelAdapter::setOp ( const QString &  nickname,
bool  bSet 
)

Sets op mode for given user.

Op privileges required.

Definition at line 137 of file ircchanneladapter.cpp.

void IRCChannelAdapter::setVoiced ( const QString &  nickname,
bool  bSet 
)

Sets voice mode for given user.

Op privileges required.

Definition at line 142 of file ircchanneladapter.cpp.

void IRCChannelAdapter::userChangesNickname ( const QString &  oldNickname,
const QString &  newNickname 
)
overridevirtual

This will emit nameRemoved() for oldNickname and nameAdded() for the newNickname.

Implements IRCChatAdapter.

Definition at line 147 of file ircchanneladapter.cpp.

void IRCChannelAdapter::userJoins ( const QString &  nickname,
const QString &  fullSignature 
)
overridevirtual

Use this to register the fact that user has joined the chat.

Implements IRCChatAdapter.

Definition at line 162 of file ircchanneladapter.cpp.

void IRCChannelAdapter::userLeaves ( const QString &  nickname,
const QString &  farewellMessage,
IRCQuitType  quitType 
)
overridevirtual

Use this to register the fact that user has left the chat.

Implements IRCChatAdapter.

Definition at line 170 of file ircchanneladapter.cpp.

void IRCChannelAdapter::userModeChanges ( const QString &  nickname,
const QList< char > &  addedFlags,
const QList< char > &  removedFlags 
)
overridevirtual

this will first emit nameRemoved() for the nickname and then nameAdded() for the same nickname.

Implements IRCChatAdapter.

Definition at line 203 of file ircchanneladapter.cpp.


The documentation for this class was generated from the following files: