
#ifndef CLIENT_H
#define CLIENT_H

#include <list>

#include "protocol.h"

enum action
{
    ACT_CONTINUE,
    ACT_CLOSE_CONNECTION
};

class hook
{
public:
    virtual action acceptMessage(message* m) { return ACT_CLOSE_CONNECTION; };
    virtual void   connectionClosed(void) {};
    virtual void   badMessageReceived(void) {};
};

class client
{
public:
    virtual void setHook(hook& h) = 0;
    virtual bool active(void) = 0;
    virtual bool connect(const char* hostName, int port) = 0;
    virtual void disconnect(void) = 0;
    virtual void send(const char* msg) = 0;
};

extern client* cl;

#endif