• 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
kgoldrunner.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright 2002 Marco Krüger <grisuji@gmx.de> *
3  * Copyright 2002 Ian Wadham <iandw.au@gmail.com> *
4  * Copyright 2009 Ian Wadham <iandw.au@gmail.com> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 of *
9  * the License, or (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18  ****************************************************************************/
19 
20 #ifndef KGOLDRUNNER_H
21 #define KGOLDRUNNER_H
22 
23 #include "kgrglobals.h"
24 
25 #include <KXmlGuiWindow>
26 
27 class QSignalMapper;
28 class KAction;
29 class KToggleAction;
30 
31 class KGrGame;
32 class KGrView;
33 class KGrScene;
34 class KGrRenderer;
35 
42 class KGoldrunner : public KXmlGuiWindow
43 {
44  Q_OBJECT
45 public:
49  KGoldrunner();
50 
54  virtual ~KGoldrunner();
55 
59  bool startedOK() {return (startupOK);}
60 
61 public slots:
62  void setToggle (const char * actionName, const bool onOff);
63  void setAvail (const char * actionName, const bool onOff);
64  void redrawEditToolbar();
65 
66 protected:
67  void keyPressEvent (QKeyEvent * event);
68  void keyReleaseEvent (QKeyEvent * event);
69 
70 private:
71  bool identifyMoveAction (QKeyEvent * event, bool pressed);
72 
73 protected:
78  void saveProperties (KConfigGroup &);
79 
85  void readProperties (const KConfigGroup &);
86 
88  bool queryClose();
89 
90 private slots:
91  // An extension of the constructor. Gives us two scans of the event queue.
92  void KGoldrunner_2();
93 
94  // Slot to change the graphics theme.
95  void changeTheme ();
96 
97  void optionsConfigureKeys();
98 
99  void gameFreeze (bool); // Status feedback on Pause state.
100 
101  void adjustHintAction (bool); // Enable/disable "Hint" action.
102  void setEditMenu (bool on_off); // Enable/disable "Save Edits" action.
103  void setEditIcon (const QString & actionName, const char iconType);
104  void viewFullScreen (bool activation);
105 
106  QSize sizeHint() const;
107 
108 private:
109  void setupActions();
110  void setupEditToolbarActions();
111 
112  QSignalMapper * tempMapper; // Temporary pointer.
113 
114  KAction * gameAction (const QString & name, const int code,
115  const QString & text, const QString & toolTip,
116  const QString & whatsThis, const QKeySequence & key);
117 
118  KAction * editAction (const QString & name, const int code,
119  const QString & text, const QString & toolTip,
120  const QString & whatsThis);
121 
122  KToggleAction * settingAction (const QString & name,
123  const int code,
124  const QString & text,
125  const QString & toolTip,
126  const QString & whatsThis);
127 
128  KToggleAction * editToolbarAction
129  (const QString & name, const char code,
130  const QString & shortText, const QString & text,
131  const QString & toolTip, const QString & whatsThis);
132 
133  void keyControl (const QString & name, const QString & text,
134  const QKeySequence & shortcut, const int code,
135  const bool mover = false);
136 
137  bool startupOK;
138 
139  KGrGame * game; // Overall control of the gameplay.
140 
141  KGrView * view; // Central widget.
142  KGrScene * scene; // Sets text for game-status messages.
143  KGrRenderer * renderer; // Changes themes and gets icon pixmaps.
144 
145  bool frozen;
146  bool getDirectories(); // Get directory paths, as below.
147 
148  QString systemHTMLDir; // Where the manual is stored.
149  QString systemDataDir; // Where the system levels are stored.
150  QString userDataDir; // Where the user levels are stored.
151 
152  KAction * saveGame; // Save game, level, lives and score.
153 
154  // A KAction is needed here, to get access to KShortcut::setAlternate().
155  KAction * myPause; // Pause or resume the game.
156 
157  KAction * hintAction; // Display a hint, if available.
158  KAction * killHero; // Kill hero (disabled during edits).
159  KAction * highScore; // High scores (disabled during edits).
160 
161  KAction * saveEdits; // Save a level that has been edited.
162 
163  KToolBar * editToolbar; // Toolbar for creating/editing levels.
164 };
165 
166 #endif // KGOLDRUNNER_H
KGoldrunner::~KGoldrunner
virtual ~KGoldrunner()
Default Destructor.
Definition: kgoldrunner.cpp:187
KGoldrunner::setToggle
void setToggle(const char *actionName, const bool onOff)
Definition: kgoldrunner.cpp:758
KGoldrunner::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *event)
Definition: kgoldrunner.cpp:680
KGoldrunner::setAvail
void setAvail(const char *actionName, const bool onOff)
Definition: kgoldrunner.cpp:763
KXmlGuiWindow
KGoldrunner::KGoldrunner
KGoldrunner()
Default Constructor.
Definition: kgoldrunner.cpp:63
KGoldrunner::redrawEditToolbar
void redrawEditToolbar()
Definition: kgoldrunner.cpp:819
KGoldrunner::startedOK
bool startedOK()
Used to indicate if the class initialised properly.
Definition: kgoldrunner.h:59
KGoldrunner::queryClose
bool queryClose()
To save edits before closing.
Definition: kgoldrunner.cpp:933
QString
KGrRenderer
Definition: kgrrenderer.h:61
QSize
QKeyEvent
QKeySequence
kgrglobals.h
KGoldrunner::readProperties
void readProperties(const KConfigGroup &)
This function is called when this app is restored.
Definition: kgoldrunner.cpp:836
KGrView
Definition: kgrview.h:27
KGrGame
Definition: kgrgame.h:45
KGoldrunner::saveProperties
void saveProperties(KConfigGroup &)
This function is called when it is time for the app to save its properties for session management pur...
Definition: kgoldrunner.cpp:827
KGrScene
The QGraphicsScene that represents KGoldrunner on the screen.
Definition: kgrscene.h:75
KGoldrunner::keyPressEvent
void keyPressEvent(QKeyEvent *event)
Definition: kgoldrunner.cpp:670
QSignalMapper
KGoldrunner
This class serves as the main window for KGoldrunner.
Definition: kgoldrunner.h:42
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