moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / khangman / khangman / khangman.h
blob93c6b39d4bef9712580fd9ed6eb4ff1b59487741
1 /***************************************************************************
2 * Copyright (C) 2001-2005 Anne-Marie Mahfouf <annma@kde.org> *
3 * annemarie.mahfouf@free.fr *
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
22 #ifndef _KHANGMAN_H_
23 #define _KHANGMAN_H_
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
29 #include <kmainwindow.h>
31 #include "khangmanview.h"
33 class KSelectAction;
34 class KToggleAction;
35 class KHNewStuff;
37 /**
38 * @short Application Main Window
39 * @author Anne-Marie Mahfouf <annemarie.mahfouf@free.fr>
40 * @version 0.1
42 class KHangMan : public KMainWindow
44 Q_OBJECT
45 public:
46 /**
47 * Default Constructor
49 KHangMan();
51 /**
52 * Default Destructor
54 virtual ~KHangMan();
56 /**
57 Update the text in the Statusbar
58 @param text the text that will be written in the statusbar
59 @param id the label in which the text will be written
61 void changeStatusbar(const QString& text, int id);
62 ///Action that sets up the Language menu
63 KSelectAction *m_languageAction;
64 ///Method to set the current language into the Statusbar and to pass it to KHangManView
65 void setLanguages();
66 ///Translated names of languages
67 QStringList m_languageNames;
68 ///Language codes of available languages
69 QStringList m_languages;
71 protected:
72 ///Main view
73 KHangManView *m_view;
74 ///Action in the Game menu to start a new word
75 KAction *newAct;
76 ///Actions for the level combobox and the mode combobox
77 KSelectAction *levelAct, *modeAct;
78 ///Populate the Languages menu
79 QPopupMenu *langPopup;
82 void setupActions();
84 void setupStatusbar();
86 ///Selected language
87 QString selectedLanguage;
89 ///Translated and sorted names of languages
90 QStringList m_sortedNames;
92 ///the different data files in each language dir
93 QStringList levels;
95 void loadSettings();
97 void setLevel();
98 ///Current level ID
99 uint currentLevel;
100 ///hold the current level
101 QString levelString;
103 void loadLevels();
106 private:
107 ///Create a KNewStuff instance
108 KHNewStuff *mNewStuff;
110 public slots:
112 void slotChangeLanguage(int);
114 protected slots:
116 void slotChangeLevel();
119 void slotChangeMode();
120 ///In Settings menu, Configure KHangMan... menu item
121 void optionsPreferences();
122 ///access the KNewStuff class to install new data
123 void slotDownloadNewStuff();
124 ///update settings after Settings->Configure KHangMan dialog is closed
125 void updateSettings();
128 #endif // _KHANGMAN_H_