libkdegames/kggzmod
module.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KGGZMOD_MODULE_H
00022 #define KGGZMOD_MODULE_H
00023
00024 #include <kggzmod/request.h>
00025 #include <kggzmod/event.h>
00026
00027 #include <QtCore/QObject>
00028 #include <QtCore/QList>
00029
00030 #include "kggzmod_export.h"
00031
00048 namespace KGGZMod
00049 {
00050
00051 class ModulePrivate;
00052 class Player;
00053
00082 class KGGZMOD_EXPORT Module : public QObject
00083 {
00084 Q_OBJECT
00085 public:
00095 Module(const QString &name);
00096 ~Module();
00097
00105 enum State
00106 {
00107 created,
00108 connected,
00109 waiting,
00110 playing,
00111 done
00112 };
00113
00122 void sendRequest(Request request);
00123
00130 QList<Player*> players() const;
00131
00135 QList<Player*> spectators() const;
00136
00140 State state() const;
00141
00150 static bool isGGZ();
00151
00158 Player *self() const;
00159
00170 static Module *instance();
00171
00172 Q_SIGNALS:
00181 void signalEvent(const KGGZMod::Event& event);
00182
00190 void signalError();
00191
00204 void signalNetwork(int fd);
00205
00206 private:
00207 ModulePrivate *d;
00208 };
00209
00210 }
00211
00212 #endif
00213