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

klettres

  • sources
  • kde-4.12
  • kdeedu
  • klettres
  • src
klettres.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright 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 #include "klettres.h"
22 
23 //Qt includes
24 #include <QBitmap>
25 #include <QDir>
26 #include <QFile>
27 #include <QLabel>
28 #include <QPainter>
29 #include <QTextStream>
30 #include <QDomDocument>
31 #include <QWidget>
32 
33 //KDE includes
34 #include <KAction>
35 #include <KActionCollection>
36 #include <KComboBox>
37 #include <KConfigDialog>
38 #include <KDebug>
39 #include <KLocale>
40 #include <KMenuBar>
41 #include <KMessageBox>
42 #include <KNumInput>
43 #include <KSelectAction>
44 #include <KStandardAction>
45 #include <KStandardDirs>
46 #include <KStatusBar>
47 #include <KToggleAction>
48 #include <KToolBar>
49 #include <KIcon>
50 #include <KApplication>
51 #include <KGlobal>
52 
53 #include <knewstuff3/downloaddialog.h>
54 //Project includes
55 #include "ui_fontsdlg.h"
56 #include "timer.h"
57 #include "prefs.h"
58 #include "langutils.h"
59 #include "kltheme.h"
60 
61 class fontsdlg : public QWidget, public Ui::fontsdlg
62 {
63  public:
64  fontsdlg( QWidget * parent ) : QWidget(parent)
65  {
66  setupUi(this);
67  }
68 };
69 
70 const int ID_KIDB = 100;
71 const int ID_GROWNB = 101;
72 const int ID_MENUBARB = 102;
73 
74 KLettres::KLettres()
75  : KXmlGuiWindow( 0)
76 {
77  setObjectName( QLatin1String("KLettres") );
78  mNewStuff = 0;
79  m_view = new KLettresView(this);
80  setMinimumSize( QSize( 800, 600 ) );
81  //Tell the KXmlGuiWindow that this is indeed the main widget
82  setCentralWidget(m_view);
83  //Populate Languages menu with m_languageNames
84  m_languageNames = LangUtils::getLanguagesNames(LangUtils::getLanguages());
85  //MainWindow GUI: menus, tolbars and statusbar
86  setupActions();
87  setupStatusbar();
88  setupToolbars();
89  //Load Settings
90  loadSettings();
91  //Setup current language sounds
92  soundFactory = new SoundFactory(this, "sounds");
93  //Start game
94  m_view->game();
95 }
96 
97 KLettres::~KLettres()
98 {
99 }
100 
101 bool KLettres::loadLayout(QDomDocument &layoutDocument)
102 {
103  QFile layoutFile(KStandardDirs::locate("data", "klettres/"+Prefs::language()+"/sounds.xml"));
104  //if xml file is not found, program exits
105  if (!layoutFile.exists()) {
106  kWarning() << "sounds.xml file not found in $KDEDIR/share/apps/klettres/"+Prefs::language() ;
107  QString mString=i18n("The file sounds.xml was not found in\n"
108  "$KDEDIR/share/apps/klettres/\n\n"
109  "Please install this file and start KLettres again.\n\n");
110  KMessageBox::information( this, mString,i18n("KLettres - Error") );
111  qApp->quit();//exit(1);
112  }
113 
114  if (!layoutFile.open(QIODevice::ReadOnly)) {
115  return false;
116  }
117 
118  //Check if document is well-formed
119  if (!layoutDocument.setContent(&layoutFile)) {
120  layoutFile.close();
121  return false;
122  }
123 
124  layoutFile.close();
125 
126  return true;
127 }
128 
129 void KLettres::setupActions()
130 {
131  KAction *m_newAction = actionCollection()->addAction("play_new");
132  m_newAction->setText(i18n("New Sound"));
133  m_newAction->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_N));
134  m_newAction->setIcon(KIcon("document-new")); // ### better icon for this?
135  connect(m_newAction, SIGNAL(triggered(bool)), m_view, SLOT(game()));
136  m_newAction->setToolTip(i18n("Play a new sound"));
137  m_newAction->setWhatsThis(i18n("You can play a new sound by clicking this button or using the File menu, New Sound."));
138 
139  QAction *m_stuffAction = actionCollection()->addAction("downloadnewstuff");
140  m_stuffAction->setText(i18n("Get Alphabet in New Language..."));
141  m_stuffAction->setIcon(KIcon("get-hot-new-stuff"));
142  connect(m_stuffAction, SIGNAL(triggered(bool)), this, SLOT(slotDownloadNewStuff()));
143 
144  KAction *m_playAgainAction = actionCollection()->addAction("play_again");
145  m_playAgainAction->setText(i18n("Replay Sound"));
146  m_playAgainAction->setShortcut(QKeySequence(Qt::Key_F5));
147  m_playAgainAction->setIcon(KIcon("media-playback-start"));
148  m_playAgainAction->setToolTip(i18n("Play the same sound again"));
149  connect(m_playAgainAction, SIGNAL(triggered(bool)), m_view, SLOT(slotPlayAgain()));
150  m_playAgainAction->setWhatsThis(i18n("You can replay the same sound again by clicking this button or using the File menu, Replay Sound."));
151  KStandardAction::quit(kapp, SLOT(quit()), actionCollection());
152 
153  m_menubarAction = KStandardAction::showMenubar(this, SLOT(slotMenubar()), actionCollection());
154 
155  m_levelAction = actionCollection()->add<KSelectAction>("levels");
156  m_levelAction->setText(i18nc("@label:listbox which difficulty level to use", "L&evel"));
157  m_levelAction->setToolTip(i18n("Select the level"));
158  m_levelAction->setWhatsThis(i18n("You can select the level: level 1 displays a letter and you hear it; level 2 does not display the letter, you only hear it; level 3 displays a syllable and you hear it; level 4 does not display the syllable, you only hear it."));
159 
160  m_languageAction = actionCollection()->add<KSelectAction>("languages");
161  m_languageAction->setText(i18nc("@label:listbox", "&Language"));
162  m_languageAction->setItems(m_languageNames);
163 
164  m_levelsNames.append(i18ncp("@item:inlistbox choose level", "Level %1" , "Level %1", 1));
165  m_levelsNames.append(i18ncp("@item:inlistbox choose level", "Level %1" , "Level %1", 2));
166  m_levelsNames.append(i18ncp("@item:inlistbox choose level", "Level %1" , "Level %1", 3));
167  m_levelsNames.append(i18ncp("@item:inlistbox choose level", "Level %1" , "Level %1", 4));
168  m_levelAction->setItems(m_levelsNames);
169  m_levelAction->setCurrentItem(Prefs::level()-1);
170 
171  m_themeAction = actionCollection()->add<KSelectAction>("looks");
172  m_themeAction->setText(i18n("Themes"));
173  m_themeAction->setItems(KLThemeFactory::instance()->themeList());
174  m_themeAction->setCurrentItem(Prefs::theme());
175  m_themeAction->setToolTip(i18n("Select the theme"));
176  m_themeAction->setWhatsThis(i18n("Here you can change the theme for KLettres. A theme consists in the background picture and the font color for the letter displayed."));
177 
178  m_kidAction = actionCollection()->add<KToggleAction>("mode_kid");
179  m_kidAction->setText(i18n("Mode Kid"));
180  m_kidAction->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_K));
181  m_kidAction->setIcon(KIcon("klettres_kids"));
182  connect(m_kidAction, SIGNAL(triggered(bool)), this, SLOT(slotModeKid()));
183  m_kidAction->setWhatsThis(i18n("If you are in the Grown-up mode, clicking on this button will set up the Kid mode. The Kid mode has no menubar and the font is bigger in the statusbar."));
184 
185  m_grownupAction = actionCollection()->add<KToggleAction>("mode_grownup");
186  m_grownupAction->setText(i18n("Mode Grown-up"));
187  m_grownupAction->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_G));
188  m_grownupAction->setIcon(KIcon("klettres_grownup"));
189  connect(m_grownupAction, SIGNAL(triggered(bool)), this, SLOT(slotModeGrownup()));
190  m_grownupAction->setWhatsThis(i18n("The Grownup mode is the normal mode where you can see the menubar."));
191 
192  connect(m_levelAction, SIGNAL(triggered(int)), this, SLOT(slotChangeLevel(int)));
193  connect(m_languageAction, SIGNAL(triggered(int)), this, SLOT(slotChangeLanguage(int)));
194  connect(m_themeAction, SIGNAL(triggered(int)), this, SLOT(slotChangeTheme(int)));
195 
196  KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
197 
198  setupGUI();
199 }
200 
201 void KLettres::setupStatusbar()
202 {
203  KStatusBar *st=statusBar();
204  m_langLabel = new QLabel(st);
205  m_levLabel = new QLabel(st);
206  st->addWidget(m_langLabel);
207  st->insertFixedItem("", 1);//add a space
208  st->addWidget(m_levLabel);
209  statusBar();
210 }
211 
212 void KLettres::setupToolbars()
213 {
214  // Toolbar for special characters
215  specialCharToolbar = toolBar("specialCharToolbar");
216  addToolBar ( Qt::BottomToolBarArea, specialCharToolbar);
217 }
218 
219 void KLettres::optionsPreferences()
220 {
221  if(KConfigDialog::showDialog("settings")) {
222  return;
223  }
224 
225  KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self());
226  dialog->addPage(new fontsdlg(0), i18n("Font Settings"), "preferences-desktop-font");
227  //fontsdlg is the page name, mFont is the widget name, Font Settings is the page display string
228  //fonts is the icon
229  Timer *m_timer = new Timer();
230  dialog->addPage(m_timer, i18n("Timer"), "chronometer");
231  connect(dialog, SIGNAL(settingsChanged(const QString &)), this, SLOT(slotUpdateSettings()));
232  dialog->setAttribute( Qt::WA_DeleteOnClose );
233  dialog->setHelp(QString(), "klettres");
234  dialog->show();
235 }
236 
237 void KLettres::loadSettings()
238 {
239  if (LangUtils::getLanguages().indexOf(Prefs::language()) <0) {
240  Prefs::setLanguage("en");
241  }
242  QString langString = LangUtils::getLanguagesNames(LangUtils::getLanguages())[LangUtils::getLanguages().indexOf(Prefs::language())];
243  m_languageAction->setCurrentItem(LangUtils::getLanguages().indexOf(Prefs::language()));
244  langString.remove('&');
245  m_langLabel->setText(langString);
246  loadLangToolBar();
247  // load default level
248  m_levLabel->setText(i18nc("@info:status the current level chosen", "(Level %1)", Prefs::level()));
249 
250  m_view->setTheme(KLThemeFactory::instance()->buildTheme(Prefs::theme()));
251 
252  if (Prefs::mode() == Prefs::EnumMode::grownup) {
253  slotModeGrownup();
254  } else {
255  slotModeKid();
256  }
257 
258  m_menubarAction->setChecked(Prefs::menuBarBool());
259  slotMenubar();
260 }
261 
262 void KLettres::slotDownloadNewStuff()
263 {
264  QPointer<KNS3::DownloadDialog> dialog(new KNS3::DownloadDialog("klettres.knsrc", this));
265  if ( dialog->exec() == QDialog::Accepted ) {
266  // do nothing
267  }
268 
269  delete dialog;
270 
271  //look for languages dirs installed
272  QStringList languages = LangUtils::getLanguages();
273  m_languageNames = LangUtils::getLanguagesNames(languages);
274 
275  //refresh Languages menu
276  m_languageAction->setItems(m_languageNames);
277  slotChangeLanguage(languages.indexOf(Prefs::language()));
278  m_languageAction->setCurrentItem(languages.indexOf(Prefs::language()));
279 }
280 
281 void KLettres::slotMenubar()
282 {
283  menuBar()->setVisible(m_menubarAction->isChecked());
284  Prefs::setMenuBarBool(m_menubarAction->isChecked());
285  Prefs::self()->writeConfig();
286 }
287 
288 void KLettres::slotUpdateSettings()
289 {
290  m_view->m_timer = Prefs::kidTimer();
291  m_view->m_timer = Prefs::grownTimer();
292  //apply the font
293  m_view->setFont(Prefs::font());
294 }
295 
296 void KLettres::slotChangeLevel(int newLevel)
297 {
298  Prefs::setLevel(newLevel+1);
299  Prefs::self()->writeConfig();
300  updateLevMenu(newLevel);
301  //TODO is that necessary? Change level effectively by reloading sounds
302 
303  //this is duplicated in changeLanguage()
304  soundFactory->change(Prefs::language());
305  //update game effectively
306  m_view->randomInt = 0;
307  m_view->game();
308 }
309 
310 void KLettres::updateLevMenu(int id)
311 {
312  //m_levelCombo->setCurrentItem(id);
313  m_levelAction->setCurrentItem(id);
314  m_levLabel->setText(i18nc("@info:status the current level chosen", "(Level %1)", Prefs::level()));
315 }
316 
317 void KLettres::slotChangeLanguage(int newIndex)
318 {
319  // Write new language ISO in config
320  QString newLanguage = LangUtils::getLanguages()[newIndex];
321  Prefs::setLanguage(newLanguage);
322  Prefs::self()->writeConfig();
323  // Update the StatusBar
324  QString langString = LangUtils::getLanguagesNames(LangUtils::getLanguages())[newIndex];
325  langString.remove('&');
326  m_langLabel->setText(langString);
327  loadLangToolBar();
328  // Change language effectively
329  bool ok = loadLayout(soundFactory->m_layoutsDocument);
330 
331  if (ok) {
332  soundFactory->change(Prefs::language());
333  }
334 
335  m_view->randomInt = 0;
336  m_view->game();
337 }
338 
339 void KLettres::slotChangeTheme(int index)
340 {
341  Prefs::setTheme(index);
342  Prefs::self()->writeConfig();
343  m_view->setTheme(KLThemeFactory::instance()->buildTheme(index));
344 }
345 
346 void KLettres::slotModeGrownup()
347 {
348  QPalette pal;
349  pal.setColor( QPalette::Background, Qt::white);
350  statusBar()->setPalette( pal );
351  QFont f_lab( "Serif" , 10); //font for statusBar
352  m_levLabel->setFont(f_lab);
353  m_langLabel->setFont(f_lab);
354  m_menubarAction->setChecked(true);
355  m_grownupAction->setChecked(true);
356  m_kidAction->setChecked(false);
357  m_grownupAction->setToolTip(i18n("Grown-up mode is currently active"));
358  m_kidAction->setToolTip(i18n("Switch to Kid mode"));
359  menuBar()->show();
360  m_view->m_timer = Prefs::grownTimer();
361  Prefs::setMode(Prefs::EnumMode::grownup);
362  Prefs::self()->writeConfig();
363 }
364 
365 void KLettres::slotModeKid()
366 {
367  QPalette pal;
368  pal.setColor( QPalette::Background, Qt::white);
369  statusBar()->setPalette( pal );
370  QFont f_lab( "Serif" , 12); //font for statusBar
371  f_lab.setBold(true);
372  m_levLabel->setFont(f_lab);
373  m_langLabel->setFont(f_lab);
374  m_menubarAction->setChecked(false);
375  m_kidAction->setChecked(true);
376  m_kidAction->setToolTip(i18n("Kid mode is currently active"));
377  m_grownupAction->setToolTip(i18n("Switch to Grown-up mode"));
378  m_grownupAction->setChecked(false);
379  menuBar()->hide();
380  m_view->m_timer = Prefs::kidTimer();
381  Prefs::setMode(Prefs::EnumMode::kid);
382  Prefs::self()->writeConfig();
383 }
384 
385 void KLettres::loadLangToolBar()
386 {
387  QString lang = Prefs::language();
388 
389  specialCharToolbar->clear();
390 
391  if (LangUtils::hasSpecialChars(lang)) {//Dutch, English, French and Italian have no special characters
392  allData.clear();
393  QString myString=QString("klettres/%1.txt").arg(lang);
394  QFile myFile;
395  myFile.setFileName(KStandardDirs::locate("data",myString));
396 
397  if (!myFile.exists()) {
398  QString mString=i18n("File $KDEDIR/share/apps/klettres/%1.txt not found;\n"
399  "please check your installation.", lang);
400  KMessageBox::sorry( this, mString,
401  i18n("Error") );
402  qApp->quit();
403  }
404 
405  //we open the file and store info into the stream...
406  QFile openFileStream(myFile.fileName());
407  openFileStream.open(QIODevice::ReadOnly);
408  QTextStream readFileStr(&openFileStream);
409  readFileStr.setCodec("UTF-8");
410  //allData contains all the words from the file
411  allData = readFileStr.readAll().split('\n');
412  openFileStream.close();
413 
414  for (int i=0; i<(int) allData.count(); ++i) {
415  if (!allData[i].isEmpty()) {
416  QAction *act = specialCharToolbar->addAction(allData.at(i));
417  act->setIcon(charIcon(allData.at(i).at(0)));
418  // used to carry the id
419  act->setData(i);
420  connect(act, SIGNAL(triggered(bool)), this, SLOT(slotPasteChar()));
421  }
422  }
423 
424  specialCharToolbar->show();
425  update();
426  } else {
427  specialCharToolbar->hide();
428  }
429 }
430 
431 void KLettres::slotPasteChar()
432 {
433  QAction *act = qobject_cast<QAction*>(sender());
434  if (!act) {
435  return;
436  }
437 
438  bool ok = true;
439  int id = act->data().toInt(&ok);
440 
441  if (!ok || id < 0 || id >= allData.count()) {
442  return;
443  }
444 
445  m_view->m_letterEdit->insert(allData.at(id));
446 }
447 
448 QIcon KLettres::charIcon(const QChar & c)
449 {
451  QString s = KStandardDirs::locateLocal("icon", "char" + QString::number(c.unicode()) + ".png");
452 
453  QRect r(4, 4, 120, 120);
454 
456  QFont font;
457  font.setFamily( "Arial" );
458  font.setPixelSize(120);
459  font.setWeight(QFont::Normal);
460 
462  QPixmap pm(128, 128);
463  pm.fill(Qt::white);
464  QPainter p(&pm);
465  p.setFont(font);
466  p.setPen(Qt::black);
467  p.drawText(r, Qt::AlignCenter, (QString) c);
468 
470  QBitmap bm(128, 128);
471  bm.fill(Qt::color0);
472  QPainter b(&bm);
473  b.setFont(font);
474  b.setPen(Qt::color1);
475  b.drawText(r, Qt::AlignCenter, (QString) c);
476 
478  pm.setMask(bm);
479 
481  pm.save(s, "PNG");
482 
483  return QIcon(pm);
484 }
485 
486 #include "klettres.moc"
KLettres::slotChangeLanguage
void slotChangeLanguage(int)
Set the new language.
Definition: klettres.cpp:317
KLettres::setupToolbars
void setupToolbars()
Create main and second toolbars.
Definition: klettres.cpp:212
KLettres::charIcon
QIcon charIcon(const QChar &c)
generates icons for the special characters toolbar
Definition: klettres.cpp:448
KLettres::m_languageNames
QStringList m_languageNames
All available language names.
Definition: klettres.h:54
KLettres::slotMenubar
void slotMenubar()
Hide/Show the menubar.
Definition: klettres.cpp:281
Prefs::setMenuBarBool
static void setMenuBarBool(bool v)
Set Whether the menubar is shown or hidden.
Definition: prefs.h:71
KLettresView::game
void game()
Start playing displaying a new letter/syllable, playing the associated sound.
Definition: klettresview.cpp:149
klettres.h
Prefs::language
static QString language()
Get Language.
Definition: prefs.h:43
KLettres::setupActions
void setupActions()
Build the main window menus.
Definition: klettres.cpp:129
KLettresView::setTheme
void setTheme(KLTheme *theme)
set the chosen theme
Definition: klettresview.cpp:88
KLettres::m_langLabel
QLabel * m_langLabel
Label stating the language in the statusbar.
Definition: klettres.h:84
prefs.h
Prefs::level
static int level()
Get Difficulty level.
Definition: prefs.h:131
ID_GROWNB
const int ID_GROWNB
Definition: klettres.cpp:71
KLettresView::m_timer
int m_timer
The timer value i.e. the time for displaying the letters/syllables.
Definition: klettresview.h:59
KLettres::slotModeGrownup
void slotModeGrownup()
Switch to the grown-up look, menubar is shown.
Definition: klettres.cpp:346
KLettresView
This class serves as the view for KLettres.
Definition: klettresview.h:42
KLettres::updateLevMenu
void updateLevMenu(int id)
Update the level menu and level combobox.
Definition: klettres.cpp:310
KLettres::loadLayout
bool loadLayout(QDomDocument &layoutDocument)
Load the xml file.
Definition: klettres.cpp:101
timer.h
KLettres::slotUpdateSettings
void slotUpdateSettings()
Set the new font and the new timers.
Definition: klettres.cpp:288
Prefs::self
static Prefs * self()
Definition: prefs.cpp:17
KLettres::KLettres
KLettres()
Constructor.
Definition: klettres.cpp:74
KXmlGuiWindow
Prefs::menuBarBool
static bool menuBarBool()
Get Whether the menubar is shown or hidden.
Definition: prefs.h:81
Prefs::grownTimer
static int grownTimer()
Get Grown-up Timer.
Definition: prefs.h:169
KLettres::slotChangeLevel
void slotChangeLevel(int)
Set the new level.
Definition: klettres.cpp:296
Prefs::kidTimer
static int kidTimer()
Get Kid Timer.
Definition: prefs.h:150
KLettres::m_languageAction
KSelectAction * m_languageAction
Action that sets up the Language menu.
Definition: klettres.h:62
KLettres::m_levLabel
QLabel * m_levLabel
Label stating the level in the statusbar.
Definition: klettres.h:86
KLettres::mNewStuff
KLNewStuff * mNewStuff
Create a KNewStuff instance.
Definition: klettres.h:113
Prefs::font
static QFont font()
Get Font.
Definition: prefs.h:188
KLettres::slotPasteChar
void slotPasteChar()
When a button is clicked on the characters toolbar, the corresponding character is written in the lin...
Definition: klettres.cpp:431
SoundFactory
This class manages the sounds to play in KLettres, reading the data about the sounds in the sounds...
Definition: soundfactory.h:47
KLettresView::m_letterEdit
KLineEdit * m_letterEdit
The line where the user enters his/her input.
Definition: klettresview.h:65
Prefs::EnumMode::kid
Definition: prefs.h:23
KLettres::soundFactory
SoundFactory * soundFactory
Sound class.
Definition: klettres.h:52
SoundFactory::change
void change(const QString &currentLanguage)
Change the language when the user changes the language in the Languages menu.
Definition: soundfactory.cpp:60
Prefs::theme
static int theme()
Get Theme.
Definition: prefs.h:62
KLettres::m_themeAction
KSelectAction * m_themeAction
Action that sets up the Look menu.
Definition: klettres.h:78
KLThemeFactory::instance
static KLThemeFactory * instance()
Definition: kltheme.cpp:183
KLettres::m_levelsNames
QStringList m_levelsNames
Holds the levels.
Definition: klettres.h:88
KLettres::slotModeKid
void slotModeKid()
Switch to the kid look, menubar is hidden.
Definition: klettres.cpp:365
Prefs::setLevel
static void setLevel(int v)
Set Difficulty level.
Definition: prefs.h:109
KLettres::loadLangToolBar
void loadLangToolBar()
Set the correct buttons on the second toolbar according to the language.
Definition: klettres.cpp:385
KLettres::m_levelAction
KSelectAction * m_levelAction
Action that sets up the Level menu.
Definition: klettres.h:76
Prefs::setLanguage
static void setLanguage(const QString &v)
Set Language.
Definition: prefs.h:33
KLettres::specialCharToolbar
KToolBar * specialCharToolbar
Second toolbar with buttons of special characters per language.
Definition: klettres.h:94
KLettres::loadSettings
void loadSettings()
Load the configuration settings and apply them.
Definition: klettres.cpp:237
Prefs::mode
static int mode()
Get Mode.
Definition: prefs.h:100
ID_KIDB
const int ID_KIDB
Definition: klettres.cpp:70
KLettres::slotChangeTheme
void slotChangeTheme(int)
Change Look from menu Look.
Definition: klettres.cpp:339
KLettres::m_view
KLettresView * m_view
Call an instance of the KLettresView widget.
Definition: klettres.h:72
KLettres::allData
QStringList allData
All the special characters from a language file, these characters will be as buttons on the Special C...
Definition: klettres.h:117
langutils.h
KLettres::optionsPreferences
void optionsPreferences()
Display the Configure KLettres dialog.
Definition: klettres.cpp:219
Prefs::setTheme
static void setTheme(int v)
Set Theme.
Definition: prefs.h:52
KLettres::m_kidAction
KToggleAction * m_kidAction
Action allowing the Kid mode.
Definition: klettres.h:80
ID_MENUBARB
const int ID_MENUBARB
Definition: klettres.cpp:72
Prefs::setMode
static void setMode(int v)
Set Mode.
Definition: prefs.h:90
KLettres::~KLettres
virtual ~KLettres()
Destructor.
Definition: klettres.cpp:97
Timer
Timer widget in Settings dialog.
Definition: timer.h:35
kltheme.h
Prefs::EnumMode::grownup
Definition: prefs.h:23
KLettres::setupStatusbar
void setupStatusbar()
Create and setup statusbar.
Definition: klettres.cpp:201
KLettres::m_menubarAction
KToggleAction * m_menubarAction
Action that enables the ShowMenuBar item in the Settings menu.
Definition: klettres.h:74
KLettresView::randomInt
int randomInt
The index to the random sequence.
Definition: klettresview.h:61
KLettres::m_grownupAction
KToggleAction * m_grownupAction
Action allowing the Grownup mode.
Definition: klettres.h:82
LangUtils::getLanguagesNames
static QStringList getLanguagesNames(QStringList languagesList)
All available languages translated names.
Definition: langutils.cpp:92
SoundFactory::m_layoutsDocument
QDomDocument m_layoutsDocument
The language document.
Definition: soundfactory.h:75
LangUtils::hasSpecialChars
static bool hasSpecialChars(const QString &lang)
Definition: langutils.cpp:31
KLettres::slotDownloadNewStuff
void slotDownloadNewStuff()
Call the Get New Stuff dialog.
Definition: klettres.cpp:262
LangUtils::getLanguages
static QStringList getLanguages()
Available languages ISO names.
Definition: langutils.cpp:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:13 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
  • Namespace List
  • 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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