#ifndef OXCHANNEL_H
#define OXCHANNEL_H

#include <stdlib.h>
#include <stdio.h>

#include <xclass/OXClient.h>
#include <xclass/OXWindow.h>
#include <xclass/OXFrame.h>
#include <xclass/OXWidgets.h>
#include <xclass/OXMsgBox.h>
#include <xclass/OXSlider.h>
#include <xclass/OString.h>

#include "OXTextView.h"
#include "OXMyTextEntry.h"
#include "OXNameList.h"
#include "OXIrc.h"

//---------------------------------------------------------------------

class OXChannel : public OXTransientFrame {

friend class OXIrc;

protected:
  OXIrc * _server;

public:
  OXChannel(const OXWindow * p, OXIrc * s, char * ch);
  virtual ~OXChannel();

  void CloseWindow();

  OXChannel * GetChannel(char * ch);

  void Say(char * nick, char * message, int mode);
  void NickList(char * nl);
  void NickJoin(char * nick);
  void NickLeave(char * nick);
  void NickChange(char * o, char * n);
  void Log(char * message);
  void Log(char * message, char * color);

  virtual int ProcessMessage(long msg, long parm1, long parm2);

  char _name[20];

protected:
  OTextDoc * _log;
  OXView * _logw;

  OXCanvas * _canvas;
  OXNameList * _nlist;

  OXCompositeFrame * _f;

  OXMyTextEntry * _sayentry;
  OTextBuffer * _say;

  OXChannel * _next;
};

#endif
