34 #include <boost/variant.hpp> 35 #include <QStringList> 53 typedef boost::variant<bool, StringCommandResult, TextMorphResult>
CommandResult_t;
55 typedef std::function<CommandResult_t (ICLEntry*, QString&)>
Command_f;
60 const bool TryOtherCommands_;
63 :
std::runtime_error { error.toUtf8 ().constData () }
65 , TryOtherCommands_ { canTryOthers }
76 return TryOtherCommands_;
93 , Command_ { command }
98 const QString& descr,
const QString& help)
100 , Command_ { command }
101 , Description_ { descr }
114 virtual StaticCommands_t GetStaticCommands (
ICLEntry*) = 0;
const QString & GetError() const
bool CanTryOtherCommands() const
StaticCommand(const QStringList &names, const Command_f &command, const QString &descr, const QString &help)
virtual ~IProvideCommands()
Represents a single entry in contact list.
boost::variant< bool, StringCommandResult, TextMorphResult > CommandResult_t
Q_DECLARE_INTERFACE(LeechCraft::Azoth::IProvideCommands,"org.LeechCraft.Azoth.IProvideCommands/1.0")
CommandException(const QString &error, bool canTryOthers=false)
std::function< CommandResult_t(ICLEntry *, QString &)> Command_f
QList< StaticCommand > StaticCommands_t
StaticCommand(const QStringList &names, const Command_f &command)