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

kanagram

kanagram.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Joshua Keel <joshuakeel@gmail.com>              *
00003  *             (C) 2007 by Jeremy Whiting <jeremy@scitools.com>            *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
00019  ***************************************************************************/
00020 
00027 #ifndef KANAGRAM_H
00028 #define KANAGRAM_H
00029 
00030 #include <QMouseEvent>
00031 #include <QPaintEvent>
00032 
00033 #include <KMainWindow>
00034 #include <KRandomSequence>
00035 
00036 using namespace std;
00037 
00038 namespace Phonon
00039 {
00040     class MediaObject;
00041 }
00042 
00043 class KanagramGame;
00044 class VocabSettings;
00045 
00046 class QSvgRenderer;
00047 
00048 class KAction;
00049 class KActionCollection;
00050 class KConfigDialog;
00051 class KHelpMenu;
00052 class KLineEdit;
00053 class KShortcutsEditor;
00054 
00059 class Kanagram : public KMainWindow
00060 {
00061     Q_OBJECT
00062     public:
00064         Kanagram();
00065 
00067         ~Kanagram();
00068 
00070         virtual QSize sizeHint() const;
00071 
00072     private slots:
00073 
00075         void checkWord();
00076 
00078         void reloadSettings();
00079 
00081         void hideHint();
00082 
00084         void resetInputBox();
00085 
00089         void refreshVocabularies();
00090 
00092         void slotShowSettings();
00093 
00099         void slotFileError(const QString &filename);
00100 
00102         void slotChooseVocabulary();
00103 
00105         void slotNextAnagram();
00106 
00108         void slotRevealWord();
00109 
00111         void slotNextVocabulary();
00112 
00114         void slotPrevVocabulary();
00115 
00117         void slotToggleHint();
00118 
00120         void slotSaveSettings();
00121 
00123         void slotSettingsCancelled();
00124 
00126         void slotEnableApplyButton();
00127 
00128     private:
00129 
00135         void loadSettings();
00136 
00138         void setupActions();
00139 
00152         void drawTextNew(QPainter &p, const QString &text, int textAlign, int xMargin, 
00153                 int yMargin, const QRect &rect, bool highlight, int fontSize = 18);
00154 
00158         void play(const QString &filename);
00159 
00163         void paintEvent(QPaintEvent *);
00164 
00168         void resizeEvent(QResizeEvent *);
00169 
00174         void mousePressEvent(QMouseEvent *e);
00175 
00180         void mouseMoveEvent(QMouseEvent *e);
00181 
00186         void randomHintImage();
00187 
00192         void drawHelpText(QPainter &p, const QString &text);
00193 
00199         void drawSwitcher(QPainter &p, const int xMargin, const int yMargin);
00200 
00206         QRect innerRect(const QRect &rect, const int xMargin, const int yMargin);
00207 
00209         void CheckRect(const QRect &rect, const QPoint &p, bool &flag, bool &changed);
00210 
00212         void FixFontSize(int &fontSize);
00213         
00217         QString stripAccents(const QString & original);
00218 
00224         KanagramGame *m_game;
00225 
00230         QString m_hintOverlayName;
00231 
00236         QString m_arrowName;
00237 
00239         QRect m_nextRect;
00240         QRect m_configRect; 
00241         QRect m_helpRect;
00242         QRect m_quitRect;
00243         QRect m_revealRect;
00244         QRect m_hintRect;
00245         QRect m_upRect;
00246         QRect m_aboutKDERect;
00247         QRect m_aboutAppRect; 
00248         QRect m_handbookRect; 
00249         QRect m_switcherRect; 
00250         QRect m_arrowRect; 
00251         QRect m_logoRect; 
00252         QRect m_hintBoxRect; 
00253         QRect m_blackboardRect;
00254 
00256         bool m_overNext;
00257         bool m_overConfig; 
00258         bool m_overHelp; 
00259         bool m_overQuit; 
00260         bool m_overReveal; 
00261         bool m_overHint; 
00262         bool m_overUp; 
00263         bool m_overAboutKDE; 
00264         bool m_overAboutApp; 
00265         bool m_overHandbook; 
00266         bool m_overSwitcher; 
00267         bool m_overLogo; 
00268         bool m_overHintBox;
00269 
00270         bool m_showHint;
00271 
00273         QColor m_fillColor; 
00274         QColor m_fontColor; 
00275         QColor m_fontHighlightColor; 
00276         QColor m_chalkColor; 
00277         QColor m_chalkHighlightColor;
00278 
00280         int m_hintHideTime;
00281         bool m_useSounds; 
00282 
00284         KHelpMenu *m_helpMenu;
00285 
00287         KLineEdit *m_inputBox;
00288 
00290         KConfigDialog *m_configDialog;
00291 
00293         VocabSettings *m_vocabSettings;
00294         KShortcutsEditor *m_shortcutsEditor;
00295 
00300         KRandomSequence m_randomImage;
00301 
00303         QTimer *m_hintTimer;
00304 
00306         Phonon::MediaObject *m_player;
00307 
00309         QSvgRenderer * m_renderer;
00310 
00314         int m_cornerFontSize;
00315 
00320         double m_xRatio;
00321         double m_yRatio;
00322 
00323         KActionCollection * m_actionCollection;
00324 };
00325 
00326 #endif
00327 

kanagram

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

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal