SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kttsd / libkttsd / selectlanguagedlg.h
blob8327a7a8963452f876cb87f35c4b64b8fcf42337
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2 Description:
3 A dialog for user to select one or more languages from the list
4 of KDE global languages.
6 Copyright:
7 (C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
8 -------------------
9 Original author: Gary Cramblitt <garycramblitt@comcast.net>
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ******************************************************************************/
26 #ifndef SELECTLANGUAGEDLG_H
27 #define SELECTLANGUAGEDLG_H
29 // Qt includes.
30 #include <QtGui/QWidget>
32 // KDE includes.
33 #include <kdialog.h>
34 #include <klocale.h>
36 class QTableWidget;
38 class KDE_EXPORT SelectLanguageDlg : public KDialog
40 Q_OBJECT
42 public:
43 enum SelectMode {
44 MultipleSelect = 0,
45 SingleSelect = 1
47 enum BlankMode {
48 BlankNotAllowed = 0,
49 BlankAllowed = 1
52 /**
53 * Constructor.
54 * @param parent The parent for this dialog.
55 * @param caption Displayed title for this dialog.
56 * @param languageCode A list of language codes that should start
57 * out selected when dialog is shown.
58 * @param selectMode 0 if user may choose more than one
59 * language in the list. 1 if only one
60 * language may be chosen.
61 * @param blankMode If 1, a blank row is displayed in the
62 * list and user may choose it.
64 SelectLanguageDlg(
65 QWidget* parent = 0,
66 const QString& caption = i18n("Select Language"),
67 const QStringList& languageCodes = QStringList(),
68 bool selectMode = SingleSelect,
69 bool blankMode = BlankAllowed);
71 /**
72 * Destructor.
74 ~SelectLanguageDlg() { }
76 /**
77 * In single select mode, returns the language user chose.
79 QString selectedLanguage();
81 /**
82 * In single select mode, returns the language code user chose.
84 QString selectedLanguageCode();
86 /**
87 * In multiple select mode, returns list of languages user chose.
89 QStringList selectedLanguages();
91 /**
92 * In multiple select mode, returns the list of language codes
93 * user chose.
95 QStringList selectedLanguageCodes();
97 private:
98 QString firstSelectedItem(int col);
99 QStringList allSelectedItems(int col);
101 QTableWidget* m_langList;
104 #endif // SELECTLANGUAGEDLG_H