• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/kggznet

kggzraw.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the kggznet 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 KGGZRAW_H
00022 #define KGGZRAW_H
00023 
00024 #include <QtCore/QObject>
00025 
00026 #include "kggznet_export.h"
00027 
00044 class QAbstractSocket;
00045 class QDataStream;
00046 
00075 class KGGZNET_EXPORT KGGZRaw : public QObject
00076 {
00077     Q_OBJECT
00078     public:
00085         KGGZRaw();
00086 
00092         ~KGGZRaw();
00093 
00099         enum Format
00100         {
00101             QtFormat,
00102             EasysockFormat
00103         };
00104 
00116         void setNetwork(int fd);
00117 
00127         void setFormat(Format format);
00128 
00129         KGGZRaw& operator<<(qint32 i);
00130         KGGZRaw& operator<<(qint8 i);
00131         KGGZRaw& operator<<(QString s);
00132 
00133         KGGZRaw& operator>>(qint32 &i);
00134         KGGZRaw& operator>>(qint8 &i);
00135         KGGZRaw& operator>>(QString &s);
00136 
00137     Q_SIGNALS:
00144         void signalError();
00145 
00146     private Q_SLOTS:
00147         void slotSocketError();
00148 
00149     private:
00150         bool ensureBytes(int bytes);
00151         int peekedStringBytes();
00152         void errorhandler();
00153 
00154         QAbstractSocket *m_socket;
00155         QDataStream *m_net;
00156         Format m_format;
00157 };
00158 
00159 #endif
00160 

libkdegames/kggznet

Skip menu "libkdegames/kggznet"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal