SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kttsd / kcmkttsmgr / addtalker.h
blob59b2e82f03c3673b2992622955d0a24528178005
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.
4 -------------------
5 Copyright:
6 (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
7 -------------------
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 ******************************************************************************/
25 #ifndef ADDTALKER_H
26 #define ADDTALKER_H
28 // Qt includes.
29 #include <QMap>
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
38 Q_OBJECT
40 public:
41 /**
42 * Constructor.
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 );
49 /**
50 * Destructor.
52 ~AddTalker();
54 /**
55 * Returns user's chosen language code.
57 QString getLanguageCode();
59 /**
60 * Returns user's chosen synthesizer.
62 QString getSynthesizer();
65 private:
66 /**
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;
82 private slots:
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.
85 void applyFilter();
88 #endif