![]() |
Communi
1.1.0
A cross-platform IRC client library written with Qt 4
|
The IrcCommand class provides the most common IRC commands. More...
#include <IrcCommand>
Public Types | |
| enum | Type { Custom, Nick, Quit, Join, Part, Topic, Names, List, Invite, Kick, Mode, Message, Notice, CtcpAction, CtcpRequest, CtcpReply, Who, Whois, Whowas, Away, Quote } |
Public Member Functions | |
| IrcCommand (QObject *parent=0) | |
| virtual | ~IrcCommand () |
| virtual QString | toString () const |
Static Public Member Functions | |
| static Q_INVOKABLE IrcCommand * | createAway (const QString &reason=QString()) |
| static Q_INVOKABLE IrcCommand * | createCtcpAction (const QString &target, const QString &action) |
| static Q_INVOKABLE IrcCommand * | createCtcpReply (const QString &target, const QString &reply) |
| static Q_INVOKABLE IrcCommand * | createCtcpRequest (const QString &target, const QString &request) |
| static Q_INVOKABLE IrcCommand * | createInvite (const QString &user, const QString &channel) |
| static Q_INVOKABLE IrcCommand * | createJoin (const QString &channel, const QString &key=QString()) |
| static Q_INVOKABLE IrcCommand * | createKick (const QString &channel, const QString &user, const QString &reason=QString()) |
| static Q_INVOKABLE IrcCommand * | createList (const QString &channel, const QString &server=QString()) |
| static Q_INVOKABLE IrcCommand * | createMessage (const QString &target, const QString &message) |
| static Q_INVOKABLE IrcCommand * | createMode (const QString &target, const QString &mode, const QString &arg=QString()) |
| static Q_INVOKABLE IrcCommand * | createNames (const QString &channel) |
| static Q_INVOKABLE IrcCommand * | createNick (const QString &nick) |
| static Q_INVOKABLE IrcCommand * | createNotice (const QString &target, const QString &message) |
| static Q_INVOKABLE IrcCommand * | createPart (const QString &channel, const QString &reason=QString()) |
| static Q_INVOKABLE IrcCommand * | createQuit (const QString &reason=QString()) |
| static Q_INVOKABLE IrcCommand * | createQuote (const QStringList ¶meters) |
| static Q_INVOKABLE IrcCommand * | createTopic (const QString &channel, const QString &topic=QString()) |
| static Q_INVOKABLE IrcCommand * | createWho (const QString &mask) |
| static Q_INVOKABLE IrcCommand * | createWhois (const QString &user) |
| static Q_INVOKABLE IrcCommand * | createWhowas (const QString &user) |
Properties | |
| QByteArray | encoding |
| QStringList | parameters |
| Type | type |
The IrcCommand class provides the most common IRC commands.
The IrcCommand class supports the most common IRC commands out of the box, and can be extended for custom commands as well. See IrcCommand::Type for the list of built-in command types. IRC commands, as in IrcCommand instances, are sent to the IRC server via IrcSession::sendCommand().
It is recommended to create IrcCommand instances via static IrcCommand::createXxx() methods.
A "custom command" here refers to command types not listed in IrcCommand::Type, the list of built-in command types. There are two ways to send custom commands:
Example implementation of a custom command:
| enum IrcCommand::Type |
This enum describes the built-in command types.
| Custom |
A custom command.
|
| Nick |
A nick command (NICK) is used to give user a nickname or change the previous one. |
| Quit |
A quit command (QUIT) is used to end a client session. |
| Join |
A join command (JOIN) is used to start listening a specific channel. |
| Part |
A part command (PART) causes the client to be removed from the channel. |
| Topic |
A topic command (TOPIC) is used to change or view the topic of a channel. |
| Names |
A names command (NAMES) is used to list all nicknames on a channel. |
| List |
A list command (LIST) is used to list channels and their topics. |
| Invite |
An invite command (INVITE) is used to invite users to a channel. |
| Kick |
A kick command (KICK) is used to forcibly remove a user from a channel. |
| Mode |
A mode command (MODE) is used to change the mode of users and channels. |
| Message |
A message command (PRIVMSG) is used to send private messages to channels and users. |
| Notice |
A notice command (NOTICE) is used to send notice messages to channels and users. |
| CtcpAction |
A CTCP action command is used to send an action message to channels and users. |
| CtcpRequest |
A CTCP request command is used to send a request. |
| CtcpReply |
A CTCP reply command is used to send a reply to a request. |
| Who |
A who command (WHO) is used to generate a query which returns a list of matching users. |
| Whois |
A whois command (WHOIS) is used to query information about a particular user. |
| Whowas |
A whowas command (WHOWAS) is used to query information about a user that no longer exists. |
| Away |
An away command (AWAY) is used to set the away status. |
| Quote |
A quote command is used to send a raw message to the server. |
|
explicit |
Constructs a new IrcCommand with parent.
|
virtual |
Destructs the IRC command.
|
static |
Creates a new away command with type IrcCommand::Away and optional parameter reason.
|
static |
Creates a new CTCP action command with type IrcCommand::CtcpAction and parameters target and action.
|
static |
Creates a new CTCP reply command with type IrcCommand::CtcpReply and parameters target and reply.
|
static |
Creates a new CTCP request command with type IrcCommand::CtcpRequest and parameters target and request.
|
static |
Creates a new invite command with type IrcCommand::Invite and parameters user and channel.
|
static |
Creates a new join command with type IrcCommand::Join and parameters channel and optional key.
|
static |
Creates a new kick command with type IrcCommand::Kick and parameters channel, user and optional reason.
|
static |
Creates a new list command with type IrcCommand::List and parameters channel and optional server.
|
static |
Creates a new message command with type IrcCommand::Message and parameters target and message.
|
static |
Creates a new mode command with type IrcCommand::Mode and parameters target, mode and optional arg.
|
static |
Creates a new names command with type IrcCommand::Names and parameter channel.
|
static |
Creates a new nick command with type IrcCommand::Nick and parameter nick.
|
static |
Creates a new notice command with type IrcCommand::Notice and parameters target and message.
|
static |
Creates a new part command with type IrcCommand::Part and parameters channel and optional reason.
|
static |
Creates a new quit command with type IrcCommand::Quit and optional parameter reason.
|
static |
Creates a new quote command with type IrcCommand::Quote and parameters.
|
static |
Creates a new topic command with type IrcCommand::Topic and parameters channel and optional topic.
|
static |
Creates a new who command with type IrcCommand::Who and parameter mask.
|
static |
Creates a new whois command with type IrcCommand::Whois and parameter user.
|
static |
Creates a new whowas command with type IrcCommand::Whowas and parameter user.
|
virtual |
|
readwrite |
This property holds the encoding that is used when sending the command via IrcSession::sendCommand().
See QTextCodec::availableCodes() for the list of supported encodings. The default value is "UTF-8".
|
readwrite |
This property holds the command parameters.
|
readwrite |
This property holds the command type.
1.8.1.1