1 /***************************************************************************
2 * Copyright (C) 2001-2005 by Anne-Marie Mahfouf *
3 * annemarie.mahfouf@free.fr *
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. *
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. *
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef KLETTRESVIEW_H
22 #define KLETTRESVIEW_H
26 #include <klineedit.h>
32 * This class serves as the view for KLettres. It holds the GUI for the kid and grown-up looks
33 * and has the code to display the letter/syllable and play the sound.
35 * @short KLettres View class
36 * @author Anne-Marie Mahfouf <annma@kde.org>
41 class KLettresView
: public QWidget
48 KLettresView(KLettres
*parent
);
53 virtual ~KLettresView();
55 ///Set the Grown-up background, show menubar, show the Kid button
56 void viewThemeArctic();
57 ///Set the Kid background pic, hide the menubar, show the Grownup button
58 void viewThemeClassroom();
59 ///Set the Desert background pic, hide the menubar, show the Grownup button
60 void viewThemeDesert();
61 ///Start playing displaying a new letter/syllable, playing the associated sound
65 ///The timer value i.e. the time for displaying the letters/syllables
69 ///The line where the user enters his/her input
70 KLineEdit
*m_letterEdit
;
74 ///The pixmaps for the themes backgrounds
75 QPixmap m_grownupPicture
,
78 ///Palette changes wether it's kid or grown-up
81 ///cursor position in the line edit
83 ///Random number that decides on the letter/syllable and sound
85 ///Length of the syllables
87 ///Choose a sound in random and ensure that it's not the same than the previous one
89 ///Current letter or syllable stored
90 QString m_currentLetter
;
95 ///Paint the letter/syllable in levels 1 and 3
96 void paintEvent( QPaintEvent
* );
99 ///Play the same sound again
100 void slotPlayAgain();
102 void slotProcess(const QString
&inputLetter
);
104 void slotTimerDone();
108 #endif // KLETTRESVIEW_H