• 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
  • engine
kanagramgame.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  * (C) 2012 by Laszlo Papp <lpapp@kde.org> *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20  ***************************************************************************/
21 
22 #ifndef KANAGRAMGAME_H
23 #define KANAGRAMGAME_H
24 
25 #include "kanagram_engine_export.h"
26 
27 #include <QtCore/QObject>
28 #include <QtCore/QStringList>
29 #include <QtCore/QHash>
30 #include <KDE/KUrl>
31 
32 #include <krandomsequence.h>
33 
34 
35 class KEduVocDocument;
36 
41 class KANAGRAM_ENGINE_EXPORT KanagramGame : public QObject
42 {
43  Q_OBJECT
44  Q_PROPERTY(QString dataLanguage READ dataLanguage WRITE setDataLanguage NOTIFY dataLanguageChanged)
45 
46  public:
48  KanagramGame();
49 
51  ~KanagramGame();
52 
54  QString sanitizedDataLanguage() const;
55 
57  QString anagram() const;
58 
60  Q_INVOKABLE QString hint() const;
61 
63  QString word() const;
64 
66  KUrl picHint();
67 
69  QString documentTitle() const;
70 
72  QString filename() const;
73 
75  Q_INVOKABLE QStringList vocabularyList() const;
76 
78  Q_INVOKABLE QStringList languageNames();
79 
81  Q_INVOKABLE QString dataLanguage() const;
82 
84  Q_INVOKABLE void setDataLanguage(const QString& dataLanguage);
85 
87  Q_INVOKABLE int dataLanguageSelectedIndex() const;
88 
90  Q_INVOKABLE int currentCategory() const;
91 
92 
93  public Q_SLOTS:
94 
96  void useVocabulary(const QString &vocabularyname);
97 
99  void useVocabulary(int index);
100 
105  bool refreshVocabularyList();
106 
108  void loadDefaultVocabulary();
109 
111  void nextAnagram();
112 
114  void nextVocabulary();
115 
117  void previousVocabulary();
118 
120  void restoreWord();
121 
123  void setCurrentCategory(int index);
124 
125  Q_SIGNALS:
126 
128  void fileError(const QString &filename);
129 
131  void dataLanguageChanged();
132 
133  private:
134 
136  void createAnagram();
137 
139  bool checkFile();
140 
142  KRandomSequence m_random;
143 
145  QString m_anagram;
146 
148  QString m_hint;
149 
151  KUrl m_picHintUrl;
152 
154  QString m_originalWord;
155 
157  int m_index;
158 
160  QStringList m_fileList;
161 
163  QStringList m_answeredWords;
164 
166  QString m_filename;
167 
169  KEduVocDocument* m_document;
170 
172  QHash<QString, QString> m_languageCodeNameHash;
173 };
174 
175 #endif
176 
KANAGRAM_ENGINE_EXPORT
#define KANAGRAM_ENGINE_EXPORT
Definition: kanagram_engine_export.h:29
QObject
kanagram_engine_export.h
KanagramGame
game api
Definition: kanagramgame.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:35 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