add more spacing
[personal-kdebase.git] / runtime / kcontrol / locale / localetime.h
blobead3dc8cf0b516cd4a038359cde302a030b725fe
1 /*
2 * localetime.h
4 * Copyright (c) 1999-2003 Hans Petter Bieker <bieker@kde.org>
5 * Copyright (c) 2008 John Layt <john@layt.net>
7 * Requires the Qt widget libraries, available at no cost at
8 * http://www.troll.no/
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.
25 #ifndef LOCALETIME_H
26 #define LOCALETIME_H
28 #include <QWidget>
30 #include <QMap>
32 class QCheckBox;
33 class QComboBox;
35 class KLocale;
37 class StringPair;
39 class KLocaleConfigTime : public QWidget
41 Q_OBJECT
43 public:
44 explicit KLocaleConfigTime( KLocale *_locale, QWidget *parent=0);
45 virtual ~KLocaleConfigTime( );
47 void save();
49 protected:
50 void showEvent( QShowEvent *e );
52 public Q_SLOTS:
53 /**
54 * Loads all settings from the current locale into the current widget.
56 void slotLocaleChanged();
57 /**
58 * Retranslate all objects owned by this object using the current locale.
60 void slotTranslate();
62 Q_SIGNALS:
63 void localeChanged();
65 private Q_SLOTS:
66 // Time & dates
67 void slotTimeFmtChanged(const QString &t);
68 void slotDateFmtChanged(const QString &t);
69 void slotDateFmtShortChanged(const QString &t);
70 void slotWeekStartDayChanged(int firstDay);
71 void slotWorkingWeekStartDayChanged(int startDay);
72 void slotWorkingWeekEndDayChanged(int endDay);
73 void slotWeekDayOfPrayChanged(int weekDay);
74 void slotDateMonthNamePossChanged();
75 void slotCalendarSystemChanged(int calendarSystem);
77 private:
78 void updateWeekDayNames();
80 QList<StringPair> timeMap() const;
81 QList<StringPair> dateMap() const;
83 QString storeToUser(const QList<StringPair> & map,
84 const QString & storeFormat) const;
85 QString userToStore(const QList<StringPair> & map,
86 const QString & userFormat) const;
87 StringPair buildStringPair(const QChar &storeName, const QString &userName) const;
89 KLocale *m_locale;
91 // Time & dates
92 QLabel *m_labTimeFmt;
93 QComboBox *m_comboTimeFmt;
94 QLabel *m_labDateFmt;
95 QComboBox * m_comboDateFmt;
96 QLabel *m_labDateFmtShort;
97 QComboBox * m_comboDateFmtShort;
98 // QLabel * m_labWeekStartDay;
99 QComboBox * m_comboWeekStartDay;
100 // QLabel * m_labWorkingWeekStartDay;
101 QComboBox * m_comboWorkingWeekStartDay;
102 // QLabel * m_labWorkingWeekEndDay;
103 QComboBox * m_comboWorkingWeekEndDay;
104 // QLabel * m_labWeekDayOfPray;
105 QComboBox * m_comboWeekDayOfPray;
106 QCheckBox *m_chDateMonthNamePossessive;
107 // QLabel * m_labCalendarSystem;
108 QComboBox * m_comboCalendarSystem;
112 #endif // LOCALETIME_H