29#ifndef IRCCOMMANDPARSER_H
30#define IRCCOMMANDPARSER_H
34#include <QtCore/qobject.h>
35#include <QtCore/qmetatype.h>
36#include <QtCore/qstringlist.h>
40class IrcCommandParserPrivate;
45 Q_PROPERTY(QStringList commands READ commands NOTIFY commandsChanged)
46 Q_PROPERTY(QStringList triggers READ triggers WRITE setTriggers NOTIFY triggersChanged)
47 Q_PROPERTY(QStringList channels READ channels WRITE setChannels NOTIFY channelsChanged)
48 Q_PROPERTY(QString target READ target WRITE setTarget NOTIFY targetChanged)
49 Q_PROPERTY(
bool tolerant READ isTolerant WRITE setTolerant NOTIFY tolerancyChanged)
56 QStringList commands() const;
68 Q_DECLARE_FLAGS(Details, Detail)
70 Q_INVOKABLE QString syntax(
const QString& command, Details details = Visual)
const;
73 Q_INVOKABLE
void removeCommand(
IrcCommand::Type type,
const QString& syntax = QString());
75 QStringList triggers()
const;
77 QString target()
const;
78 QStringList channels()
const;
80 bool isTolerant()
const;
81 void setTolerant(
bool tolerant);
83 Q_INVOKABLE
IrcCommand* parse(
const QString& input)
const;
89 void setTriggers(
const QStringList& triggers);
90 void setChannels(
const QStringList& channels);
91 void setTarget(
const QString& target);
94 void commandsChanged(
const QStringList& commands);
95 void triggersChanged(
const QStringList& triggers);
96 void channelsChanged(
const QStringList& channels);
97 void targetChanged(
const QString& target);
98 void tolerancyChanged(
bool tolerant);
101 QScopedPointer<IrcCommandParserPrivate> d_ptr;
106Q_DECLARE_OPERATORS_FOR_FLAGS(IrcCommandParser::Details)
Parses commands from user input.
Definition irccommandparser.h:43
bool tolerant
Definition irccommandparser.h:49
IrcCommandParser(QObject *parent=nullptr)
Definition irccommandparser.cpp:337
Detail
Definition irccommandparser.h:58
@ NoPrefix
The syntax has #channel prefixes removed.
Definition irccommandparser.h:61
@ Full
The syntax in full details.
Definition irccommandparser.h:59
@ NoEllipsis
The syntax has ellipsis... removed.
Definition irccommandparser.h:62
@ Visual
The syntax suitable for visual representation.
Definition irccommandparser.h:66
@ NoAngles
The syntax has angle brackets <> removed.
Definition irccommandparser.h:65
@ NoBrackets
The syntax has brackets [] removed.
Definition irccommandparser.h:64
@ NoTarget
The syntax has injected [target] removed.
Definition irccommandparser.h:60
@ NoParentheses
The syntax has parentheses () removed.
Definition irccommandparser.h:63
Provides the most common commands.
Definition irccommand.h:45
Type
Definition irccommand.h:55