Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

query_dialog.h

00001 /*
00002  *   EasySok --- A(nother) sokoban game for KDE.
00003  *
00004  *   Copyright (C) 2001 by Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
00005  *
00006  *   This program is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2 as
00008  *   published by the Free Software Foundation.
00009  *
00010  *   This program 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
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the Free Software
00017  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 
00021 #ifndef EASYSOK_SETUP_USER_DIALOG_INC_GUARD_H
00022 #define EASYSOK_SETUP_USER_DIALOG_INC_GUARD_H
00023 
00024 
00025 #include <qmessagebox.h>
00026 #include <qstring.h>
00027 
00028 
00029 class KURL;
00030 class QSocket;
00031 
00032 
00033 
00034 
00042 class QueryDialog : public QMessageBox
00043 {
00044     Q_OBJECT
00045 
00046 public:
00047 
00061     QueryDialog(QString const & caption, QString const & text, KURL const & server,
00062                 QString const & proxy, int proxy_port, QString const & script,
00063                 QString const & query, QWidget * parent = 0);
00064 
00065 
00070     enum Result
00071     {
00076         OK = 0,
00077 
00078 
00083         ABORTED = 1,
00084 
00085 
00090         COULD_NOT_CONNECT_SERVER = 2,
00091 
00092 
00097         COULD_NOT_CONNECT_DATABASE = 3,
00098 
00099 
00104         INVALID_NICKNAME = 4,
00105 
00106 
00111         USER_NOT_FOUND = 5,
00112 
00113 
00118         INVALID_PASSWORD = 6,
00119 
00120 
00125         COULD_NOT_UPDATE_DATABASE = 7,
00126 
00127 
00132         USER_ALREADY_EXISTS = 8,
00133 
00134 
00139         MAP_DOES_NOT_EXISTS = 9,
00140 
00141 
00146         SOLUTION_IS_INVALID = 10,
00147 
00148 
00153         LEVEL_NOT_SOLVED = 11,
00154 
00155 
00160         TOO_MANY_USERS = 12
00161     };
00162 
00163 
00168     Result result() const;
00169 
00170 
00175     QString resultText() const;
00176 
00177 
00182     QString data() const;
00183 
00184 
00189     int version() const;
00190 
00191 
00192 protected slots:
00193 
00198     void read();
00199 
00200 
00205     void closed();
00206 
00207 
00212     void error();
00213 
00214 
00219     void connected();
00220 
00221 
00226     void connectToHost();
00227 
00228 
00229 private:
00230 
00235     QString m_server_data;
00236 
00237 
00242     QSocket * m_socket;
00243 
00244 
00249     QString m_script;
00250 
00251 
00256     QString m_query;
00257 
00258 
00263     Result m_result;
00264 
00265 
00270     QString m_path;
00271 
00272 
00277     QString m_host;
00278 
00279 
00284     int m_port;
00285 
00286 
00291     QString m_data;
00292 
00293 
00298     int m_version;
00299 };
00300 
00301 
00302 #endif

Generated at Sun Jan 6 18:49:09 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001