kanagram
kanagramgame.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 00021 #ifndef KANAGRAMGAME_H 00022 #define KANAGRAMGAME_H 00023 00024 #include <qobject.h> 00025 #include <qstringlist.h> 00026 00027 #include <krandomsequence.h> 00028 00029 class KEduVocDocument; 00030 00035 class KanagramGame : public QObject 00036 { 00037 Q_OBJECT 00038 public: 00040 explicit KanagramGame(); 00041 00043 ~KanagramGame(); 00044 00046 QString getAnagram(); 00047 00049 QString getHint(); 00050 00052 QString getWord(); 00053 00055 QString getDocTitle(); 00056 00058 QString getFilename(); 00059 00061 QStringList getVocabsList(); 00062 00063 public slots: 00064 00066 void useVocab(const QString &vocabname); 00067 00072 bool refreshVocabList(); 00073 00075 void loadDefaultVocab(); 00076 00078 void nextAnagram(); 00079 00081 void nextVocab(); 00082 00084 void previousVocab(); 00085 00087 void restoreWord(); 00088 00089 signals: 00090 00092 void fileError(const QString &filename); 00093 00094 private: 00095 00097 void createAnagram(); 00098 00100 void checkFile(); 00101 00103 void updateIndex(); 00104 00106 KRandomSequence m_random; 00107 00109 QString m_anagram; 00110 00112 QString m_hint; 00113 00115 QString m_originalWord; 00116 00118 int m_index; 00119 00121 QStringList m_fileList; 00122 00124 QStringList m_answeredWords; 00125 00127 QString m_filename; 00128 00130 KEduVocDocument* m_doc; 00131 }; 00132 00133 #endif 00134
KDE 4.2 API Reference