author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kdecore/klocale.h | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
-rw-r--r-- | microkde/kdecore/klocale.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h new file mode 100644 index 0000000..7470cd2 --- a/dev/null +++ b/microkde/kdecore/klocale.h | |||
@@ -0,0 +1,110 @@ | |||
1 | #ifndef MINIKDE_KLOCALE_H | ||
2 | #define MINIKDE_KLOCALE_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <qstringlist.h> | ||
6 | #include <qdatetime.h> | ||
7 | #include <qdict.h> | ||
8 | |||
9 | #ifndef I18N_NOOP | ||
10 | #define I18N_NOOP(x) (x) | ||
11 | #endif | ||
12 | |||
13 | class KCalendarSystem; | ||
14 | void setLocaleDict( QDict<QString> * dict ); | ||
15 | QString i18n(const char *text); | ||
16 | QString i18n(const char *hint, const char *text); | ||
17 | QString i18n(const char *text1, const char *textn, int num); | ||
18 | |||
19 | // Qt3's uic generates i18n( "msg", "comment" ) calls which conflict | ||
20 | // with our i18n method. we use uic -tr tr2i18n to redirect | ||
21 | // to the right i18n() function | ||
22 | inline QString tr2i18n(const char* message, const char* =0) { | ||
23 | return i18n( message); | ||
24 | } | ||
25 | |||
26 | class KLocale | ||
27 | { | ||
28 | public: | ||
29 | KLocale(); | ||
30 | |||
31 | QString formatNumber(double num, int precision = -1) const; | ||
32 | QString formatNumber(const QString &numStr) const; | ||
33 | double readNumber(const QString &numStr, bool * ok = 0) const; | ||
34 | |||
35 | QString decimalSymbol() const; | ||
36 | QString thousandsSeparator() const; | ||
37 | QString positiveSign() const; | ||
38 | QString negativeSign() const; | ||
39 | |||
40 | |||
41 | QString translate( const char *index ) const; | ||
42 | QString translate( const char *index, const char *fallback) const; | ||
43 | |||
44 | QString formatDate(const QDate &pDate, bool shortFormat = false) const; | ||
45 | QString formatTime(const QTime &pTime, bool includeSecs = false) const; | ||
46 | QString formatDateTime(const QDateTime &pDateTime) const; | ||
47 | QString formatDateTime(const QDateTime &pDateTime, | ||
48 | bool shortFormat, | ||
49 | bool includeSecs = false) const; | ||
50 | |||
51 | QDate readDate(const QString &str, bool* ok = 0) const; | ||
52 | QDate readDate( const QString &intstr, const QString &fmt, bool* ok = 0) const; | ||
53 | QTime readTime(const QString &str, bool* ok = 0) const; | ||
54 | |||
55 | bool use12Clock() const; | ||
56 | bool weekStartsMonday() const; | ||
57 | int weekStartDay() const; | ||
58 | |||
59 | QString weekDayName(int,bool=false) const; | ||
60 | QString monthName(int,bool=false) const; | ||
61 | |||
62 | QString country() const; | ||
63 | |||
64 | QString dateFormat() const; | ||
65 | QString dateFormatShort() const; | ||
66 | QString timeFormat() const; | ||
67 | |||
68 | void insertCatalogue ( const QString & ); | ||
69 | |||
70 | KCalendarSystem *calendar(); | ||
71 | void setHore24Format ( bool ); | ||
72 | void setWeekStartMonday( bool ); | ||
73 | void setIntDateFormat( int ); | ||
74 | int getIntDateFormat( ); | ||
75 | void setLanguage( int ); | ||
76 | void setDateFormat( QString ); | ||
77 | void setDateFormatShort( QString ); | ||
78 | |||
79 | QString m_decimalSymbol; | ||
80 | QString m_thousandsSeparator; | ||
81 | QString m_currencySymbol; | ||
82 | QString m_monetaryDecimalSymbol; | ||
83 | QString m_monetaryThousandsSeparator; | ||
84 | QString m_positiveSign; | ||
85 | QString m_negativeSign; | ||
86 | |||
87 | int timezoneOffset( QString ); | ||
88 | QStringList timeZoneList() const; | ||
89 | void setDaylightSaving( bool, int , int ); | ||
90 | int localTimeOffset(const QDateTime &); | ||
91 | void setTimezone( const QString &timeZone ); | ||
92 | private: | ||
93 | QTime readTime(const QString &str, bool seconds, bool *ok) const; | ||
94 | QDate readDate(const QString &str, bool shortFormat, bool *ok) const; | ||
95 | KCalendarSystem *mCalendarSystem; | ||
96 | bool mWeekStartsMonday; | ||
97 | bool mHourF24Format; | ||
98 | int mIntDateFormat; | ||
99 | int mLanguage; | ||
100 | QString mDateFormat; | ||
101 | QString mDateFormatShort; | ||
102 | QStringList mTimeZoneList; | ||
103 | bool daylightEnabled; | ||
104 | int mDaylightTZoffset; | ||
105 | int mNondaylightTZoffset; | ||
106 | bool mSouthDaylight; | ||
107 | int daylightStart, daylightEnd, mTimeZoneOffset; | ||
108 | }; | ||
109 | |||
110 | #endif | ||