Provides network information and capability management.
More...
Inherits QObject.
|
| enum | Limit {
NickLength,
ChannelLength,
TopicLength,
MessageLength,
KickReasonLength,
AwayReasonLength,
ModeCount,
MonitorCount
} |
| |
| enum | ModeType {
TypeA = 0x1,
TypeB = 0x2,
TypeC = 0x4,
TypeD = 0x8,
AllTypes = 0xf
} |
| |
Network information
IrcNetwork provides various information about the IRC network of a connection. This includes the network name, supported channel types, channel user mode characters and prefix letters and status prefixes, and various numeric limitations, such as the maximum nick, channel, topic and message lengths.
Furthermore, IrcNetwork provides convenient methods for converting channel user modes to prefixes and vice versa and testing whether a target name is a channel.
- Note
- Most properties have empty values until the network information has been initialized.
Capability management
IrcNetwork also provides means for capability management. It maintais a list of available and active capabilities, automatically requests desired capabilities, and provides convenient methods for manual capability requests.
- See also
- IrcConnection::network, Irc::supportedCapabilities, IRCv3 support
◆ Limit
This enum describes the numeric limit types.
| Enumerator |
|---|
| NickLength | The maximum nick name length.
|
| ChannelLength | The maximum channel name length.
|
| TopicLength | The maximum channel topic length.
|
| MessageLength | The maximum message length.
|
| KickReasonLength | The maximum kick reason length.
|
| AwayReasonLength | The maximum away reason length.
|
| ModeCount | The maximum number of channel modes allowed per mode command.
|
| MonitorCount | The maximum amount of targets a client may have in their monitor list.
- Since
- 3.4
|
◆ ModeType
This enum describes the channel mode types.
| Enumerator |
|---|
| TypeA | Type A modes.
Modes that add or remove an address to or from a list. These modes always take a parameter when sent by the server to a client; when sent by a client, they may be specified without a parameter, which requests the server to display the current contents of the corresponding list on the channel to the client.
|
| TypeB | Type B modes.
Modes that change a setting on the channel. These modes always take a parameter.
|
| TypeC | Type C modes.
Modes that change a setting on the channel. These modes take a parameter only when set; the parameter is absent when the mode is removed both in the client's and server's MODE command.
|
| TypeD | Type D modes.
Modes that change a setting on the channel. These modes never take a parameter.
|
| AllTypes | All type modes.
|
◆ channelLimit()
| int IrcNetwork::channelLimit |
( |
const QString & |
type | ) |
const |
Returns the limit for a type of channels, or -1 if the limitation is not known.
- See also
- channelTypes()
◆ channelModes()
| QStringList IrcNetwork::channelModes |
( |
IrcNetwork::ModeTypes |
types | ) |
const |
Returns the supported channel modes for specified types.
- See also
- ModeType
◆ hasCapability()
| bool IrcNetwork::hasCapability |
( |
const QString & |
capability | ) |
const |
◆ isCapable()
| bool IrcNetwork::isCapable |
( |
const QString & |
capability | ) |
const |
◆ isChannel()
| bool IrcNetwork::isChannel |
( |
const QString & |
name | ) |
const |
Returns true if the name is a channel.
doSomeChannelAction(name);
- See also
- channelTypes
◆ modeLimit()
| int IrcNetwork::modeLimit |
( |
const QString & |
mode | ) |
const |
Returns the limit of entries in the list per mode, or -1 if the limitation is not known.
- See also
- modes()
◆ modeToPrefix()
| QString IrcNetwork::modeToPrefix |
( |
const QString & |
mode | ) |
const |
◆ numericLimit()
◆ prefixToMode()
| QString IrcNetwork::prefixToMode |
( |
const QString & |
prefix | ) |
const |
◆ requestCapabilities
| bool IrcNetwork::requestCapabilities |
( |
const QStringList & |
capabilities | ) |
|
|
slot |
Requests the specified capabilities.
- Note
- The capabilities are NOT added to the list of requested capabilities to avoid them "piling up".
◆ requestCapability
| bool IrcNetwork::requestCapability |
( |
const QString & |
capability | ) |
|
|
slot |
Requests the specified capability.
- Note
- The capability is NOT added to the list of requested capabilities to avoid them "piling up".
◆ requestingCapabilities
| void IrcNetwork::requestingCapabilities |
( |
| ) |
|
|
signal |
◆ targetLimit()
| int IrcNetwork::targetLimit |
( |
const QString & |
command | ) |
const |
Returns the limit of targets for a command, or -1 if the limitation is not known.
◆ activeCapabilities
| QStringList IrcNetwork::activeCapabilities |
|
read |
This property holds the active capabilities.
- Access function:
- QStringList activeCapabilities() const
- Notifier signal:
- void activeCapabilitiesChanged(const QStringList& capabilities)
- See also
- requestedCapabilities, availableCapabilities
◆ availableCapabilities
| QStringList IrcNetwork::availableCapabilities |
|
read |
This property holds the available capabilities.
- Access function:
- QStringList availableCapabilities() const
- Notifier signal:
- void availableCapabilitiesChanged(const QStringList& capabilities)
- See also
- requestedCapabilities, activeCapabilities
◆ channelTypes
| QStringList IrcNetwork::channelTypes |
|
read |
This property holds the supported channel type prefix characters.
Examples of typical channel types:
| Description | Type | Example |
| Normal channel | # | #communi |
| Local channel | & | &foo |
- Access function:
- QStringList channelTypes() const
- Notifier signal:
- void channelTypesChanged(const QStringList& types)
◆ initialized
| bool IrcNetwork::initialized |
|
read |
This property holds whether the network information has been initialized.
Most properties have empty values until the server provides the relevant network information during the client-server handshake.
- Access function:
- bool isInitialized() const
- Notifier signal:
-
◆ modes
| QStringList IrcNetwork::modes |
|
read |
This property holds the supported channel user mode letters.
Examples of typical channel user modes:
| Description | Mode | Prefix |
| Channel operator | o | @ |
| Voiced user | v | + |
- Access function:
- QStringList modes() const
- Notifier signal:
- void modesChanged(const QStringList& modes)
- See also
- prefixes, modeToPrefix()
◆ name
This property holds the network name.
- Access function:
-
- Notifier signal:
- void nameChanged(const QString& name)
◆ prefixes
| QStringList IrcNetwork::prefixes |
|
read |
This property holds the supported channel user mode prefix characters.
Examples of typical channel user modes:
| Description | Mode | Prefix |
| Channel operator | o | @ |
| Voiced user | v | + |
- Access function:
- QStringList prefixes() const
- Notifier signal:
- void prefixesChanged(const QStringList& prefixes)
- See also
- modes, prefixToMode(), statusPrefixes
◆ requestedCapabilities
| QStringList IrcNetwork::requestedCapabilities |
|
readwrite |
This property holds the requested capabilities.
These capabilities are automatically requested during the handshake, right after requestingCapabilities() has been emitted.
- Access functions:
- QStringList requestedCapabilities() const
- void setRequestedCapabilities(const QStringList& capabilities)
- Notifier signal:
- void requestedCapabilitiesChanged(const QStringList& capabilities)
- See also
- availableCapabilities, activeCapabilities
◆ statusPrefixes
| QStringList IrcNetwork::statusPrefixes |
|
read |
- Since
- 3.4
This property holds the supported message status prefixes.
The server supports messaging channel members who have a certain status or higher.
- Access function:
- QStringList statusPrefixes() const
- Notifier signal:
- void statusPrefixesChanged(const QStringList& prefixes)
- See also
- prefixes