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 TQWidget 00030 { 00031 Q_OBJECT 00032 TQ_OBJECT 00033 public: 00034 KGameConnectWidget(TQWidget* parent); 00035 virtual ~KGameConnectWidget(); 00036 00040 void setHost(const TQString& host); 00041 00046 TQString host() const; 00047 00051 void setPort(unsigned short int port); 00052 00056 unsigned short int port() const; 00057 00062 void setDefault(int state); 00063 00070 void setType(const TQString& type); 00071 00075 TQString type() const; 00076 00082 void setName(const TQString& name); 00083 00087 TQString gameName() const; 00088 00089 protected slots: 00094 void slotTypeChanged(int); 00095 void slotGamesFound(); 00096 void slotGameSelected(int); 00097 00098 signals: 00099 void signalNetworkSetup(); 00100 void signalServerTypeChanged(int); 00101 00102 private: 00103 void showDnssdControls(); 00104 KGameConnectWidgetPrivate* d; 00105 00106 }; 00107 00117 class KGameConnectDialog : public KDialogBase 00118 { 00119 Q_OBJECT 00120 TQ_OBJECT 00121 public: 00122 KGameConnectDialog(TQWidget* parent = 0,int buttonmask=Ok|Cancel); 00123 virtual ~KGameConnectDialog(); 00124 00135 static int initConnection(unsigned short int& port, TQString& host, TQWidget* parent, bool server = false); 00136 00140 void setHost(const TQString& host); 00141 00146 TQString host() const; 00147 00151 void setPort(unsigned short int port); 00152 00156 unsigned short int port() const; 00157 00162 void setDefault(int state); 00163 00164 signals: 00165 void signalNetworkSetup(); 00166 00167 private: 00168 KGameConnectDialogPrivate* d; 00169 }; 00170 00171 #endif