moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / klettres / klettres / klettres.h
blob9824bc1b59814e3f7f4aeada7797dbe3075ddb42
1 /***************************************************************************
2 * Copyright (C) 2001-2005 by Anne-Marie Mahfouf *
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 KLETTRES_H
23 #define KLETTRES_H
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
29 #include <kmainwindow.h>
31 #include "klettresview.h"
32 #include "soundfactory.h"
34 class QLabel;
35 class KToggleAction;
36 class KSelectAction;
37 class KComboBox;
38 class KToolBar;
39 class KLNewStuff;
41 /**
42 * @short Application Main Window
43 * @author Anne-Marie Mahfouf <annemarie.mahfouf@free.fr>
44 * @version 1.4
46 class KLettres : public KMainWindow
48 Q_OBJECT
49 public:
51 ///Constructor
52 KLettres();
53 ///Destructor
54 virtual ~KLettres();
56 ///Sound class
57 SoundFactory *soundFactory;
58 ///All available language codes
59 QStringList m_languages;
60 ///All available language names
61 QStringList m_languageNames;
62 /**
63 *Load the xml file
64 *@param - the xml file
65 *@return - bool true if the xml document is found and well formed, false otherwise
67 bool loadLayout(QDomDocument &layoutDocument);
68 ///Number corresponding to the selected language: 0 is Czech, 1 is Danish, 2 is English (default), 3 is French, 4 is Dutch, 5 is Slovak
69 uint selectedLanguage;
70 ///Action that sets up the Language menu
71 KSelectAction *m_languageAction;
72 ///Look for all languages available
73 void findLanguages();
75 public slots:
76 ///Set the new language
77 void slotChangeLanguage(int);
79 protected:
80 ///Call an instance of the KLettresView widget
81 KLettresView *m_view;
82 ///Action that enables the ShowMenuBar item in the Settings menu
83 KToggleAction *m_menubarAction;
84 ///Action that sets up the Level menu
85 KSelectAction *m_levelAction;
86 ///Action that sets up the Look menu
87 KSelectAction *m_themeAction;
88 ///Action allow the Kid mode
89 KToggleAction *m_kidAction;
90 ///Action allow the Grownup mode
91 KToggleAction *m_grownupAction;
92 ///Label stating the language in the statusbar
93 QLabel *m_langLabel;
94 ///Label stating the level in the statusbar
95 QLabel *m_levLabel;
96 ///Holds the levels
97 QStringList m_levelsNames;
98 ///Holds the looks
99 QStringList m_themesNames;
100 ///Create an instance of a KToolBar
101 KToolBar *m_mainToolbar;
102 ///Second toolbar with buttons of special characters per language
103 KToolBar *m_secondToolbar;
104 ///is false when menubar button is not shown
105 bool menuBool;
106 ///Build the main window menus
107 void setupActions();
108 ///Create and setup statusbar
109 void setupStatusbar();
110 ///Create main and second toolbars
111 void setupToolbars();
112 /**generates icons for the special characters toolbar
113 * @param c the character that will be painted on the icon
115 QString charIcon(const QChar &);
117 *Update the level menu and level combobox
118 * @param int - The id of the new level
120 void updateLevMenu(int );
121 ///Create a KNewStuff instance
122 KLNewStuff *mNewStuff;
123 ///Set the correct buttons on the second toolbar according to the language
124 void loadLangToolBar();
125 ///All the special characters from a language file, these characters will be as buttons on the Special Characters Toolbar
126 QStringList allData;
128 protected slots:
129 ///Call the Get New Stuff dialog
130 void slotDownloadNewStuff();
131 ///Hide/Show the menubar
132 void slotMenubar();
133 ///Set the new font and the new timers
134 void slotUpdateSettings();
135 ///Set the new level
136 void slotChangeLevel(int);
137 ///Switch to the grown-up look, menubar is shown
138 void slotModeGrownup();
139 ///Switch to the kid look, menubar is hidden
140 void slotModeKid();
141 ///Change Look from menu Look
142 void slotChangeTheme(int);
143 ///Display the Configure KLettres dialog
144 void optionsPreferences();
145 ///Load the configuration settings and apply them
146 void loadSettings();
147 ///When a button is clicked on the characters toolbar, the corresponding character is written in the lineedit
148 void slotPasteChar();
151 #endif // KLETTRES_H