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

kblackbox

  • sources
  • kde-4.14
  • kdegames
  • kblackbox
kbbtutorial.h
Go to the documentation of this file.
1 //
2 // KBlackBox
3 //
4 // A simple game inspired by an emacs module
5 //
6 /***************************************************************************
7  * Copyright (c) 2007, Nicolas Roffet *
8  * nicolas-kde@roffet.com *
9  * *
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  * This program is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19  * GNU General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU General Public License *
22  * along with this program; if not, write to the *
23  * Free Software Foundation, Inc., *
24  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
25  ***************************************************************************/
26 
27 #ifndef KBBTUTORIAL_H
28 #define KBBTUTORIAL_H
29 
30 
31 
32 #include <QGroupBox>
33 class QHideEvent;
34 class QLabel;
35 class QProgressBar;
36 class QWidget;
37 
38 
39 class KPushButton;
40 class KTextEdit;
41 
42 
43 class KBBGraphicsItemTutorialMarker;
44 class KBBScalableGraphicWidget;
45 
46 
47 
51 class KBBTutorial : public QGroupBox
52 {
53  Q_OBJECT
54 
55  public:
59  static int const BALLS = 3;
60 
64  static int const COLUMNS = 6;
65 
69  static int const ROWS = 6;
70 
71 
75  explicit KBBTutorial(QWidget* parent);
76 
77 
83  void hideEvent(QHideEvent*);
84 
90  bool maySolve();
91 
97  bool mayShootRay(const int incomingPosition);
98 
102  void setGameWidget(KBBScalableGraphicWidget* gameWidget, KBBGraphicsItemTutorialMarker* marker);
103 
107  void setStep(const int step);
108 
113  void start();
114 
115 
116  private slots:
120  void nextStep();
121 
125  void previousStep();
126 
132  void restoreStyle();
133 
134 
135  private:
139  static int const FIRST_STEP = 1;
140 
146  static int const HIGHLIGHT_TIME = 600;
147 
151  static int const LAST_STEP = 11;
152 
156  static int const MAY_NOT_USE = -1;
157 
163  static int const WIDTH = 275;
164 
165 
171  void setNewStepMaxAllowed(const int newStepMax);
172 
176  void setTexts(const QString &title, const QString &text, const QString &action);
177 
181  void showMarker(const int laserPosition) const;
182 
183 
184  KPushButton* m_buttonNext;
185  KPushButton* m_buttonPrevious;
186  KTextEdit* m_explanation;
187  KBBScalableGraphicWidget* m_gameWidget;
188  int m_laserToUse;
189  KBBGraphicsItemTutorialMarker* m_marker;
190  QLabel* m_playerAction;
191  QProgressBar* m_progression;
192 
196  int m_step;
197 
198  int m_stepMaxAllowed;
199  QLabel* m_title;
200 };
201 
202 #endif //KBBTUTORIAL_H
QHideEvent
KBBGraphicsItemTutorialMarker
Marker used by the tutorial.
Definition: kbbgraphicsitemtutorialmarker.h:42
QProgressBar
QWidget
KBBTutorial::BALLS
static int const BALLS
Number of balls in the tutorial.
Definition: kbbtutorial.h:59
KBBScalableGraphicWidget
Scalable graphic central widget for KBlackBox.
Definition: kbbscalablegraphicwidget.h:62
KBBTutorial::COLUMNS
static int const COLUMNS
Number of columns in the tutorial.
Definition: kbbtutorial.h:64
KBBTutorial::ROWS
static int const ROWS
Number of rows in the tutorial.
Definition: kbbtutorial.h:69
KBBTutorial::maySolve
bool maySolve()
May the player solve the running game?
Definition: kbbtutorial.cpp:125
QGroupBox
KBBTutorial
Tutorial widget.
Definition: kbbtutorial.h:51
KBBTutorial::start
void start()
Start the tutorial Start or restart the tutorial at the 1st step.
Definition: kbbtutorial.cpp:251
QString
KBBTutorial::mayShootRay
bool mayShootRay(const int incomingPosition)
May the player shoot the ray?
Definition: kbbtutorial.cpp:131
QGroupBox::title
QString title() const
KBBTutorial::setGameWidget
void setGameWidget(KBBScalableGraphicWidget *gameWidget, KBBGraphicsItemTutorialMarker *marker)
Define the scalable graphic widget.
Definition: kbbtutorial.cpp:148
KBBTutorial::setStep
void setStep(const int step)
Go to the given tutorial step.
Definition: kbbtutorial.cpp:155
QLabel
QObject::parent
QObject * parent() const
KBBTutorial::hideEvent
void hideEvent(QHideEvent *)
Event: Leaving the tutorial.
Definition: kbbtutorial.cpp:119
KBBTutorial::KBBTutorial
KBBTutorial(QWidget *parent)
Constructor.
Definition: kbbtutorial.cpp:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kblackbox

Skip menu "kblackbox"
  • 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