1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2 Dialog to allow user to add a new Talker by selecting a language and synthesizer
3 (button). Uses addtalkerwidget.ui.
6 (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
8 Original author: Gary Cramblitt <garycramblitt@comcast.net>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************************************************************************/
31 #include "ui_addtalkerwidget.h"
33 typedef QMap
<QString
,QStringList
> SynthToLangMap
;
34 typedef QMap
<QString
,QStringList
> LangToSynthMap
;
36 class AddTalker
: public QWidget
, private Ui::AddTalkerWidget
43 * @param synthToLangMap QMap of supported language codes indexed by synthesizer.
44 * @param parent Inherited KDialog parameter.
45 * @param name Inherited KDialog parameter.
47 AddTalker(SynthToLangMap synthToLangMap
, QWidget
* parent
= 0, const char* name
= 0, Qt::WFlags fl
= 0 );
55 * Returns user's chosen language code.
57 QString
getLanguageCode();
60 * Returns user's chosen synthesizer.
62 QString
getSynthesizer();
67 * Set the synthesizer-to-languages map.
68 * @param synthToLang QMap of supported language codes indexed by synthesizer.
70 void setSynthToLangMap(SynthToLangMap synthToLangMap
);
72 // Converts a language code plus optional country code to language description.
73 QString
languageCodeToLanguage(const QString
&languageCode
);
75 // QMap of language descriptions to language codes.
76 QMap
<QString
,QString
> m_languageToLanguageCodeMap
;
77 // QMap of supported languages indexed by synthesizer.
78 SynthToLangMap m_synthToLangMap
;
79 // QMap of synthesizers indexed by language code they support.
80 LangToSynthMap m_langToSynthMap
;
83 // Based on user's radio button selection, filters choices for language or synthesizer
84 // comboboxes based on what is selected in the other combobox.