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

kanagram

  • sources
  • kde-4.12
  • kdeedu
  • kanagram
  • src
  • desktop
kanagram.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Joshua Keel <joshuakeel@gmail.com> *
3  * (C) 2007 by Jeremy Whiting <jpwhiting@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 
27 #ifndef KANAGRAM_H
28 #define KANAGRAM_H
29 
30 #include <KMainWindow>
31 #include <KRandomSequence>
32 #include <qimage.h>
33 
34 namespace Phonon
35 {
36  class MediaObject;
37 }
38 
39 class KanagramGame;
40 class VocabSettings;
41 
42 class QMouseEvent;
43 class QPaintEvent;
44 class QSvgRenderer;
45 
46 class KAction;
47 class KActionCollection;
48 class KConfigDialog;
49 class KHelpMenu;
50 class KLineEdit;
51 class KShortcutsEditor;
52 
57 class Kanagram : public KMainWindow
58 {
59  Q_OBJECT
60  public:
62  Kanagram();
63 
65  ~Kanagram();
66 
68  virtual QSize sizeHint() const;
69 
70  private slots:
71 
73  void checkWord();
74 
76  void reloadSettings();
77 
79  void hideHint();
80 
82  void hidePicHint();
83 
85  void resetInputBox();
86 
90  void refreshVocabularies();
91 
93  void slotShowSettings();
94 
100  void slotFileError(const QString &filename);
101 
103  void slotChooseVocabulary();
104 
106  void slotNextAnagram();
107 
109  void slotRevealWord();
110 
112  void slotNextVocabulary();
113 
115  void slotPrevVocabulary();
116 
118  void slotToggleHint();
119 
121  void slotTogglePicHint();
122 
124  void slotSaveSettings();
125 
127  void slotSettingsCancelled();
128 
130  void slotEnableApplyButton();
131 
132  private:
133 
139  void loadSettings();
140 
142  void setupActions();
143 
156  void drawTextNew(QPainter &p, const QString &text, int textAlign, int xMargin,
157  int yMargin, const QRect &rect, bool highlight, int fontSize = 18);
158 
162  void play(const QString &filename);
163 
167  void paintEvent(QPaintEvent *);
168 
172  void resizeEvent(QResizeEvent *);
173 
178  void mousePressEvent(QMouseEvent *e);
179 
184  void mouseMoveEvent(QMouseEvent *e);
185 
190  void randomHintImage();
191 
196  void drawHelpText(QPainter &p, const QString &text);
197 
203  void drawSwitcher(QPainter &p, const int xMargin, const int yMargin);
204 
210  QRect innerRect(const QRect &rect, const int xMargin, const int yMargin);
211 
213  void CheckRect(const QRect &rect, const QPoint &p, bool &flag, bool &changed);
214 
216  void FixFontSize(int &fontSize);
217 
221  QString stripAccents(const QString & original);
222 
228  KanagramGame *m_game;
229 
234  QString m_hintOverlayName;
235 
240  QString m_arrowName;
241 
243  QRect m_nextRect;
244  QRect m_configRect;
245  QRect m_helpRect;
246  QRect m_quitRect;
247  QRect m_revealRect;
248  QRect m_hintRect;
249  QRect m_picHintRect;
250  QRect m_upRect;
251  QRect m_aboutKDERect;
252  QRect m_aboutAppRect;
253  QRect m_handbookRect;
254  QRect m_switcherRect;
255  QRect m_arrowRect;
256  QRect m_logoRect;
257  QRect m_hintBoxRect;
258  QRect m_blackboardRect;
259 
261  bool m_overNext;
262  bool m_overConfig;
263  bool m_overHelp;
264  bool m_overQuit;
265  bool m_overReveal;
266  bool m_overHint;
267  bool m_overPicHint;
268  bool m_overUp;
269  bool m_overAboutKDE;
270  bool m_overAboutApp;
271  bool m_overHandbook;
272  bool m_overSwitcher;
273  bool m_overLogo;
274  bool m_overHintBox;
275 
276  bool m_showHint;
277  bool m_showPicHint;
278  QImage m_pictureHint;
279 
281  QColor m_fillColor;
282  QColor m_fontColor;
283  QColor m_fontHighlightColor;
284  QColor m_chalkColor;
285  QColor m_chalkHighlightColor;
286 
288  int m_hintHideTime;
289  int m_resolveTime;
290  bool m_useSounds;
291 
293  KHelpMenu *m_helpMenu;
294 
296  KLineEdit *m_inputBox;
297 
299  KConfigDialog *m_configDialog;
300 
302  VocabSettings *m_vocabSettings;
303  KShortcutsEditor *m_shortcutsEditor;
304 
309  KRandomSequence m_randomImage;
310 
312  QTimer *m_hintTimer;
313 
315  QTimer *m_resolveTimer;
316 
318  Phonon::MediaObject *m_player;
319 
321  QSvgRenderer * m_renderer;
322 
326  int m_cornerFontSize;
327 
332  double m_xRatio;
333  double m_yRatio;
334 
335  bool m_wordRevealed;
336  KActionCollection * m_actionCollection;
337 };
338 
339 #endif
340 
Kanagram::Kanagram
Kanagram()
default constructor
Definition: kanagram.cpp:77
Kanagram::sizeHint
virtual QSize sizeHint() const
sizehint method for initial size
Definition: kanagram.cpp:149
KMainWindow
VocabSettings
Vocabulary Settings class.
Definition: vocabsettings.h:34
KanagramGame
game api
Definition: kanagramgame.h:41
Kanagram
main interface widget
Definition: kanagram.h:57
Kanagram::~Kanagram
~Kanagram()
default destructor
Definition: kanagram.cpp:137
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:34 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kanagram

Skip menu "kanagram"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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