2008-08-31 09:08:24 +00:00
|
|
|
#ifndef MIRC_H
|
|
|
|
#define MIRC_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2009-04-17 02:45:22 +00:00
|
|
|
#include <QStringList>
|
2008-08-31 09:08:24 +00:00
|
|
|
#include <QMap>
|
2008-08-31 09:50:57 +00:00
|
|
|
#include <QVector>
|
2009-04-17 02:45:22 +00:00
|
|
|
#include <QTextStream>
|
2008-08-31 09:08:24 +00:00
|
|
|
#include "script.h"
|
2009-04-17 02:45:22 +00:00
|
|
|
#include "parser.h"
|
2008-08-31 09:08:24 +00:00
|
|
|
|
2008-08-31 09:50:57 +00:00
|
|
|
class MIRCScript;
|
|
|
|
|
2008-08-31 09:08:24 +00:00
|
|
|
class MIRCScriptManager : public QObject {
|
|
|
|
Q_OBJECT
|
2008-08-31 09:50:57 +00:00
|
|
|
private:
|
|
|
|
QObject *parent;
|
|
|
|
QVector<MIRCScript> scripts;
|
|
|
|
QMap<QString, QString> _variables;
|
2009-04-17 02:45:22 +00:00
|
|
|
QMap<QString,void (*)(QStringList)> internal_aliases;
|
|
|
|
QMap<QString, mirc_alias> aliases;
|
|
|
|
QTextStream *output;
|
2008-08-31 09:08:24 +00:00
|
|
|
public:
|
2008-08-31 09:50:57 +00:00
|
|
|
MIRCScriptManager(QObject *parent = 0);
|
|
|
|
/*
|
|
|
|
bool load(QString filename);
|
|
|
|
bool unload(QString filename);
|
|
|
|
*/
|
2009-04-17 02:45:22 +00:00
|
|
|
void call_alias(QString alias, QStringList arguments);
|
|
|
|
bool register_alias(QString alias, void (*fn)(QStringList));
|
|
|
|
|
2008-08-31 17:00:39 +00:00
|
|
|
bool hasVariable(QString variable);
|
|
|
|
QString variable(QString variable);
|
|
|
|
void variable(QString variable, QString value);
|
|
|
|
QMap<QString, QString> variables();
|
2008-08-31 09:08:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|