2
* Copyright (C) 2008 Martin Hostettler
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
// manager mini command system
25
#include <QStringList>
32
// implementation in groupchatdlg.cpp
33
void MiniCommand_Depreciation_Message(const QString &old,const QString &newCmd, QString &line1, QString &line2);
35
class MCmdSimpleState : public QObject, public MCmdStateIface
39
MCmdSimpleState(QString name, QString prompt);
40
MCmdSimpleState(QString name, QString prompt, int flags);
42
virtual QString getName() { return name_;};
44
virtual QString getPrompt() { return prompt_;};
46
virtual int getFlags() { return flags_;};
48
virtual const QHash<QString, QVariant> &getInfo() { return info_; };
50
virtual void dispose() { delete(this); };
52
virtual ~MCmdSimpleState();
55
QHash<QString, QVariant> info_;
58
bool unhandled(QStringList command);
61
QString name_, prompt_;
66
class MCmdManager : public MCmdManagerIface
70
MCmdManager(MCmdUiSiteIface* site_);
73
virtual bool processCommand(QString command);
74
virtual QStringList completeCommand(QString &command, int pos, int &start, int &end);
75
virtual bool open(MCmdStateIface *state, QStringList preset);
77
virtual bool isActive();
80
// Provider registratation
81
virtual void registerProvider(MCmdProviderIface *prov);
84
QStringList parseCommand(const QString command, int pos, int &part, QString &partial, int &start, int &end, char "edAtPos);
85
QString serializeCommand(const QStringList &list);
87
QList<MCmdProviderIface*> providers_;
88
MCmdStateIface *state_;
90
MCmdUiSiteIface *uiSite_;