• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kgoldrunner

  • sources
  • kde-4.14
  • kdegames
  • kgoldrunner
  • src
kgrdialog.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright 2003 Ian Wadham <iandw.au@gmail.com> *
3  * Copyright 2009 Ian Wadham <iandw.au@gmail.com> *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ****************************************************************************/
18 
19 #ifndef KGRDIALOG_QT_H
20 #define KGRDIALOG_QT_H
21 
22 #include <QListWidget>
23 #include <QRadioButton>
24 #include <QLineEdit>
25 #include <QTextEdit>
26 #include <QList>
27 
28 #include <KLocale>
29 #include <KDialog>
30 #include <KMessageBox>
31 
32 class QButtonGroup;
33 class QLabel;
34 
39 class KGrGameData;
40 
41 /*******************************************************************************
42 *************** DIALOG BOX TO CREATE/EDIT A LEVEL NAME AND HINT ****************
43 *******************************************************************************/
44 
45 class KGrNHDialog : public KDialog
46 {
47 Q_OBJECT
48 public:
49  KGrNHDialog (const QString & levelName, const QString & levelHint,
50  QWidget * parent = 0);
51  ~KGrNHDialog();
52 
53  const QString getName() {return (nhName->text());}
54  const QString getHint() {return (mle->toPlainText());}
55 
56 private:
57  QLineEdit * nhName;
58  QTextEdit * mle;
59 };
60 
61 /*******************************************************************************
62 ***************** DIALOG TO CREATE OR EDIT A GAME (COLLECTION) *****************
63 *******************************************************************************/
64 
65 class KGrECDialog : public KDialog
66 {
67 Q_OBJECT
68 public:
69  KGrECDialog (int action, int collnIndex,
70  QList<KGrGameData *> & gameList,
71  QWidget *parent = 0);
72  ~KGrECDialog();
73 
74  const QString getName() {return (ecName->text());}
75  const QString getPrefix() {return (ecPrefix->text());}
76  bool isTrad() {return (ecTradB->isChecked());}
77  const QString getAboutText() {return (mle->toPlainText());}
78 
79 private slots:
80  void ecSetRules (const char rules);
81  void ecSetKGr(); // Radio button slots.
82  void ecSetTrad();
83 
84 private:
85  QList<KGrGameData *> myGameList; // List of existing games.
86  int defaultGame;
87 
88  QLabel * nameL;
89  QLineEdit * ecName;
90  QLabel * prefixL;
91  QLineEdit * ecPrefix;
92  QButtonGroup * ecGrp;
93  QRadioButton * ecKGrB;
94  QRadioButton * ecTradB;
95  QLabel * nLevL;
96 
97  QLabel * mleL;
98  QTextEdit * mle;
99 };
100 
101 /*******************************************************************************
102 *************** DIALOG TO SELECT A SAVED GAME TO BE RE-LOADED ****************
103 *******************************************************************************/
104 
105 class QFile;
106 
107 class KGrLGDialog : public KDialog
108 {
109 Q_OBJECT
110 public:
111  KGrLGDialog (QFile * savedGames, QList<KGrGameData *> & gameList,
112  QWidget * parent);
113  const QString getCurrentText() {return (lgList->currentItem()->text());}
114 
115 private slots:
116  void lgSelect (QListWidgetItem * item);
117 
118 private:
119  QListWidget * lgList;
120  int lgHighlight;
121 };
122 
123 #endif
QWidget
QListWidget::currentItem
QListWidgetItem * currentItem() const
KGrGameData
KGrGameData structure: contains attributes of a KGoldrunner game.
Definition: kgrglobals.h:88
QLineEdit::text
text
KGrECDialog::getPrefix
const QString getPrefix()
Definition: kgrdialog.h:75
QListWidgetItem
KGrNHDialog::KGrNHDialog
KGrNHDialog(const QString &levelName, const QString &levelHint, QWidget *parent=0)
Definition: kgrdialog.cpp:36
KGrECDialog
Definition: kgrdialog.h:65
KGrLGDialog::getCurrentText
const QString getCurrentText()
Definition: kgrdialog.h:113
KDialog
KGrECDialog::~KGrECDialog
~KGrECDialog()
Definition: kgrdialog.cpp:205
QTextEdit::toPlainText
QString toPlainText() const
QListWidget
KGrLGDialog::KGrLGDialog
KGrLGDialog(QFile *savedGames, QList< KGrGameData * > &gameList, QWidget *parent)
Definition: kgrdialog.cpp:226
KGrNHDialog::~KGrNHDialog
~KGrNHDialog()
Definition: kgrdialog.cpp:78
QFile
KGrNHDialog
Definition: kgrdialog.h:45
QButtonGroup
KGrECDialog::isTrad
bool isTrad()
Definition: kgrdialog.h:76
QString
QList< KGrGameData * >
KGrLGDialog
Definition: kgrdialog.h:107
KGrECDialog::getAboutText
const QString getAboutText()
Definition: kgrdialog.h:77
QAbstractButton::isChecked
bool isChecked() const
KGrNHDialog::getHint
const QString getHint()
Definition: kgrdialog.h:54
KGrECDialog::KGrECDialog
KGrECDialog(int action, int collnIndex, QList< KGrGameData * > &gameList, QWidget *parent=0)
Definition: kgrdialog.cpp:86
QRadioButton
KGrNHDialog::getName
const QString getName()
Definition: kgrdialog.h:53
QLineEdit
KGrECDialog::getName
const QString getName()
Definition: kgrdialog.h:74
QLabel
QTextEdit
QListWidgetItem::text
QString text() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgoldrunner

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

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal