-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 28 | ||||
-rw-r--r-- | microkde/kdecore/klocale.cpp | 4 | ||||
-rw-r--r-- | microkde/kdecore/klocale.h | 1 |
3 files changed, 32 insertions, 1 deletions
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index 4cc22ea..c74f8cf 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp | |||
@@ -107,129 +107,155 @@ void DynamicTip::maybeTip( const QPoint &pos ) | |||
107 | int lastSpace = -1; | 107 | int lastSpace = -1; |
108 | int a = 0; | 108 | int a = 0; |
109 | int lastw = 0; | 109 | int lastw = 0; |
110 | 110 | ||
111 | while ( i < int(notes.length()) ) { | 111 | while ( i < int(notes.length()) ) { |
112 | doBreak = FALSE; | 112 | doBreak = FALSE; |
113 | if ( notes[i] != '\n' ) | 113 | if ( notes[i] != '\n' ) |
114 | linew += fm.width( notes[i] ); | 114 | linew += fm.width( notes[i] ); |
115 | 115 | ||
116 | if ( lastSpace >= a && notes[i] != '\n' ) | 116 | if ( lastSpace >= a && notes[i] != '\n' ) |
117 | if (linew >= parentWidget()->width()) { | 117 | if (linew >= parentWidget()->width()) { |
118 | doBreak = TRUE; | 118 | doBreak = TRUE; |
119 | if ( lastSpace > a ) { | 119 | if ( lastSpace > a ) { |
120 | i = lastSpace; | 120 | i = lastSpace; |
121 | linew = lastw; | 121 | linew = lastw; |
122 | } | 122 | } |
123 | else | 123 | else |
124 | i = QMAX( a, i-1 ); | 124 | i = QMAX( a, i-1 ); |
125 | } | 125 | } |
126 | 126 | ||
127 | if ( notes[i] == '\n' || doBreak ) { | 127 | if ( notes[i] == '\n' || doBreak ) { |
128 | s += notes.mid( a, i - a + (doBreak?1:0) ) +"\n"; | 128 | s += notes.mid( a, i - a + (doBreak?1:0) ) +"\n"; |
129 | 129 | ||
130 | a = i + 1; | 130 | a = i + 1; |
131 | lastSpace = a; | 131 | lastSpace = a; |
132 | linew = 0; | 132 | linew = 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | if ( notes[i].isSpace() ) { | 135 | if ( notes[i].isSpace() ) { |
136 | lastSpace = i; | 136 | lastSpace = i; |
137 | lastw = linew; | 137 | lastw = linew; |
138 | } | 138 | } |
139 | 139 | ||
140 | if ( lastSpace <= a ) { | 140 | if ( lastSpace <= a ) { |
141 | lastw = linew; | 141 | lastw = linew; |
142 | } | 142 | } |
143 | 143 | ||
144 | ++i; | 144 | ++i; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | tip( r, s ); | 148 | tip( r, s ); |
149 | } | 149 | } |
150 | else | 150 | else |
151 | hide(); | 151 | hide(); |
152 | ishidden = !ishidden; | 152 | ishidden = !ishidden; |
153 | 153 | ||
154 | } | 154 | } |
155 | 155 | ||
156 | /////////////////////////// | 156 | /////////////////////////// |
157 | // ContactListViewItem Methods | 157 | // ContactListViewItem Methods |
158 | 158 | ||
159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, | 159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, |
160 | ContactListView *parent, | 160 | ContactListView *parent, |
161 | KABC::AddressBook *doc, | 161 | KABC::AddressBook *doc, |
162 | const KABC::Field::List &fields ) | 162 | const KABC::Field::List &fields ) |
163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), | 163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), |
164 | parentListView( parent ), mDocument(doc) | 164 | parentListView( parent ), mDocument(doc) |
165 | { | 165 | { |
166 | refresh(); | 166 | refresh(); |
167 | } | 167 | } |
168 | 168 | ||
169 | QString ContactListViewItem::key(int column, bool ascending) const | 169 | QString ContactListViewItem::key(int column, bool ascending) const |
170 | { | 170 | { |
171 | return QListViewItem::key(column, ascending).lower(); | 171 | int lan = KGlobal::locale()->language(); |
172 | //qDebug("language %d ", lan); | ||
173 | if ( lan == 1 ) { //GERMAN | ||
174 | QString ret = QListViewItem::key(column, ascending).utf8(); | ||
175 | int start = -1; | ||
176 | while ( (start = ret.find( 'ä', start+1)) > 0 ) { | ||
177 | ret.at(start-1) = 'a'; | ||
178 | } | ||
179 | start = -1; | ||
180 | while ( (start = ret.find( 'ö', start+1)) > 0 ) { | ||
181 | ret.at(start-1) = 'o'; | ||
182 | } | ||
183 | start = -1; | ||
184 | while ( (start = ret.find( 'ü', start+1)) > 0 ) { | ||
185 | ret.at(start-1) = 'o'; | ||
186 | } | ||
187 | start = -1; | ||
188 | while ( (start = ret.find( 'ß', start+1)) > 0 ) { | ||
189 | ret.at(start-1) = 's'; | ||
190 | } | ||
191 | //qDebug("conv string %s ", ret.latin1()); | ||
192 | |||
193 | return ret; | ||
194 | |||
195 | } | ||
196 | else | ||
197 | return QListViewItem::key(column, ascending).lower(); | ||
172 | } | 198 | } |
173 | 199 | ||
174 | void ContactListViewItem::paintCell(QPainter * p, | 200 | void ContactListViewItem::paintCell(QPainter * p, |
175 | const QColorGroup & cg, | 201 | const QColorGroup & cg, |
176 | int column, | 202 | int column, |
177 | int width, | 203 | int width, |
178 | int align) | 204 | int align) |
179 | { | 205 | { |
180 | KListViewItem::paintCell(p, cg, column, width, align); | 206 | KListViewItem::paintCell(p, cg, column, width, align); |
181 | 207 | ||
182 | if ( !p ) | 208 | if ( !p ) |
183 | return; | 209 | return; |
184 | 210 | ||
185 | if (parentListView->singleLine()) { | 211 | if (parentListView->singleLine()) { |
186 | p->setPen( parentListView->alternateColor() ); | 212 | p->setPen( parentListView->alternateColor() ); |
187 | p->drawLine( 0, height() - 1, width, height() - 1 ); | 213 | p->drawLine( 0, height() - 1, width, height() - 1 ); |
188 | } | 214 | } |
189 | } | 215 | } |
190 | 216 | ||
191 | 217 | ||
192 | ContactListView *ContactListViewItem::parent() | 218 | ContactListView *ContactListViewItem::parent() |
193 | { | 219 | { |
194 | return parentListView; | 220 | return parentListView; |
195 | } | 221 | } |
196 | 222 | ||
197 | 223 | ||
198 | void ContactListViewItem::refresh() | 224 | void ContactListViewItem::refresh() |
199 | { | 225 | { |
200 | // Update our addressee, since it may have changed else were | 226 | // Update our addressee, since it may have changed else were |
201 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 227 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
202 | if (mAddressee.isEmpty()) | 228 | if (mAddressee.isEmpty()) |
203 | return; | 229 | return; |
204 | 230 | ||
205 | int i = 0; | 231 | int i = 0; |
206 | KABC::Field::List::ConstIterator it; | 232 | KABC::Field::List::ConstIterator it; |
207 | for( it = mFields.begin(); it != mFields.end(); ++it ) { | 233 | for( it = mFields.begin(); it != mFields.end(); ++it ) { |
208 | setText( i++, (*it)->value( mAddressee ) ); | 234 | setText( i++, (*it)->value( mAddressee ) ); |
209 | } | 235 | } |
210 | } | 236 | } |
211 | 237 | ||
212 | /////////////////////////////// | 238 | /////////////////////////////// |
213 | // ContactListView | 239 | // ContactListView |
214 | 240 | ||
215 | ContactListView::ContactListView(KAddressBookTableView *view, | 241 | ContactListView::ContactListView(KAddressBookTableView *view, |
216 | KABC::AddressBook* /* doc */, | 242 | KABC::AddressBook* /* doc */, |
217 | QWidget *parent, | 243 | QWidget *parent, |
218 | const char *name ) | 244 | const char *name ) |
219 | : KListView( parent, name ), | 245 | : KListView( parent, name ), |
220 | pabWidget( view ), | 246 | pabWidget( view ), |
221 | oldColumn( 0 ) | 247 | oldColumn( 0 ) |
222 | { | 248 | { |
223 | mABackground = true; | 249 | mABackground = true; |
224 | mSingleLine = false; | 250 | mSingleLine = false; |
225 | mToolTips = true; | 251 | mToolTips = true; |
226 | #ifndef KAB_EMBEDDED | 252 | #ifndef KAB_EMBEDDED |
227 | mAlternateColor = KGlobalSettings::alternateBackgroundColor(); | 253 | mAlternateColor = KGlobalSettings::alternateBackgroundColor(); |
228 | #else //KAB_EMBEDDED | 254 | #else //KAB_EMBEDDED |
229 | mAlternateColor = QColor(240, 240, 240); | 255 | mAlternateColor = QColor(240, 240, 240); |
230 | #endif //KAB_EMBEDDED | 256 | #endif //KAB_EMBEDDED |
231 | 257 | ||
232 | setAlternateBackgroundEnabled(mABackground); | 258 | setAlternateBackgroundEnabled(mABackground); |
233 | setAcceptDrops( true ); | 259 | setAcceptDrops( true ); |
234 | viewport()->setAcceptDrops( true ); | 260 | viewport()->setAcceptDrops( true ); |
235 | setAllColumnsShowFocus( true ); | 261 | setAllColumnsShowFocus( true ); |
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 673d845..3674f28 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp | |||
@@ -103,128 +103,132 @@ KLocale::KLocale() : mCalendarSystem( 0 ) | |||
103 | << i18n ("-02:00 Brazil/DeNoronha") | 103 | << i18n ("-02:00 Brazil/DeNoronha") |
104 | << i18n ("-01:00 Atlantic/Azores") | 104 | << i18n ("-01:00 Atlantic/Azores") |
105 | << i18n (" 00:00 Europe/London(UTC)") | 105 | << i18n (" 00:00 Europe/London(UTC)") |
106 | << i18n ("+01:00 Europe/Oslo(CET)") | 106 | << i18n ("+01:00 Europe/Oslo(CET)") |
107 | << i18n ("+02:00 Europe/Helsinki") | 107 | << i18n ("+02:00 Europe/Helsinki") |
108 | << i18n ("+03:00 Europe/Moscow") | 108 | << i18n ("+03:00 Europe/Moscow") |
109 | << i18n ("+04:00 Indian/Mauritius") | 109 | << i18n ("+04:00 Indian/Mauritius") |
110 | << i18n ("+05:00 Indian/Maldives") | 110 | << i18n ("+05:00 Indian/Maldives") |
111 | << i18n ("+06:00 Indian/Chagos") | 111 | << i18n ("+06:00 Indian/Chagos") |
112 | << i18n ("+07:00 Asia/Bangkok") | 112 | << i18n ("+07:00 Asia/Bangkok") |
113 | << i18n ("+08:00 Asia/Hongkong") | 113 | << i18n ("+08:00 Asia/Hongkong") |
114 | << i18n ("+09:00 Asia/Tokyo") | 114 | << i18n ("+09:00 Asia/Tokyo") |
115 | << i18n ("+10:00 Asia/Vladivostok") | 115 | << i18n ("+10:00 Asia/Vladivostok") |
116 | << i18n ("+11:00 Asia/Magadan") | 116 | << i18n ("+11:00 Asia/Magadan") |
117 | << i18n ("+12:00 Asia/Kamchatka") | 117 | << i18n ("+12:00 Asia/Kamchatka") |
118 | // << i18n (" xx:xx User defined offset") | 118 | // << i18n (" xx:xx User defined offset") |
119 | << i18n (" Local Time"); | 119 | << i18n (" Local Time"); |
120 | mSouthDaylight = false; | 120 | mSouthDaylight = false; |
121 | mTimeZoneOffset = 0; | 121 | mTimeZoneOffset = 0; |
122 | daylightEnabled = false; | 122 | daylightEnabled = false; |
123 | } | 123 | } |
124 | 124 | ||
125 | void KLocale::setDateFormat( QString s ) | 125 | void KLocale::setDateFormat( QString s ) |
126 | { | 126 | { |
127 | mDateFormat = s; | 127 | mDateFormat = s; |
128 | } | 128 | } |
129 | 129 | ||
130 | void KLocale::setDateFormatShort( QString s ) | 130 | void KLocale::setDateFormatShort( QString s ) |
131 | { | 131 | { |
132 | mDateFormatShort = s; | 132 | mDateFormatShort = s; |
133 | } | 133 | } |
134 | 134 | ||
135 | void KLocale::setHore24Format ( bool b ) | 135 | void KLocale::setHore24Format ( bool b ) |
136 | { | 136 | { |
137 | mHourF24Format = b; | 137 | mHourF24Format = b; |
138 | } | 138 | } |
139 | void KLocale::setWeekStartMonday( bool b ) | 139 | void KLocale::setWeekStartMonday( bool b ) |
140 | { | 140 | { |
141 | mWeekStartsMonday = b; | 141 | mWeekStartsMonday = b; |
142 | } | 142 | } |
143 | 143 | ||
144 | KLocale::IntDateFormat KLocale::getIntDateFormat( ) | 144 | KLocale::IntDateFormat KLocale::getIntDateFormat( ) |
145 | { | 145 | { |
146 | return mIntDateFormat; | 146 | return mIntDateFormat; |
147 | 147 | ||
148 | } | 148 | } |
149 | void KLocale::setIntDateFormat( KLocale::IntDateFormat i ) | 149 | void KLocale::setIntDateFormat( KLocale::IntDateFormat i ) |
150 | { | 150 | { |
151 | mIntDateFormat = i; | 151 | mIntDateFormat = i; |
152 | } | 152 | } |
153 | KLocale::IntDateFormat KLocale::getIntTimeFormat( ) | 153 | KLocale::IntDateFormat KLocale::getIntTimeFormat( ) |
154 | { | 154 | { |
155 | return mIntTimeFormat; | 155 | return mIntTimeFormat; |
156 | 156 | ||
157 | } | 157 | } |
158 | void KLocale::setIntTimeFormat( KLocale::IntDateFormat i ) | 158 | void KLocale::setIntTimeFormat( KLocale::IntDateFormat i ) |
159 | { | 159 | { |
160 | mIntTimeFormat = i; | 160 | mIntTimeFormat = i; |
161 | } | 161 | } |
162 | 162 | ||
163 | void KLocale::setLanguage( int i ) | 163 | void KLocale::setLanguage( int i ) |
164 | { | 164 | { |
165 | mLanguage = i; | 165 | mLanguage = i; |
166 | } | 166 | } |
167 | int KLocale::language( ) | ||
168 | { | ||
169 | return mLanguage; | ||
170 | } | ||
167 | QString KLocale::translate( const char *index ) const | 171 | QString KLocale::translate( const char *index ) const |
168 | { | 172 | { |
169 | return i18n( index ); | 173 | return i18n( index ); |
170 | } | 174 | } |
171 | 175 | ||
172 | QString KLocale::translate( const char *, const char *fallback) const | 176 | QString KLocale::translate( const char *, const char *fallback) const |
173 | { | 177 | { |
174 | return i18n( fallback ); | 178 | return i18n( fallback ); |
175 | } | 179 | } |
176 | 180 | ||
177 | QString KLocale::formatTime(const QTime &pTime, bool includeSecs, IntDateFormat intIntDateFormat) const | 181 | QString KLocale::formatTime(const QTime &pTime, bool includeSecs, IntDateFormat intIntDateFormat) const |
178 | { | 182 | { |
179 | const QString rst = timeFormat(intIntDateFormat); | 183 | const QString rst = timeFormat(intIntDateFormat); |
180 | 184 | ||
181 | // only "pm/am" here can grow, the rest shrinks, but | 185 | // only "pm/am" here can grow, the rest shrinks, but |
182 | // I'm rather safe than sorry | 186 | // I'm rather safe than sorry |
183 | QChar *buffer = new QChar[rst.length() * 3 / 2 + 30]; | 187 | QChar *buffer = new QChar[rst.length() * 3 / 2 + 30]; |
184 | 188 | ||
185 | uint index = 0; | 189 | uint index = 0; |
186 | bool escape = false; | 190 | bool escape = false; |
187 | int number = 0; | 191 | int number = 0; |
188 | 192 | ||
189 | for ( uint format_index = 0; format_index < rst.length(); format_index++ ) | 193 | for ( uint format_index = 0; format_index < rst.length(); format_index++ ) |
190 | { | 194 | { |
191 | if ( !escape ) | 195 | if ( !escape ) |
192 | { | 196 | { |
193 | if ( rst.at( format_index ).unicode() == '%' ) | 197 | if ( rst.at( format_index ).unicode() == '%' ) |
194 | escape = true; | 198 | escape = true; |
195 | else | 199 | else |
196 | buffer[index++] = rst.at( format_index ); | 200 | buffer[index++] = rst.at( format_index ); |
197 | } | 201 | } |
198 | else | 202 | else |
199 | { | 203 | { |
200 | switch ( rst.at( format_index ).unicode() ) | 204 | switch ( rst.at( format_index ).unicode() ) |
201 | { | 205 | { |
202 | case '%': | 206 | case '%': |
203 | buffer[index++] = '%'; | 207 | buffer[index++] = '%'; |
204 | break; | 208 | break; |
205 | case 'H': | 209 | case 'H': |
206 | put_it_in( buffer, index, pTime.hour() ); | 210 | put_it_in( buffer, index, pTime.hour() ); |
207 | break; | 211 | break; |
208 | case 'I': | 212 | case 'I': |
209 | put_it_in( buffer, index, ( pTime.hour() + 11) % 12 + 1 ); | 213 | put_it_in( buffer, index, ( pTime.hour() + 11) % 12 + 1 ); |
210 | break; | 214 | break; |
211 | case 'M': | 215 | case 'M': |
212 | put_it_in( buffer, index, pTime.minute() ); | 216 | put_it_in( buffer, index, pTime.minute() ); |
213 | break; | 217 | break; |
214 | case 'S': | 218 | case 'S': |
215 | if (includeSecs) | 219 | if (includeSecs) |
216 | put_it_in( buffer, index, pTime.second() ); | 220 | put_it_in( buffer, index, pTime.second() ); |
217 | else | 221 | else |
218 | { | 222 | { |
219 | // we remove the seperator sign before the seconds and | 223 | // we remove the seperator sign before the seconds and |
220 | // assume that works everywhere | 224 | // assume that works everywhere |
221 | --index; | 225 | --index; |
222 | break; | 226 | break; |
223 | } | 227 | } |
224 | break; | 228 | break; |
225 | case 'k': | 229 | case 'k': |
226 | number = pTime.hour(); | 230 | number = pTime.hour(); |
227 | case 'l': | 231 | case 'l': |
228 | // to share the code | 232 | // to share the code |
229 | if ( rst.at( format_index ).unicode() == 'l' ) | 233 | if ( rst.at( format_index ).unicode() == 'l' ) |
230 | number = (pTime.hour() + 11) % 12 + 1; | 234 | number = (pTime.hour() + 11) % 12 + 1; |
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h index be9442c..14660d6 100644 --- a/microkde/kdecore/klocale.h +++ b/microkde/kdecore/klocale.h | |||
@@ -19,100 +19,101 @@ QString i18n(const char *text1, const char *textn, int num); | |||
19 | // Qt3's uic generates i18n( "msg", "comment" ) calls which conflict | 19 | // Qt3's uic generates i18n( "msg", "comment" ) calls which conflict |
20 | // with our i18n method. we use uic -tr tr2i18n to redirect | 20 | // with our i18n method. we use uic -tr tr2i18n to redirect |
21 | // to the right i18n() function | 21 | // to the right i18n() function |
22 | inline QString tr2i18n(const char* message, const char* =0) { | 22 | inline QString tr2i18n(const char* message, const char* =0) { |
23 | return i18n( message); | 23 | return i18n( message); |
24 | } | 24 | } |
25 | 25 | ||
26 | class KLocale | 26 | class KLocale |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | KLocale(); | 29 | KLocale(); |
30 | 30 | ||
31 | QString formatNumber(double num, int precision = -1) const; | 31 | QString formatNumber(double num, int precision = -1) const; |
32 | QString formatNumber(const QString &numStr) const; | 32 | QString formatNumber(const QString &numStr) const; |
33 | double readNumber(const QString &numStr, bool * ok = 0) const; | 33 | double readNumber(const QString &numStr, bool * ok = 0) const; |
34 | 34 | ||
35 | QString decimalSymbol() const; | 35 | QString decimalSymbol() const; |
36 | QString thousandsSeparator() const; | 36 | QString thousandsSeparator() const; |
37 | QString positiveSign() const; | 37 | QString positiveSign() const; |
38 | QString negativeSign() const; | 38 | QString negativeSign() const; |
39 | 39 | ||
40 | 40 | ||
41 | QString translate( const char *index ) const; | 41 | QString translate( const char *index ) const; |
42 | QString translate( const char *index, const char *fallback) const; | 42 | QString translate( const char *index, const char *fallback) const; |
43 | 43 | ||
44 | enum IntDateFormat { Undefined=-1, Default=0, Format1=1, ISODate=2, Userdefined=3 }; | 44 | enum IntDateFormat { Undefined=-1, Default=0, Format1=1, ISODate=2, Userdefined=3 }; |
45 | 45 | ||
46 | QString formatDate(const QDate &pDate, bool shortFormat = false, IntDateFormat intIntDateFormat = Undefined) const; | 46 | QString formatDate(const QDate &pDate, bool shortFormat = false, IntDateFormat intIntDateFormat = Undefined) const; |
47 | QString formatTime(const QTime &pTime, bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const; | 47 | QString formatTime(const QTime &pTime, bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const; |
48 | QString formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat = Undefined) const; | 48 | QString formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat = Undefined) const; |
49 | QString formatDateTime(const QDateTime &pDateTime, | 49 | QString formatDateTime(const QDateTime &pDateTime, |
50 | bool shortFormat, | 50 | bool shortFormat, |
51 | bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const; | 51 | bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const; |
52 | 52 | ||
53 | QDate readDate(const QString &str, bool* ok = 0) const; | 53 | QDate readDate(const QString &str, bool* ok = 0) const; |
54 | QDate readDate( const QString &intstr, const QString &fmt, bool* ok = 0) const; | 54 | QDate readDate( const QString &intstr, const QString &fmt, bool* ok = 0) const; |
55 | QTime readTime(const QString &str, bool* ok = 0) const; | 55 | QTime readTime(const QString &str, bool* ok = 0) const; |
56 | QDate readDate(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const; | 56 | QDate readDate(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const; |
57 | 57 | ||
58 | QDateTime readDateTime(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const; | 58 | QDateTime readDateTime(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const; |
59 | 59 | ||
60 | bool use12Clock() const; | 60 | bool use12Clock() const; |
61 | bool weekStartsMonday() const; | 61 | bool weekStartsMonday() const; |
62 | int weekStartDay() const; | 62 | int weekStartDay() const; |
63 | 63 | ||
64 | QString weekDayName(int,bool=false) const; | 64 | QString weekDayName(int,bool=false) const; |
65 | QString monthName(int,bool=false) const; | 65 | QString monthName(int,bool=false) const; |
66 | 66 | ||
67 | QString country() const; | 67 | QString country() const; |
68 | 68 | ||
69 | QString dateFormat(IntDateFormat intIntDateFormat = Undefined) const; | 69 | QString dateFormat(IntDateFormat intIntDateFormat = Undefined) const; |
70 | QString dateFormatShort(IntDateFormat intIntDateFormat = Undefined) const; | 70 | QString dateFormatShort(IntDateFormat intIntDateFormat = Undefined) const; |
71 | QString timeFormat(IntDateFormat intIntDateFormat = Undefined) const; | 71 | QString timeFormat(IntDateFormat intIntDateFormat = Undefined) const; |
72 | 72 | ||
73 | void insertCatalogue ( const QString & ); | 73 | void insertCatalogue ( const QString & ); |
74 | 74 | ||
75 | KCalendarSystem *calendar(); | 75 | KCalendarSystem *calendar(); |
76 | void setHore24Format ( bool ); | 76 | void setHore24Format ( bool ); |
77 | void setWeekStartMonday( bool ); | 77 | void setWeekStartMonday( bool ); |
78 | void setIntDateFormat( IntDateFormat ); | 78 | void setIntDateFormat( IntDateFormat ); |
79 | void setIntTimeFormat( IntDateFormat ); | 79 | void setIntTimeFormat( IntDateFormat ); |
80 | IntDateFormat getIntDateFormat( ); | 80 | IntDateFormat getIntDateFormat( ); |
81 | IntDateFormat getIntTimeFormat( ); | 81 | IntDateFormat getIntTimeFormat( ); |
82 | void setLanguage( int ); | 82 | void setLanguage( int ); |
83 | int language(); | ||
83 | void setDateFormat( QString ); | 84 | void setDateFormat( QString ); |
84 | void setDateFormatShort( QString ); | 85 | void setDateFormatShort( QString ); |
85 | 86 | ||
86 | QString m_decimalSymbol; | 87 | QString m_decimalSymbol; |
87 | QString m_thousandsSeparator; | 88 | QString m_thousandsSeparator; |
88 | QString m_currencySymbol; | 89 | QString m_currencySymbol; |
89 | QString m_monetaryDecimalSymbol; | 90 | QString m_monetaryDecimalSymbol; |
90 | QString m_monetaryThousandsSeparator; | 91 | QString m_monetaryThousandsSeparator; |
91 | QString m_positiveSign; | 92 | QString m_positiveSign; |
92 | QString m_negativeSign; | 93 | QString m_negativeSign; |
93 | 94 | ||
94 | int timezoneOffset( QString ); | 95 | int timezoneOffset( QString ); |
95 | QStringList timeZoneList() const; | 96 | QStringList timeZoneList() const; |
96 | void setDaylightSaving( bool, int , int ); | 97 | void setDaylightSaving( bool, int , int ); |
97 | int localTimeOffset(const QDateTime &); | 98 | int localTimeOffset(const QDateTime &); |
98 | void setTimezone( const QString &timeZone , bool oddTZ); | 99 | void setTimezone( const QString &timeZone , bool oddTZ); |
99 | private: | 100 | private: |
100 | QTime readTime(const QString &str, bool seconds, bool *ok) const; | 101 | QTime readTime(const QString &str, bool seconds, bool *ok) const; |
101 | QDate readDate(const QString &str, bool shortFormat, bool *ok) const; | 102 | QDate readDate(const QString &str, bool shortFormat, bool *ok) const; |
102 | KCalendarSystem *mCalendarSystem; | 103 | KCalendarSystem *mCalendarSystem; |
103 | bool mWeekStartsMonday; | 104 | bool mWeekStartsMonday; |
104 | bool mHourF24Format; | 105 | bool mHourF24Format; |
105 | IntDateFormat mIntDateFormat; | 106 | IntDateFormat mIntDateFormat; |
106 | IntDateFormat mIntTimeFormat; | 107 | IntDateFormat mIntTimeFormat; |
107 | int mLanguage; | 108 | int mLanguage; |
108 | QString mDateFormat; | 109 | QString mDateFormat; |
109 | QString mDateFormatShort; | 110 | QString mDateFormatShort; |
110 | QStringList mTimeZoneList; | 111 | QStringList mTimeZoneList; |
111 | bool daylightEnabled; | 112 | bool daylightEnabled; |
112 | int mDaylightTZoffset; | 113 | int mDaylightTZoffset; |
113 | int mNondaylightTZoffset; | 114 | int mNondaylightTZoffset; |
114 | bool mSouthDaylight; | 115 | bool mSouthDaylight; |
115 | int daylightStart, daylightEnd, mTimeZoneOffset; | 116 | int daylightStart, daylightEnd, mTimeZoneOffset; |
116 | }; | 117 | }; |
117 | 118 | ||
118 | #endif | 119 | #endif |