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

klettres

  • sources
  • kde-4.14
  • kdeedu
  • klettres
  • src
klettresview.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2001-2008 by Anne-Marie Mahfouf *
3  * annma@kde.org *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (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, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef KLETTRESVIEW_H
22 #define KLETTRESVIEW_H
23 
24 #include <KLineEdit>
25 
26 class QPixmap;
27 class QRect;
28 class QSvgRenderer;
29 class KLettres;
30 class KLTheme;
31 
42 class KLettresView : public QWidget
43 {
44  Q_OBJECT
45 public:
49  explicit KLettresView(KLettres *parent);
50 
54  virtual ~KLettresView();
56  void enterLetter(QString letter) { m_letterEdit->setText(letter); }
57 
59  int m_timer;
61  int randomInt;
63  KLettres *m_klettres;
65  KLineEdit *m_letterEdit;
67  void setTheme(KLTheme *theme);
68 
69 protected:
70 
72  void keyReleaseEvent(QKeyEvent * e);
74  int m_cursorPos;
76  int m_random;
78  int m_length;
80  void chooseSound();
82  QString m_currentLetter;
84  QString m_upperLetter;
86  void paintEvent( QPaintEvent * );
88  void paintBackground(QPainter &p, const QRect& rect);
90  void paintLetter(QPainter &p, const QRect& rect);
92  KLTheme *m_theme;
93 
94  // Graphics ----------------
95  QSvgRenderer *m_renderer;
96  QPixmap m_backgroundCache;
97 
98 public slots:
100  void game();
101 
102 protected slots:
104  void slotPlayAgain();
105 
106  void slotProcess(const QString &inputLetter);
107 
108  void slotTimerDone();
109 
110 };
111 
112 #endif // KLETTRESVIEW_H
KLettresView::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *e)
If the user hits backpace.
Definition: klettresview.cpp:234
QWidget
KLettresView::enterLetter
void enterLetter(QString letter)
Enter a letter into the input widget.
Definition: klettresview.h:56
KLettresView::m_random
int m_random
Random number that decides on the letter/syllable and sound.
Definition: klettresview.h:76
KLettresView::~KLettresView
virtual ~KLettresView()
Destructor.
Definition: klettresview.cpp:56
KLettresView::slotProcess
void slotProcess(const QString &inputLetter)
Definition: klettresview.cpp:164
KLettresView::m_renderer
QSvgRenderer * m_renderer
Definition: klettresview.h:95
KLettresView::m_upperLetter
QString m_upperLetter
Current letter entered uppercase i.e. m_inputLetter.upper()
Definition: klettresview.h:84
KLettresView::game
void game()
Start playing displaying a new letter/syllable, playing the associated sound.
Definition: klettresview.cpp:148
KLettresView::slotTimerDone
void slotTimerDone()
Definition: klettresview.cpp:200
QSvgRenderer
KLettresView::setTheme
void setTheme(KLTheme *theme)
set the chosen theme
Definition: klettresview.cpp:87
KLettresView::m_timer
int m_timer
The timer value i.e. the time for displaying the letters/syllables.
Definition: klettresview.h:59
KLettresView::m_klettres
KLettres * m_klettres
A Klettres object.
Definition: klettresview.h:63
KLettresView
This class serves as the view for KLettres.
Definition: klettresview.h:42
KLettresView::m_length
int m_length
Length of the syllables.
Definition: klettresview.h:78
KLettres
Application Main Window.
Definition: klettres.h:41
QRect
KLettresView::paintLetter
void paintLetter(QPainter &p, const QRect &rect)
Paint the letter/syllable in levels 1 and 3.
Definition: klettresview.cpp:133
KLettresView::chooseSound
void chooseSound()
Choose a sound in random and ensure that it's not the same than the previous one. ...
Definition: klettresview.cpp:62
QPainter
QString
KLettresView::m_letterEdit
KLineEdit * m_letterEdit
The line where the user enters his/her input.
Definition: klettresview.h:65
KLettresView::paintBackground
void paintBackground(QPainter &p, const QRect &rect)
Paint the background picture.
Definition: klettresview.cpp:122
QWidget::rect
QRect rect() const
QPixmap
KLettresView::m_backgroundCache
QPixmap m_backgroundCache
Definition: klettresview.h:96
KLettresView::m_cursorPos
int m_cursorPos
Cursor position in the line edit.
Definition: klettresview.h:74
QKeyEvent
KLettresView::m_currentLetter
QString m_currentLetter
Current letter or syllable stored.
Definition: klettresview.h:82
KLettresView::paintEvent
void paintEvent(QPaintEvent *)
Paint the letter/syllable in levels 1 and 3 and the background.
Definition: klettresview.cpp:114
KLettresView::KLettresView
KLettresView(KLettres *parent)
Default constructor.
Definition: klettresview.cpp:38
KLTheme
Definition: kltheme.h:26
QPaintEvent
QObject::parent
QObject * parent() const
KLettresView::randomInt
int randomInt
The index to the random sequence.
Definition: klettresview.h:61
KLettresView::slotPlayAgain
void slotPlayAgain()
Play the same sound again.
Definition: klettresview.cpp:228
KLettresView::m_theme
KLTheme * m_theme
Current theme.
Definition: klettresview.h:92
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

klettres

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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