51 lines
1.0 KiB
C++
51 lines
1.0 KiB
C++
#ifndef MODULE_H
|
|
#define MODULE_H
|
|
|
|
#include <QString>
|
|
#include <vector>
|
|
|
|
class UserList;
|
|
class Message;
|
|
|
|
class Module
|
|
{
|
|
private:
|
|
bool enabled;
|
|
QString nick;
|
|
QString chan;
|
|
std::vector<Module*>* modules;
|
|
|
|
protected:
|
|
QString answer;
|
|
|
|
QString getNick();
|
|
QString getChan();
|
|
int getNbModules();
|
|
Module* getModule(int index);
|
|
UserList* getUsers();
|
|
|
|
QString pong(QString target);
|
|
QString join(QString theChan);
|
|
QString privateSay(QString str, QString target);
|
|
QString whois(QString nick);
|
|
QString say(QString str);
|
|
QString action(QString str);
|
|
QString quit(QString str);
|
|
|
|
public:
|
|
Module() : enabled(true), modules(NULL) {}
|
|
|
|
virtual bool messageHandler(Message msg) = 0;
|
|
virtual QString getName() = 0;
|
|
|
|
QString getAnswer();
|
|
bool isEnabled();
|
|
void setEnabled(bool newStatus);
|
|
void setNick(QString nick_);
|
|
void setChan(QString chan_);
|
|
void setModuleList(std::vector<Module*>* modList);
|
|
//TODO: add serialization methods
|
|
};
|
|
|
|
#endif // MODULE_H
|