kgoldrunner
kgrdialog.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef KGRDIALOG_QT_H
00011 #define KGRDIALOG_QT_H
00012
00013 #include <KLocale>
00014 #include <KDialog>
00015 #include <KMessageBox>
00016
00017
00018 #include <QListWidget>
00019 #include <QTreeWidget>
00020 #include <QTreeWidgetItem>
00021
00022 #include <QScrollBar>
00023
00024 #include <QLineEdit>
00025 #include <QSpinBox>
00026 #include <QPushButton>
00027 #include <QButtonGroup>
00028 #include <QRadioButton>
00029 #include <QList>
00030 #include <QLabel>
00031 #include <QTextEdit>
00032
00037 class KGrGame;
00038 class KGrCollection;
00039 class KGrThumbNail;
00040 class KGrGameListItem;
00041
00042
00043
00044
00045
00046 class KGrSLDialog : public KDialog
00047 {
00048 Q_OBJECT
00049 public:
00050 KGrSLDialog (int action, int requestedLevel, int collnIndex,
00051 QList<KGrCollection *> & gamesList, KGrGame * theGame,
00052 QWidget * parent = 0);
00053 ~KGrSLDialog();
00054
00055 int selectedLevel() {return (number->value());}
00056 int selectedGame() {return (slCollnIndex);}
00057
00058 private slots:
00059 void slSetCollections (int cIndex);
00060 void slColln ();
00061 void slShowLevel (int i);
00062 void slUpdate (const QString & text);
00063 void slPaintLevel ();
00064 void slotHelp ();
00065
00066 private:
00067 int slAction;
00068 QList<KGrCollection *> collections;
00069 int defaultLevel;
00070 int defaultGame;
00071 int slCollnIndex;
00072 KGrGame * game;
00073 KGrCollection * collection;
00074 QWidget * slParent;
00075
00076 QLabel * collnL;
00077 QTreeWidget * colln;
00078 QLabel * collnN;
00079 QLabel * collnD;
00080 QPushButton * collnA;
00081 QTextEdit * collnAbout;
00082
00083 QLabel * numberL;
00084 QSpinBox * display;
00085 QScrollBar * number;
00086
00087 QPushButton * levelNH;
00088 QLabel * slName;
00089 KGrThumbNail * thumbNail;
00090 };
00091
00092
00093
00094
00095
00096 class KGrNHDialog : public KDialog
00097 {
00098 Q_OBJECT
00099 public:
00100 KGrNHDialog (const QString & levelName, const QString & levelHint,
00101 QWidget * parent = 0);
00102 ~KGrNHDialog();
00103
00104 const QString getName() {return (nhName->text());}
00105 const QString getHint() {return (mle->toPlainText ());}
00106
00107 private:
00108 QLineEdit * nhName;
00109 QTextEdit * mle;
00110 };
00111
00112
00113
00114
00115
00116 class KGrECDialog : public KDialog
00117 {
00118 Q_OBJECT
00119 public:
00120 KGrECDialog (int action, int collnIndex,
00121 QList<KGrCollection *> & gamesList,
00122 QWidget *parent = 0);
00123 ~KGrECDialog();
00124
00125 const QString getName() {return (ecName->text());}
00126 const QString getPrefix() {return (ecPrefix->text());}
00127 const bool isTrad() {return (ecTradB->isChecked());}
00128 const QString getAboutText() {return (mle->toPlainText());}
00129
00130 private slots:
00131 void ecSetRules (const char settings);
00132 void ecSetKGr();
00133 void ecSetTrad();
00134
00135 private:
00136 QList<KGrCollection *> collections;
00137 int defaultGame;
00138
00139 QLabel * nameL;
00140 QLineEdit * ecName;
00141 QLabel * prefixL;
00142 QLineEdit * ecPrefix;
00143 QButtonGroup * ecGrp;
00144 QRadioButton * ecKGrB;
00145 QRadioButton * ecTradB;
00146 QLabel * nLevL;
00147
00148 QLabel * mleL;
00149 QTextEdit * mle;
00150 };
00151
00152
00153
00154
00155
00156 #include <QFile>
00157 #include <qtextstream.h>
00158
00159 class KGrLGDialog : public KDialog
00160 {
00161 Q_OBJECT
00162 public:
00163 KGrLGDialog (QFile * savedGames, QList<KGrCollection *> & collections,
00164 QWidget * parent);
00165 const QString getCurrentText() {return (lgList->currentItem()->text());}
00166
00167 private slots:
00168 void lgSelect (QListWidgetItem * item);
00169
00170 private:
00171 QListWidget * lgList;
00172 int lgHighlight;
00173 };
00174
00175
00176
00177
00178
00179 class KGrMessage : public QDialog
00180 {
00181 public:
00182 static void information (QWidget * parent, const QString &caption,
00183 const QString &text);
00184 static int warning (QWidget * parent, const QString &caption,
00185 const QString &text, const QString &label0,
00186 const QString &label1, const QString &label2 = "");
00187 };
00188
00189
00190
00191
00192
00193 class KGrGameListItem : public QTreeWidgetItem
00194 {
00195 public:
00196 KGrGameListItem (const QStringList & data, const int internalId = -1);
00197 int id () const;
00198 void setId (const int internalId);
00199 private:
00200 int mInternalId;
00201 };
00202
00203 #endif