libkdegames/kggzmod
event.h
Go to the documentation of this file.00001 /* 00002 This file is part of the kggzmod library. 00003 Copyright (c) 2005 - 2007 Josef Spillner <josef@ggzgamingzone.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KGGZMOD_EVENT_H 00022 #define KGGZMOD_EVENT_H 00023 00024 #include <QtCore/QMap> 00025 #include <QtCore/QString> 00026 00027 #include "kggzmod_export.h" 00028 00029 namespace KGGZMod 00030 { 00031 00032 class Player; 00033 00055 class KGGZMOD_EXPORT Event 00056 { 00057 friend class ModulePrivate; 00058 00059 public: 00065 enum Type 00066 { 00067 launch, 00068 server, 00069 self, 00070 seat, 00071 chat, 00072 stats, 00073 info, 00074 rankings 00075 }; 00076 00088 Event(Type type); 00089 00095 Type type() const; 00096 00104 Player *player() const; 00105 00112 QMap<QString, QString> data; 00113 00114 protected: 00115 Player *m_player; 00116 00117 private: 00118 Type m_type; 00119 }; 00120 00131 class LaunchEvent : public Event 00132 { 00133 public: 00134 LaunchEvent(const Event& event); 00135 }; 00136 00148 class KGGZMOD_EXPORT ServerEvent : public Event 00149 { 00150 public: 00151 ServerEvent(const Event& event); 00152 int fd() const; 00153 }; 00154 00166 class SelfEvent : public Event 00167 { 00168 public: 00169 SelfEvent(const Event& event); 00170 Player *self() const; 00171 }; 00172 00184 class SeatEvent : public Event 00185 { 00186 public: 00187 SeatEvent(const Event& event); 00188 Player *player() const; 00189 }; 00190 00202 class ChatEvent : public Event 00203 { 00204 public: 00205 ChatEvent(const Event& event); 00206 Player *player() const; 00207 QString message() const; 00208 }; 00209 00223 class StatsEvent : public Event 00224 { 00225 public: 00226 StatsEvent(const Event& event); 00227 Player *player() const; 00228 }; 00229 00241 class InfoEvent : public Event 00242 { 00243 public: 00244 InfoEvent(const Event& event); 00245 Player *player() const; 00246 }; 00247 00262 class KGGZMOD_EXPORT RankingsEvent : public Event 00263 { 00264 public: 00265 RankingsEvent(const Event& event); 00266 int count() const; 00267 QString name(int i) const; 00268 int score(int i) const; 00269 }; 00270 00271 } 00272 00273 #endif 00274
KDE 4.0 API Reference