summaryrefslogtreecommitdiffstats
path: root/lskat/lskat/KEInput.h
blob: ee84e5085ed35614ff6b1991976adf1fbe98d058 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/***************************************************************************
                          KEInput.h  -  description
                             -------------------
    begin                : Tue May 2 2000
    copyright            : (C) 2000 by Martin Heni
    email                : martin@heni-online.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 _KEINPUT_H_
#define _KEINPUT_H_

#include <tqptrlist.h>
#include <tqobject.h>
#include <tqtimer.h>
#include <tqmemarray.h>
#include "KConnectEntry.h"
#include "KRemoteConnect.h"
#include "TDEProcessConnect.h"
#include "KInteractiveConnect.h"
#include "KEMessage.h"
#include "KConnectTypes.h"


class KEInput : public TQObject
{
   TQ_OBJECT
  

  private:
   int number_of_inputs;
   int previous_input,next_input;
   bool locked;
//   KEMessage *mMsg;
   TQTimer *cTimer;

   TQPtrList<KRemoteConnect> remoteList;
   TQPtrList<TDEProcessConnect> computerList;
   TQPtrList<KInteractiveConnect> interactiveList;
   TQMemArray<KConnectEntry> playerArray;

  public:
   KEInput(TQObject * parent=0);
   ~KEInput();
   int QueryNumberOfInputs();
   int QueryNext();
   bool IsInteractive(int no=-1);
   bool IsProcess(int no=-1);
   bool IsRemote(int no=-1);
   int QueryPrevious();
   KG_INPUTTYPE QueryType(int no=-1);
   KR_STATUS QueryStatus(int no=-1);
   bool IsInput(int no);
   bool SetInputDevice(int no, KG_INPUTTYPE type, KEMessage *msg=0);
   bool RemoveInput(int no);
   bool Next(int number, bool force=false);
   bool SetInput(KEMessage *msg,int number=-1);
   bool IsLocked();
   bool SendMsg(KEMessage *msg,int no=-1);
   void Unlock();
   void Lock();

  public slots:
   void slotTimerNextRemote();
   void slotTimerNextProcess();
   void slotSetInput(KEMessage *msg,int id);
   void slotPrepareMove(KEMessage *msg,KG_INPUTTYPE type);

  signals:
  void signalReceiveInput(KEMessage *msg,int id);
  void signalPrepareRemoteMove(KEMessage *msg);
  void signalPrepareProcessMove(KEMessage *msg);
  void signalPrepareInteractiveMove(KEMessage *msg);

};
#endif