libkdegames/kgame
kgameconnectdialog.h
Go to the documentation of this file.00001 /* 00002 This file is part of the KDE games library 00003 Copyright (C) 2001 Martin Heni (kde at 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 <kdialog.h> 00025 00026 class KGameConnectDialogPrivate; 00027 class KGameConnectWidgetPrivate; 00028 00032 class KGameConnectWidget : public QWidget 00033 { 00034 Q_OBJECT 00035 public: 00036 explicit KGameConnectWidget(QWidget* parent); 00037 virtual ~KGameConnectWidget(); 00038 00042 void setHost(const QString& host); 00043 00048 QString host() const; 00049 00053 void setPort(unsigned short int port); 00054 00058 unsigned short int port() const; 00059 00064 void setDefault(int state); 00065 00071 void setType(const QString& type); 00072 00076 QString type() const; 00077 00083 void setName(const QString& name); 00084 00088 QString gameName() const; 00089 00090 protected Q_SLOTS: 00095 void slotTypeChanged(int); 00096 void slotGamesFound(); 00097 void slotGameSelected(int); 00098 00099 Q_SIGNALS: 00100 void signalNetworkSetup(); 00101 void signalServerTypeChanged(int); 00102 00103 private: 00104 void showDnssdControls(); 00105 KGameConnectWidgetPrivate* d; 00106 00107 }; 00108 00120 class KGameConnectDialog : public KDialog 00121 { 00122 Q_OBJECT 00123 public: 00124 explicit KGameConnectDialog(QWidget* parent = 0,ButtonCodes buttonmask=Ok|Cancel); 00125 virtual ~KGameConnectDialog(); 00126 00137 static int initConnection(unsigned short int& port, QString& host, QWidget* parent, bool server = false); 00138 00142 void setHost(const QString& host); 00143 00148 QString host() const; 00149 00153 void setPort(unsigned short int port); 00154 00158 unsigned short int port() const; 00159 00164 void setDefault(int state); 00165 00166 Q_SIGNALS: 00167 void signalNetworkSetup(); 00168 00169 private: 00170 KGameConnectDialogPrivate* d; 00171 }; 00172 00173 #endif
KDE 4.2 API Reference