SparrowBot/sparrowbot.h
2015-05-21 19:50:54 +02:00

39 lines
809 B
C++

#ifndef SPARROWBOT_H
#define SPARROWBOT_H
#include "user.h"
#include "message.h"
#include <QObject>
class SparrowBot : public QObject
{
Q_OBJECT
enum{OFFLINE, ONLINE, ON_CHAN};
std::string nick;
std::string chan;
int status;
UserList users;
public:
SparrowBot() : nick("SparrowBot"), chan("epicsparrow"), status(OFFLINE) {}
SparrowBot(std::string nick_, std::string chan_) : nick(nick_), chan(chan_), status(OFFLINE) {}
private:
void handleMessage(Message msg);
void say(std::string str);
void action(std::string str);
void sendRawMessage(std::string str);
public slots:
void receiveMsg(QString msg);
void forceStatus(int newStatus);
signals:
void sendMsg(QString msg);
void changeSocketStatus(int newStatus);
};
#endif // SPARROWBOT_H