GXmlNetwork.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 - 2005 by Raphael Langerhorst                      *
00003  *   raphael-langerhorst@gmx.at                                            *
00004  *                                                                         *
00005  *   Permission is hereby granted, free of charge, to any person obtaining *
00006  *   a copy of this software and associated documentation files (the       *
00007  *   "Software"), to deal in the Software without restriction, including   *
00008  *   without limitation the rights to use, copy, modify, merge, publish,   *
00009  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00010  *   permit persons to whom the Software is furnished to do so, subject to *
00011  *   the following conditions:                                             *
00012  *                                                                         *
00013  *   The above copyright notice and this permission notice shall be        *
00014  *   included in all copies or substantial portions of the Software.       *
00015  *                                                                         *
00016  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00017  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00018  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00019  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00020  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00021  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00022  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
00023  ***************************************************************************/
00024 
00025 #ifndef GXMLNETWORK_H
00026 #define GXMLNETWORK_H
00027 
00028 #include <qobject.h>
00029 #include <qdom.h>
00030 
00031 namespace GWE
00032 {
00033 
00049 class GXmlNetwork : public QObject
00050 {
00051   Q_OBJECT
00052 
00053   public:
00054   
00058    GXmlNetwork(QObject *parent = 0)
00059      : QObject(parent)
00060      {}
00061    
00065    virtual ~GXmlNetwork() {}
00066    
00067    // NETWORK MANAGEMENT
00068 
00072    virtual bool isConnected() = 0;
00073 
00077    virtual QString getNetworkId() const = 0;
00078    
00082    virtual QString getMasterServer() const = 0;
00083 
00084   public slots:
00085   
00089    virtual void setNetworkId(const QString& id) = 0;
00090    
00094    virtual void setMasterServer(const QString& master) = 0;
00095    
00099    virtual bool initNetwork() = 0;
00100    
00107    virtual bool closeNetwork() = 0;
00108    
00112    virtual void setPassword(const QString& password) = 0;
00113  
00114    // DATA TRANSPORTING
00115    
00124    virtual bool send(QDomElement data, const QString& destination) = 0;
00125 
00130    virtual bool send(const QString& data) = 0;
00131    
00135    virtual bool flushOutput() = 0;
00136    
00140    virtual void makeDestinationAvailable(const QString& destination) = 0;
00141    
00142    signals:
00143    
00144      // NETWORK MANAGEMENT
00145    
00149      void networkConnected();
00150     
00156      void networkDisconnected();
00157     
00162      void networkError(int error_num, const QString& description, const QString& peer);
00163     
00167      void peerDisconnected(const QString& peerNetworkId);
00168     
00169      // DATA TRANSPORTING
00170     
00175      void dataAvailable(QDomElement data, const QString& source_peer);
00176      
00181      void presenceChanged(QString server, bool available);
00182 };
00183 
00184 }  //GWE namespace
00185 
00186 #endif //GXMLNETWORK_H
00187 

Generated on Thu Nov 16 07:49:12 2006 for G System by  doxygen 1.4.7