• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kgoldrunner

kgrdialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     Copyright 2003 Marco Krüger <grisuji@gmx.de>
00003     Copyright 2003 Ian Wadham <ianw2@optusnet.com.au>
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
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 // IDW #include <QSlider>
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 /*******************    DIALOG TO SELECT A GAME AND LEVEL   *******************/
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 ();               // Will replace KDE slotHelp().
00065 
00066 private:
00067     int         slAction;
00068     QList<KGrCollection *> collections; // List of games.
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     // IDW QSlider *        number;
00087     QPushButton *   levelNH;
00088     QLabel *        slName;
00089     KGrThumbNail *  thumbNail;
00090 };
00091 
00092 /*******************************************************************************
00093 *************** DIALOG BOX TO CREATE/EDIT A LEVEL NAME AND HINT ****************
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 ***************** DIALOG TO CREATE OR EDIT A GAME (COLLECTION) *****************
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();    // Radio button slots.
00133     void ecSetTrad();
00134 
00135 private:
00136     QList<KGrCollection *> collections; // List of existing games.
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 ***************  DIALOG TO SELECT A SAVED GAME TO BE RE-LOADED  ****************
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 ******************  PORTABLE MESSAGE FUNCTIONS (Qt Version)  *******************
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 *************************  ITEM FOR THE LIST OF GAMES  *************************
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

kgoldrunner

Skip menu "kgoldrunner"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal