Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / kcontrol / locale / localetime.h
blob7019a4f72c255f39ae6457b811254b70813d9918
1 /*
2 * localetime.h
4 * Copyright (c) 1999-2003 Hans Petter Bieker <bieker@kde.org>
6 * Requires the Qt widget libraries, available at no cost at
7 * http://www.troll.no/
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef LOCALETIME_H
25 #define LOCALETIME_H
27 #include <QWidget>
29 #include <QMap>
31 class QCheckBox;
32 class QComboBox;
34 class KLocale;
36 class StringPair;
38 class KLocaleConfigTime : public QWidget
40 Q_OBJECT
42 public:
43 explicit KLocaleConfigTime( KLocale *_locale, QWidget *parent=0);
44 virtual ~KLocaleConfigTime( );
46 void save();
48 protected:
49 void showEvent( QShowEvent *e );
51 public Q_SLOTS:
52 /**
53 * Loads all settings from the current locale into the current widget.
55 void slotLocaleChanged();
56 /**
57 * Retranslate all objects owned by this object using the current locale.
59 void slotTranslate();
61 Q_SIGNALS:
62 void localeChanged();
64 private Q_SLOTS:
65 // Time & dates
66 void slotTimeFmtChanged(const QString &t);
67 void slotDateFmtChanged(const QString &t);
68 void slotDateFmtShortChanged(const QString &t);
69 void slotWeekStartDayChanged(int firstDay);
70 void slotDateMonthNamePossChanged();
71 void slotCalendarSystemChanged(int calendarSystem);
73 private:
74 void updateWeekDayNames();
76 QList<StringPair> timeMap() const;
77 QList<StringPair> dateMap() const;
79 QString storeToUser(const QList<StringPair> & map,
80 const QString & storeFormat) const;
81 QString userToStore(const QList<StringPair> & map,
82 const QString & userFormat) const;
83 StringPair buildStringPair(const QChar &storeName, const QString &userName) const;
85 KLocale *m_locale;
87 // Time & dates
88 QLabel *m_labTimeFmt;
89 QComboBox *m_comboTimeFmt;
90 QLabel *m_labDateFmt;
91 QComboBox * m_comboDateFmt;
92 QLabel *m_labDateFmtShort;
93 QComboBox * m_comboDateFmtShort;
94 QLabel * m_labWeekStartDay;
95 QComboBox * m_comboWeekStartDay;
96 QCheckBox *m_chDateMonthNamePossessive;
97 QLabel * m_labCalendarSystem;
98 QComboBox * m_comboCalendarSystem;
101 #endif // LOCALETIME_H