moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kvoctrain / kvoctrain / common-dialogs / languageoptions.h
blob3b6d82dff1e359b60c5a12951fe1af31745059be
1 /***************************************************************************
3 language options for kvoctrain
5 -----------------------------------------------------------------------
7 begin : Tue Apr 5 2005
9 copyright :(C) 2005 Peter Hedlund
11 email : peter@peterandlinda.com
13 -----------------------------------------------------------------------
15 ***************************************************************************/
17 /***************************************************************************
18 * *
19 * This program is free software; you can redistribute it and/or modify *
20 * it under the terms of the GNU General Public License as published by *
21 * the Free Software Foundation; either version 2 of the License, or *
22 * (at your option) any later version. *
23 * *
24 ***************************************************************************/
26 #ifndef LANGUAGEOPTIONS_H
27 #define LANGUAGEOPTIONS_H
29 #include <qpopupmenu.h>
31 #include "languageoptionsbase.h"
32 #include "langset.h"
34 class LanguageOptions : public LanguageOptionsBase
36 Q_OBJECT
38 public:
39 LanguageOptions(LangSet & langset, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
40 virtual ~LanguageOptions ();
42 LangSet getLangSet () const;
44 struct Country
46 Country(const QString& c, const QValueList<int> l, const QString& p, int i)
47 : country(c), langs(l), pixmap(p), id(i) { }
48 Country() { }
49 QString country;
50 QValueList<int> langs;
51 QString pixmap;
52 int id;
55 struct Region
57 Region (const QString& reg)
58 : region(reg) {}
59 Region() {}
60 QString region;
61 QValueList<Country> countries;
64 void updateWidgets();
65 bool hasChanged();
66 bool isDefault();
67 void updateSettings();
69 signals:
70 void widgetModified();
72 protected slots:
73 void slotDeleteClicked();
74 void slotNewClicked();
75 void slotPixmapClicked();
76 void slotLangChanged(const QString&);
77 void slotShort2Changed(const QString&);
78 void slotShortActivated(const QString&);
79 void slotNewNameChanged(const QString&);
80 void slotLangFromGlobalActivated(int);
81 void slotLangFromISO6391Activated(int);
82 void slotKeyboardLayoutChanged(const QString&);
84 private:
85 bool setPixmap(QString pm);
86 void enableLangWidgets();
87 void loadCountryData();
88 void loadISO6391Data();
89 void createISO6391Menus();
91 LangSet global_langset;
92 QMap<int, Country> countryIdMap;
93 QPopupMenu * langset_popup;
94 QPopupMenu * iso6391_popup;
95 LangSet m_langSet;
96 QString m_lastPix;
97 bool m_hasChanged;
100 #endif