kgameconnectdialog.h

00001 /*
00002     This file is part of the KDE games library
00003     Copyright (C) 2001 Martin Heni (martin@heni-online.de)
00004     Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License version 2 as published by the Free Software Foundation.
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 __KGAMECONNECTDIALOG_H__
00022 #define __KGAMECONNECTDIALOG_H__
00023 
00024 #include <kdialogbase.h>
00025 
00026 class KGameConnectDialogPrivate;
00027 class KGameConnectWidgetPrivate;
00028 
00029 class KGameConnectWidget : public QWidget
00030 {
00031     Q_OBJECT
00032 public:
00033     KGameConnectWidget(QWidget* parent);
00034     virtual ~KGameConnectWidget();
00035 
00039     void setHost(const QString& host);
00040 
00045     QString host() const;
00046 
00050     void setPort(unsigned short int port);
00051 
00055     unsigned short int port() const;
00056 
00061     void setDefault(int state);
00062     
00069     void setType(const QString& type);
00070     
00074     QString type() const;
00075     
00081     void setName(const QString& name);
00082     
00086     QString gameName() const;
00087 
00088 protected slots:
00093     void slotTypeChanged(int);
00094     void slotGamesFound();
00095     void slotGameSelected(int);
00096 
00097 signals:
00098     void signalNetworkSetup();
00099   void signalServerTypeChanged(int);
00100 
00101 private:
00102     void showDnssdControls();
00103     KGameConnectWidgetPrivate* d;
00104 
00105 };
00106 
00116 class KGameConnectDialog : public KDialogBase
00117 {
00118     Q_OBJECT
00119 public:
00120     KGameConnectDialog(QWidget* parent = 0,int buttonmask=Ok|Cancel);
00121     virtual ~KGameConnectDialog();
00122     
00133     static int initConnection(unsigned short int& port, QString& host, QWidget* parent, bool server = false);
00134 
00138     void setHost(const QString& host);
00139 
00144     QString host() const;
00145 
00149     void setPort(unsigned short int port);
00150 
00154     unsigned short int port() const;
00155 
00160     void setDefault(int state);
00161 
00162 signals:
00163     void signalNetworkSetup();
00164 
00165 private:
00166     KGameConnectDialogPrivate* d;
00167 };
00168 
00169 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys