1 /***************************************************************************
2 * Copyright (C) 2001-2005 by Anne-Marie Mahfouf *
3 * annemarie.mahfouf@free.fr *
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. *
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. *
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 ***************************************************************************/
29 #include <kmainwindow.h>
31 #include "klettresview.h"
32 #include "soundfactory.h"
42 * @short Application Main Window
43 * @author Anne-Marie Mahfouf <annemarie.mahfouf@free.fr>
46 class KLettres
: public KMainWindow
57 SoundFactory
*soundFactory
;
58 ///All available language codes
59 QStringList m_languages
;
60 ///All available language names
61 QStringList m_languageNames
;
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
76 ///Set the new language
77 void slotChangeLanguage(int);
80 ///Call an instance of the KLettresView widget
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
94 ///Label stating the level in the statusbar
97 QStringList m_levelsNames
;
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
106 ///Build the main window menus
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
129 ///Call the Get New Stuff dialog
130 void slotDownloadNewStuff();
131 ///Hide/Show the menubar
133 ///Set the new font and the new timers
134 void slotUpdateSettings();
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
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
147 ///When a button is clicked on the characters toolbar, the corresponding character is written in the lineedit
148 void slotPasteChar();