summaryrefslogtreecommitdiffstats
path: root/knights/io_base.h
blob: 6dd2fc5c8669c24ac91c725b625de4853f96d8ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/***************************************************************************
                          io_base.h  -  description
                             -------------------
    begin                : Tue Jun 18 2002
    copyright            : (C) 2003 by Troy Corbin Jr.
    email                : tcorbin@users.sf.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef IO_BASE_H
#define IO_BASE_H


#include "definitions.h"
#include "resource.h"
#include "command.h"
#include "match_param.h"

#include <tqobject.h>
#include <tqwidget.h>
/**
  *@author Alexander Wels.
  */

class io_base : public TQObject
{
  Q_OBJECT
  

public:

  enum ioType
  {
    INTERNET = 0,
    LOCAL = 1
  };

  io_base(TQWidget *parent=NULL, resource *rsrc=NULL);
  io_base(resource *rsrc);
  io_base(resource *rsrc, int ID);
  virtual               ~io_base();
  int                   getID( void );
  void                  setID( const int ID );
  int                   getType( void );

public slots:
  virtual void          recvCMD(const Command& command) = 0; // sub classes have to implement this

signals:
  virtual void          sendCMD(const Command& command) = 0; // sub classes have to implement this


protected:
  // The knightio object needs to know its ID
  TQWidget *myParent;
  int myID;
  resource *myResource;
  ioType myType;
};

#endif