1 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/calendarsystem.h kde-runtime-4.9.0/plasma/declarativeimports/locale/calendarsystem.h
2 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/calendarsystem.h 2012-05-23 01:59:52.000000000 +0200
3 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/calendarsystem.h 2012-07-29 10:43:38.395812270 +0200
5 #define CALENDARSYSTEM_H
8 -#include "locale.h" // needed for enums
9 +#include "kdelocale.h" // needed for enums
12 #include <QtCore/QDate>
13 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/CMakeLists.txt kde-runtime-4.9.0/plasma/declarativeimports/locale/CMakeLists.txt
14 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/CMakeLists.txt 2012-06-19 23:47:36.000000000 +0200
15 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/CMakeLists.txt 2012-07-29 10:52:01.795222262 +0200
19 set(localebindings_SRCS
22 localebindingsplugin.cpp
25 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/kdelocale.cpp kde-runtime-4.9.0/plasma/declarativeimports/locale/kdelocale.cpp
26 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/kdelocale.cpp 1970-01-01 01:00:00.000000000 +0100
27 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/kdelocale.cpp 2012-07-29 10:43:47.799379026 +0200
29 +/* This file is part of the KDE libraries
30 + Copyright (C) 2012 Giorgos Tsiapaliwkas <terietor@gmail.com>
31 + Copyright (C) 2012 Antonis Tsiapaliokas <kok3rs@gmail.com>
33 + This library is free software; you can redistribute it and/or
34 + modify it under the terms of the GNU Library General Public
35 + License as published by the Free Software Foundation; either
36 + version 2 of the License, or (at your option) any later version.
38 + This library is distributed in the hope that it will be useful,
39 + but WITHOUT ANY WARRANTY; without even the implied warranty of
40 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41 + Library General Public License for more details.
43 + You should have received a copy of the GNU Library General Public License
44 + along with this library; see the file COPYING.LIB. If not, write to
45 + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
46 + Boston, MA 02110-1301, USA.
50 +#include "kdelocale.h"
55 +Locale::Locale(QObject* parent)
58 + m_locale = KGlobal::locale();
61 +bool Locale::setCountryDivisionCode(const QString &countryDivisionCode)
63 + bool ok = m_locale->setCountryDivisionCode(countryDivisionCode);
64 + emit countryDivisionCodeChanged();
68 +void Locale::setCurrencyCode(const QString &newCurrencyCode)
70 + m_locale->setCurrencyCode(newCurrencyCode);
71 + emit currencyCodeChanged();
74 +bool Locale::isApplicationTranslatedInto(const QString &lang)
76 + return m_locale->isApplicationTranslatedInto(lang);
79 +void Locale::splitLocale(const QString &locale, QString &language, QString &country, QString &modifier,
82 + Locale::splitLocale(locale, language, country, modifier, charset);
85 +QString Locale::language() const
87 + return m_locale->language();
90 +QString Locale::country() const
92 + return m_locale->country();
95 +QString Locale::countryDivisionCode() const
97 + return m_locale->countryDivisionCode();
100 +QString Locale::currencyCode() const
102 + return m_locale->currencyCode();
105 +QString Locale::translateQt(const char *context, const char *sourceText, const char *comment) const
107 + return m_locale->translateQt(context, sourceText, comment);
110 +QList<int> Locale::allDigitSetsList() const
112 + QList<int> digitList;
114 + foreach(KLocale::DigitSet digit, m_locale->allDigitSetsList()) {
115 + digitList.append((int)digit);
121 +QString Locale::digitSetToName(Locale::DigitSet digitSet, bool withDigits) const
123 + return m_locale->digitSetToName((KLocale::DigitSet)digitSet, withDigits);
126 +QString Locale::convertDigits(const QString &str, DigitSet digitSet, bool ignoreContext) const
128 + return m_locale->convertDigits(str, (KLocale::DigitSet)digitSet, ignoreContext);
131 +bool Locale::dateMonthNamePossessive() const
133 + return m_locale->dateMonthNamePossessive();
136 +int Locale::weekStartDay() const
138 + return m_locale->weekStartDay();
141 +int Locale::workingWeekStartDay() const
143 + return m_locale->workingWeekStartDay();
146 +int Locale::workingWeekEndDay() const
148 + return m_locale->workingWeekEndDay();
151 +int Locale::weekDayOfPray() const
153 + return m_locale->weekDayOfPray();
156 +int Locale::decimalPlaces() const
158 + return m_locale->decimalPlaces();
161 +QString Locale::decimalSymbol() const
163 + return m_locale->decimalSymbol();
166 +QString Locale::thousandsSeparator() const
168 + return m_locale->thousandsSeparator();
171 +QString Locale::currencySymbol() const
173 + return m_locale->currencySymbol();
176 +QString Locale::monetaryDecimalSymbol() const
178 + return m_locale->monetaryDecimalSymbol();
181 +QString Locale::monetaryThousandsSeparator() const
183 + return m_locale->monetaryThousandsSeparator();
186 +QString Locale::positiveSign() const
188 + return m_locale->positiveSign();
191 +QString Locale::negativeSign() const
193 + return m_locale->negativeSign();
196 +int Locale::monetaryDecimalPlaces() const
198 + return m_locale->monetaryDecimalPlaces();
201 +bool Locale::positivePrefixCurrencySymbol() const
203 + return m_locale->positivePrefixCurrencySymbol();
206 +bool Locale::negativePrefixCurrencySymbol() const
208 + return m_locale->negativePrefixCurrencySymbol();
211 +Locale::SignPosition Locale::positiveMonetarySignPosition() const
213 + return (Locale::SignPosition)m_locale->positiveMonetarySignPosition();
216 +Locale::SignPosition Locale::negativeMonetarySignPosition() const
218 + return (Locale::SignPosition)m_locale->negativeMonetarySignPosition();
221 +QString Locale::formatMoney(double num, const QString &symbol, int precision) const
223 + return m_locale->formatMoney(num, symbol, precision);
226 +QString Locale::formatLong(long num) const
228 + return m_locale->formatLong(num);
231 +QString Locale::formatNumber(const QString &numStr, bool round, int precision) const
233 + return m_locale->formatNumber(numStr, round, precision);
236 +QString Locale::formatByteSize(double size, int precision, Locale::BinaryUnitDialect dialect,
237 + Locale::BinarySizeUnits specificUnit) const
239 + return m_locale->formatByteSize(size, precision, (KLocale::BinaryUnitDialect)dialect, (KLocale::BinarySizeUnits)specificUnit);
242 +QString Locale::formatByteSize(double size) const
244 + return m_locale->formatByteSize(size);
247 +Locale::BinaryUnitDialect Locale::binaryUnitDialect() const
249 + return (Locale::BinaryUnitDialect)m_locale->binaryUnitDialect();
252 +void Locale::setBinaryUnitDialect(Locale::BinaryUnitDialect newDialect)
254 + m_locale->setBinaryUnitDialect((KLocale::BinaryUnitDialect)newDialect);
255 + emit binaryUnitDialectChanged();
258 +QString Locale::formatDuration(unsigned long mSec) const
260 + return m_locale->formatDuration(mSec);
263 +QString Locale::prettyFormatDuration(unsigned long mSec) const
265 + return m_locale->prettyFormatDuration(mSec);
268 +QString Locale::formatDate(const QDate &date, Locale::DateFormat format) const
270 + return m_locale->formatDate(date, (KLocale::DateFormat)format);
273 +double Locale::readNumber(const QString &_str) const
276 + return m_locale->readNumber(_str, &ok);
279 +double Locale::readMoney(const QString &_str) const
282 + return m_locale->readMoney(_str, &ok);
285 +QDate Locale::readDate(const QString &intstr, ReadDateFlags flags) const
288 + return m_locale->readDate(intstr, (KLocale::ReadDateFlags)flags, &ok);
291 +QTime Locale::readTime(const QString &intstr) const
294 + return m_locale->readTime(intstr, &ok);
297 +QTime Locale::readLocaleTime(const QString &intstr, TimeFormatOptions options,
298 + TimeProcessingOptions processing) const
301 + return m_locale->readLocaleTime(intstr, &ok, (KLocale::TimeFormatOptions)(int)options, (KLocale::TimeProcessingOptions)(int)processing);
304 +QString Locale::formatLocaleTime(const QTime &time, TimeFormatOptions options) const
306 + return m_locale->formatLocaleTime(time, (KLocale::TimeFormatOptions)(int)options);
309 +bool Locale::use12Clock() const
311 + return m_locale->use12Clock();
314 +QString Locale::dayPeriodText(const QTime &time, DateTimeComponentFormat format) const
316 + return m_locale->dayPeriodText(time, (KLocale::DateTimeComponentFormat)format);
319 +QStringList Locale::languageList() const
321 + return m_locale->languageList();
324 +QStringList Locale::currencyCodeList() const
326 + return m_locale->currencyCodeList();
329 +QString Locale::formatDateTime(const QDateTime &dateTime, Locale::DateFormat format, DateTimeFormatOptions options) const
331 + return m_locale->formatDateTime(dateTime, (KLocale::DateFormat)format, (KLocale::DateTimeFormatOptions)(int)options);
334 +void Locale::setDateFormat(const QString &format)
336 + m_locale->setDateFormat(format);
337 + emit dateFormatChanged();
340 +void Locale::setDateFormatShort(const QString &format)
342 + m_locale->setDateFormatShort(format);
343 + emit dateFormatShortChanged();
346 +void Locale::setDateMonthNamePossessive(bool possessive)
348 + m_locale->setDateMonthNamePossessive(possessive);
349 + emit dateMonthNamePossessiveChanged();
352 +void Locale::setTimeFormat(const QString &format)
354 + m_locale->setTimeFormat(format);
355 + emit timeFormatChanged();
358 +void Locale::setWeekStartDay(int day)
360 + m_locale->setWeekStartDay(day);
361 + emit weekStartDayChanged();
364 +void Locale::setWorkingWeekStartDay(int day)
366 + m_locale->setWorkingWeekStartDay(day);
367 + emit workingWeekStartDayChanged();
370 +void Locale::setWorkingWeekEndDay(int day)
372 + m_locale->setWorkingWeekEndDay(day);
373 + emit workingWeekEndDayChanged();
376 +void Locale::setWeekDayOfPray(int day)
378 + m_locale->setWeekDayOfPray(day);
379 + emit weekDayOfPrayChanged();
382 +QString Locale::dateFormat() const
384 + return m_locale->dateFormat();
387 +QString Locale::dateFormatShort() const
389 + return m_locale->dateFormatShort();
392 +QString Locale::timeFormat() const
394 + return m_locale->timeFormat();
397 +void Locale::setDecimalPlaces(int digits)
399 + m_locale->setDecimalPlaces(digits);
400 + emit decimalPlacesChanged();
403 +void Locale::setDecimalSymbol(const QString &symbol)
405 + m_locale->setDecimalSymbol(symbol);
406 + emit decimalSymbolChanged();
409 +void Locale::setThousandsSeparator(const QString &separator)
411 + m_locale->setThousandsSeparator(separator);
412 + emit thousandsSeparatorChanged();
415 +void Locale::setPositiveSign(const QString &sign)
417 + m_locale->setPositiveSign(sign);
418 + emit positiveSignChanged();
421 +void Locale::setNegativeSign(const QString &sign)
423 + m_locale->setNegativeSign(sign);
424 + emit negativeSignChanged();
427 +void Locale::setPositiveMonetarySignPosition(Locale::SignPosition signpos)
429 + m_locale->setPositiveMonetarySignPosition((KLocale::SignPosition)signpos);
430 + emit positiveMonetarySignPositionChanged();
433 +void Locale::setNegativeMonetarySignPosition(Locale::SignPosition signpos)
435 + m_locale->setNegativeMonetarySignPosition((KLocale::SignPosition)signpos);
436 + emit negativeMonetarySignPositionChanged();
439 +void Locale::setPositivePrefixCurrencySymbol(bool prefix)
441 + m_locale->setPositivePrefixCurrencySymbol(prefix);
442 + emit positivePrefixCurrencySymbolChanged();
445 +void Locale::setNegativePrefixCurrencySymbol(bool prefix)
447 + m_locale->setNegativePrefixCurrencySymbol(prefix);
448 + emit negativePrefixCurrencySymbolChanged();
451 +void Locale::setMonetaryDecimalPlaces(int digits)
453 + m_locale->setMonetaryDecimalPlaces(digits);
454 + emit monetaryDecimalPlacesChanged();
457 +void Locale::setMonetaryThousandsSeparator(const QString &separator)
459 + m_locale->setMonetaryThousandsSeparator(separator);
460 + emit monetaryThousandsSeparatorChanged();
463 +void Locale::setMonetaryDecimalSymbol(const QString &symbol)
465 + m_locale->setMonetaryDecimalSymbol(symbol);
466 + emit monetaryDecimalSymbolChanged();
469 +void Locale::setCurrencySymbol(const QString & symbol)
471 + m_locale->setCurrencySymbol(symbol);
472 + emit currencySymbolChanged();
475 +int Locale::pageSize() const
477 + return m_locale->pageSize();
480 +void Locale::setPageSize(int size)
482 + m_locale->setPageSize(size);
483 + emit pageSizeChanged();
486 +Locale::MeasureSystem Locale::measureSystem() const
488 + return (Locale::MeasureSystem)m_locale->measureSystem();
491 +void Locale::setMeasureSystem(Locale::MeasureSystem value)
493 + m_locale->setMeasureSystem((KLocale::MeasureSystem)value);
494 + emit measureSystemChanged();
497 +QString Locale::defaultLanguage()
499 + return KLocale::defaultLanguage();
502 +QString Locale::defaultCountry()
504 + return KLocale::defaultCountry();
507 +QString Locale::defaultCurrencyCode()
509 + return KLocale::defaultCurrencyCode();
512 +bool Locale::useTranscript() const
514 + return m_locale->useTranscript();
517 +int Locale::fileEncodingMib() const
519 + return m_locale->fileEncodingMib();
522 +QStringList Locale::allLanguagesList() const
524 + return m_locale->allLanguagesList();
527 +QStringList Locale::installedLanguages() const
529 + return m_locale->installedLanguages();
532 +QString Locale::languageCodeToName(const QString &language) const
534 + return m_locale->languageCodeToName(language);
537 +QStringList Locale::allCountriesList() const
539 + return m_locale->allCountriesList();
542 +QString Locale::countryCodeToName(const QString &country) const
544 + return m_locale->countryCodeToName(country);
547 +void Locale::setCalendarSystem(Locale::CalendarSystem calendarSystem)
549 + m_locale->setCalendarSystem((KLocale::CalendarSystem)calendarSystem);
550 + emit calendarSystemChanged();
553 +Locale::CalendarSystem Locale::calendarSystem() const
555 + return (Locale::CalendarSystem)m_locale->calendarSystem();
558 +void Locale::setWeekNumberSystem(Locale::WeekNumberSystem weekNumberSystem)
560 + m_locale->setWeekNumberSystem((KLocale::WeekNumberSystem)weekNumberSystem);
561 + emit WeekNumberSystemChanged();
564 +Locale::WeekNumberSystem Locale::weekNumberSystem() const
566 + return (Locale::WeekNumberSystem)m_locale->weekNumberSystem();
569 +QString Locale::removeAcceleratorMarker(const QString &label) const
571 + return m_locale->removeAcceleratorMarker(label);
574 +void Locale::setDigitSet(Locale::DigitSet digitSet)
576 + m_locale->setDigitSet((KLocale::DigitSet)digitSet);
577 + emit digitSetChanged();
580 +Locale::DigitSet Locale::digitSet() const
582 + return (Locale::DigitSet)m_locale->digitSet();
585 +void Locale::setMonetaryDigitSet(Locale::DigitSet digitSet)
587 + m_locale->setMonetaryDigitSet((KLocale::DigitSet)digitSet);
588 + emit monetaryDigitSetChanged();
591 +Locale::DigitSet Locale::monetaryDigitSet() const
593 + return (Locale::DigitSet)m_locale->monetaryDigitSet();
596 +void Locale::setDateTimeDigitSet(Locale::DigitSet digitSet)
598 + m_locale->setDateTimeDigitSet((KLocale::DigitSet)digitSet);
599 + emit dateTimeDigitSetChanged();
602 +Locale::DigitSet Locale::dateTimeDigitSet() const
604 + return (Locale::DigitSet)m_locale->dateTimeDigitSet();
607 +void Locale::reparseConfiguration()
609 + m_locale->reparseConfiguration();
611 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/kdelocale.h kde-runtime-4.9.0/plasma/declarativeimports/locale/kdelocale.h
612 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/kdelocale.h 1970-01-01 01:00:00.000000000 +0100
613 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/kdelocale.h 2012-07-29 10:52:17.188937217 +0200
615 +/* This file is part of the KDE libraries
616 + Copyright (C) 2012 Giorgos Tsiapaliwkas <terietor@gmail.com>
617 + Copyright (C) 2012 Antonis Tsiapaliokas <kok3rs@gmail.com>
619 + This library is free software; you can redistribute it and/or
620 + modify it under the terms of the GNU Library General Public
621 + License as published by the Free Software Foundation; either
622 + version 2 of the License, or (at your option) any later version.
624 + This library is distributed in the hope that it will be useful,
625 + but WITHOUT ANY WARRANTY; without even the implied warranty of
626 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
627 + Library General Public License for more details.
629 + You should have received a copy of the GNU Library General Public License
630 + along with this library; see the file COPYING.LIB. If not, write to
631 + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
632 + Boston, MA 02110-1301, USA.
656 + * KLocale provides support for country specific stuff like
657 + * the national language.
659 + * KLocale supports translating, as well as specifying the format
660 + * for numbers, currency, time, and date.
662 + * Use KGlobal::locale() to get pointer to the global KLocale object,
663 + * containing the applications current locale settings.
665 + * For example, to format the date May 17, 1995 in the current locale, use:
668 + * QString date = KGlobal::locale()->formatDate(QDate(1995,5,17));
671 + * @author Stephan Kulow <coolo@kde.org>, Preston Brown <pbrown@kde.org>,
672 + * Hans Petter Bieker <bieker@kde.org>, Lukas Tinkl <lukas.tinkl@suse.cz>
673 + * @short class for supporting locale settings and national language
675 +class Locale : public QObject
680 +Q_ENUMS(BinarySizeUnits)
681 +Q_ENUMS(BinaryUnitDialect)
682 +Q_ENUMS(CalendarSystem)
684 +Q_ENUMS(DateTimeComponent)
685 +Q_ENUMS(DateTimeComponentFormat)
686 +Q_ENUMS(DateTimeFormatOption )
688 +Q_ENUMS(MeasureSystem)
689 +Q_ENUMS(ReadDateFlags)
690 +Q_ENUMS(SignPosition)
691 +Q_ENUMS(TimeFormatOption)
692 +Q_ENUMS(TimeProcessingOption)
693 +Q_ENUMS(WeekNumberSystem)
696 +Q_PROPERTY(BinaryUnitDialect binaryUnitDialect READ binaryUnitDialect WRITE setBinaryUnitDialect NOTIFY binaryUnitDialectChanged)
697 +Q_PROPERTY(Locale::CalendarSystem calendarSystem READ calendarSystem WRITE setCalendarSystem NOTIFY calendarSystemChanged)
698 +Q_PROPERTY(QString country READ country CONSTANT) //read-only
699 +Q_PROPERTY(QString countryDivisionCode READ countryDivisionCode WRITE setCountryDivisionCode NOTIFY countryDivisionCodeChanged)
700 +Q_PROPERTY(QString currencyCode READ currencyCode WRITE setCurrencyCode NOTIFY currencyCodeChanged)
701 +Q_PROPERTY(QString currencySymbol READ currencySymbol WRITE setCurrencySymbol NOTIFY currencySymbolChanged)
702 +Q_PROPERTY(QString dateFormat READ dateFormat WRITE setDateFormat NOTIFY dateFormatChanged)
703 +Q_PROPERTY(QString dateFormatShort READ dateFormatShort WRITE setDateFormat NOTIFY dateFormatShortChanged)
704 +Q_PROPERTY(bool dateMonthNamePossessive READ dateMonthNamePossessive WRITE setDateMonthNamePossessive NOTIFY dateMonthNamePossessiveChanged)
705 +Q_PROPERTY(DigitSet dateTimeDigitSet READ dateTimeDigitSet WRITE setDateTimeDigitSet NOTIFY dateTimeDigitSetChanged)
706 +Q_PROPERTY(int decimalPlaces READ decimalPlaces WRITE setDecimalPlaces NOTIFY decimalPlacesChanged)
707 +Q_PROPERTY(QString decimalSymbol READ decimalSymbol WRITE setDecimalSymbol NOTIFY decimalSymbolChanged)
708 +Q_PROPERTY(DigitSet digitSet READ digitSet WRITE setDigitSet NOTIFY digitSetChanged)
709 +Q_PROPERTY(QString language READ language CONSTANT) //read-only
710 +Q_PROPERTY(MeasureSystem measureSystem READ measureSystem WRITE setMeasureSystem NOTIFY measureSystemChanged)
711 +Q_PROPERTY(int monetaryDecimalPlaces READ monetaryDecimalPlaces WRITE setMonetaryDecimalPlaces NOTIFY monetaryDecimalPlacesChanged)
712 +Q_PROPERTY(QString monetaryDecimalSymbol READ monetaryDecimalSymbol WRITE setMonetaryDecimalSymbol NOTIFY monetaryDecimalSymbolChanged)
713 +Q_PROPERTY(DigitSet monetaryDigitSet READ monetaryDigitSet WRITE setMonetaryDigitSet NOTIFY monetaryDigitSetChanged)
714 +Q_PROPERTY(QString monetaryThousandsSeparator READ monetaryThousandsSeparator WRITE setMonetaryThousandsSeparator NOTIFY monetaryThousandsSeparatorChanged)
715 +Q_PROPERTY(SignPosition negativeMonetarySignPosition READ negativeMonetarySignPosition WRITE setNegativeMonetarySignPosition NOTIFY negativeMonetarySignPositionChanged)
716 +Q_PROPERTY(bool negativePrefixCurrencySymbol READ negativePrefixCurrencySymbol WRITE setNegativePrefixCurrencySymbol NOTIFY negativePrefixCurrencySymbolChanged)
717 +Q_PROPERTY(QString negativeSign READ negativeSign WRITE setNegativeSign NOTIFY negativeSignChanged)
718 +Q_PROPERTY(int pageSize READ pageSize WRITE setPageSize NOTIFY pageSizeChanged)
719 +Q_PROPERTY(SignPosition positiveMonetarySignPosition READ positiveMonetarySignPosition WRITE setPositiveMonetarySignPosition NOTIFY positiveMonetarySignPositionChanged)
720 +Q_PROPERTY(bool positivePrefixCurrencySymbol READ positivePrefixCurrencySymbol WRITE setPositivePrefixCurrencySymbol NOTIFY positivePrefixCurrencySymbolChanged)
721 +Q_PROPERTY(QString positiveSign READ positiveSign WRITE setPositiveSign NOTIFY positiveSignChanged)
722 +Q_PROPERTY(QString thousandsSeparator READ thousandsSeparator WRITE setThousandsSeparator NOTIFY thousandsSeparatorChanged)
723 +Q_PROPERTY(int weekDayOfPray READ weekDayOfPray WRITE setWeekDayOfPray NOTIFY weekDayOfPrayChanged)
724 +Q_PROPERTY(Locale::WeekNumberSystem weekNumberSystem READ weekNumberSystem WRITE setWeekNumberSystem NOTIFY WeekNumberSystemChanged)
725 +Q_PROPERTY(int weekStartDay READ weekStartDay WRITE setWeekStartDay NOTIFY weekStartDayChanged)
726 +Q_PROPERTY(int workingWeekEndDay READ workingWeekEndDay WRITE setWorkingWeekEndDay NOTIFY workingWeekEndDayChanged)
727 +Q_PROPERTY(int workingWeekStartDay READ workingWeekStartDay WRITE setWorkingWeekStartDay NOTIFY workingWeekStartDayChanged)
728 +Q_PROPERTY(bool use12Clock READ use12Clock CONSTANT)
729 +Q_PROPERTY(QString defaultLanguage READ defaultLanguage CONSTANT)//read-only
730 +Q_PROPERTY(QString defaultCountry READ defaultCountry CONSTANT)//read-only
731 +Q_PROPERTY(QString defaultCurrencyCode READ defaultCurrencyCode CONSTANT)//read-only
732 +Q_PROPERTY(bool useTranscript READ useTranscript CONSTANT) //read-only
733 +Q_PROPERTY(int fileEncodingMib READ fileEncodingMib CONSTANT) //read-only
734 +Q_PROPERTY(QStringList languageList READ languageList CONSTANT) //read-only
735 +Q_PROPERTY(QStringList currencyCodeList READ currencyCodeList CONSTANT) //read-only
736 +Q_PROPERTY(QStringList allLanguagesList READ allLanguagesList CONSTANT) //read-only
737 +Q_PROPERTY(QStringList installedLanguages READ installedLanguages CONSTANT) //read-only
738 +Q_PROPERTY(QStringList allCountriesList READ allCountriesList CONSTANT) //read-only
739 +Q_PROPERTY(QList<int> allDigitSetsList READ allDigitSetsList CONSTANT) //read-only
745 + Locale(QObject *parent = 0);
748 + * Various positions for where to place the positive or negative
749 + * sign when they are related to a monetary value.
751 + enum SignPosition {
753 + * Put parantheses around the quantity, e.g. "$ (217)"
757 + * Prefix the quantity with the sign, e.g. "$ -217"
759 + BeforeQuantityMoney = 1,
761 + * Suffix the quanitity with the sign, e.g. "$ 217-"
763 + AfterQuantityMoney = 2,
765 + * Prefix the currency symbol with the sign, e.g. "-$ 217"
769 + * Suffix the currency symbol with the sign, e.g. "$- 217"
776 + * The set of digit characters used to display and enter numbers.
779 + ArabicDigits, /**< 0123456789 (European and some Asian
780 + languages and western Arabic dialects) */
781 + ArabicIndicDigits, /**< ٠١٢٣٤٥٦٧٨٩ (eastern Arabic dialects) */
782 + EasternArabicIndicDigits, /**< ۰۱۲۳۴۵۶۷۸۹ (Persian and Urdu) */
783 + DevenagariDigits, /**< ०१२३४५६७८९ (Hindi) */
784 + BengaliDigits, /**< ০১২৩৪৫৬৭৮৯ (Bengali and Assamese) */
785 + GujaratiDigits, /**< ૦૧૨૩૪૫૬૭૮૯ (Gujarati) */
786 + GurmukhiDigits, /**< ੦੧੨੩੪੫੬੭੮੯ (Punjabi) */
787 + KannadaDigits, /**< ೦೧೨೩೪೫೬೭೮೯ (Kannada) */
788 + KhmerDigits, /**< ០១២៣៤៥៦៧៨៩ (Khmer) */
789 + MalayalamDigits, /**< ൦൧൨൩൪൫൬൭൮൯ (Malayalam) */
790 + OriyaDigits, /**< ୦୧୨୩୪୫୬୭୮୯ (Oriya) */
791 + TamilDigits, /**< ௦௧௨௩௪௫௬௭௮ (Tamil) */
792 + TeluguDigits, /**< ౦౧౨౩౪౫౬౭౯ (Telugu) */
793 + ThaiDigits /**< ๐๑๒๓๔๕๖๗๘๙ (Thai) */
794 + // The following Decimal Digit Sets are defined in Unicode but the associated
795 + // languages are not yet translated in KDE, so are not yet enabled.
796 + // The script names are taken from the Unicode standard, the associated
797 + // languages from Wikipedia.
798 + // BalineseDigits, /**< ᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙ (Balinese) */
799 + // ChamDigits, /**< ꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙ (Cham) */
800 + // JavaneseDigits, /**< ꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙ (Javanese) */
801 + // KayahLiDigits, /**< ꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉ (Kayah) */
802 + // LaoDigits, /**< ໐໑໒໓໔໕໖໗໘໙ (Lao) */
803 + // LepchaDigits, /**< ᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉ (Lepcha) */
804 + // LimbuDigits, /**< ᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏ (Limbu) */
805 + // MeeteiMayekDigits, /**< ꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹ (Meitei) */
806 + // MongolianDigits, /**< ᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙ (Mongolian) */
807 + // MyanmarDigits, /**< ၀၁၂၃၄၅၆၇၈၉ (Myanmar/Burmese ) */
808 + // MyanmarShanDigits, /**< ႐႑႒႓႔႕႖႗႘႙ (Shan) */
809 + // NewTaiLueDigits, /**< ᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙ (Tai Lü) */
810 + // NKoDigits, /**< ߀߁߂߃߄߅߆߇߈߉ (Mande and N'Ko) */
811 + // OlChikiDigits, /**< ᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙ (Santali) */
812 + // OsmanyaDigits, /**< ҠҡҢңҤҥҦҧҨҩ (Somali) */
813 + // SaurashtraDigits, /**< ꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙ (Saurashtra) */
814 + // SundaneseDigits, /**< ᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹ (Sundanese) */
815 + // TaiThamDigits, /**< ᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙ (Tai Lü) */
816 + // TibetanDigits, /**< ༠༡༢༣༤༥༦༧༨༩ (Tibetan) */
817 + // VaiDigits, /**< ꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩ (Vai) */
822 + * Convert a digit set identifier to a human readable, localized name.
824 + * @param digitSet the digit set identifier
825 + * @param withDigits whether to add the digits themselves to the name
827 + * @return the human readable and localized name of the digit set
831 + QString digitSetToName(DigitSet digitSet, bool withDigits = false) const;
835 + * Provides list of all known digit set identifiers.
837 + * @return list of all digit set identifiers
839 + * @see digitSetToName
841 + QList<int> allDigitSetsList() const;
844 + * Returns what a decimal point should look like ("." or "," etc.)
845 + * according to the current locale or user settings.
847 + * @return The decimal symbol used by locale.
849 + QString decimalSymbol() const;
852 + * Returns what the thousands separator should look
853 + * like ("," or "." etc.)
854 + * according to the current locale or user settings.
856 + * @return The thousands separator used by locale.
858 + QString thousandsSeparator() const;
862 + * Returns the identifier of the digit set used to display numbers.
864 + * @return the digit set identifier
866 + * @see digitSetToName
868 + DigitSet digitSet() const;
872 + * Returns the ISO 4217 Currency Code for the current locale
874 + * @return The default ISO Currency Code used by locale.
876 + QString currencyCode() const;
879 + * Returns what the symbol denoting currency in the current locale
880 + * as as defined by user settings should look like.
882 + * @return The default currency symbol used by locale.
884 + QString currencySymbol() const;
887 + * Returns what a decimal point should look like ("." or "," etc.)
888 + * for monetary values, according to the current locale or user
891 + * @return The monetary decimal symbol used by locale.
893 + QString monetaryDecimalSymbol() const;
896 + * Returns what a thousands separator for monetary values should
897 + * look like ("," or " " etc.) according to the current locale or
900 + * @return The monetary thousands separator used by locale.
902 + QString monetaryThousandsSeparator() const;
905 + * Returns what a positive sign should look like ("+", " ", etc.)
906 + * according to the current locale or user settings.
908 + * @return The positive sign used by locale.
910 + QString positiveSign() const;
913 + * Returns what a negative sign should look like ("-", etc.)
914 + * according to the current locale or user settings.
916 + * @return The negative sign used by locale.
918 + QString negativeSign() const;
922 + * The number of decimal places to include in numeric values (usually 2).
924 + * @return Default number of numeric decimal places used by locale.
926 + int decimalPlaces() const;
930 + * The number of decimal places to include in monetary values (usually 2).
932 + * @return Default number of monetary decimal places used by locale.
934 + int monetaryDecimalPlaces() const;
937 + * If and only if the currency symbol precedes a positive value,
938 + * this will be true.
940 + * @return Where to print the currency symbol for positive numbers.
942 + bool positivePrefixCurrencySymbol() const;
945 + * If and only if the currency symbol precedes a negative value,
946 + * this will be true.
948 + * @return True if the currency symbol precedes negative numbers.
950 + bool negativePrefixCurrencySymbol() const;
953 + * Returns the position of a positive sign in relation to a
956 + * @return Where/how to print the positive sign.
957 + * @see SignPosition
959 + SignPosition positiveMonetarySignPosition() const;
962 + * Denotes where to place a negative sign in relation to a
965 + * @return Where/how to print the negative sign.
966 + * @see SignPosition
968 + SignPosition negativeMonetarySignPosition() const;
972 + * Retuns the digit set used to display monetary values.
974 + * @return the digit set identifier
976 + * @see digitSetToName
978 + DigitSet monetaryDigitSet() const;
981 + * Given a double, converts that to a numeric string containing
982 + * the localized monetary equivalent.
984 + * e.g. given 123456, return "$ 123,456.00".
986 + * If precision isn't specified or is < 0, then the default monetaryDecimalPlaces() is used.
988 + * @param num The number we want to format
989 + * @param currency The currency symbol you want.
990 + * @param precision Number of decimal places displayed
992 + * @return The number of money as a localized string
993 + * @see monetaryDecimalPlaces()
995 + Q_INVOKABLE QString formatMoney(double num, const QString ¤cy = QString(), int precision = -1) const;
998 + * Given a string representing a number, converts that to a numeric
999 + * string containing the localized numeric equivalent.
1001 + * e.g. given 123456.78F, return "123,456.78" (for some European country).
1003 + * If precision isn't specified or is < 0, then the default decimalPlaces() is used.
1005 + * @param numStr The number to format, as a string.
1006 + * @param round Round fractional digits. (default true)
1007 + * @param precision Number of fractional digits used for rounding. Unused if round=false.
1009 + * @return The number as a localized string
1011 + Q_INVOKABLE QString formatNumber(const QString &numStr, bool round = true, int precision = -1) const;
1014 + * Given an integer, converts that to a numeric string containing
1015 + * the localized numeric equivalent.
1017 + * e.g. given 123456L, return "123,456" (for some European country).
1019 + * @param num The number to convert
1021 + * @return The number as a localized string
1023 + Q_INVOKABLE QString formatLong(long num) const;
1026 + * These binary units are used in KDE by the formatByteSize()
1029 + * NOTE: There are several different units standards:
1030 + * 1) SI (i.e. metric), powers-of-10.
1031 + * 2) IEC, powers-of-2, with specific units KiB, MiB, etc.
1032 + * 3) JEDEC, powers-of-2, used for solid state memory sizing which
1033 + * is why you see flash cards labels as e.g. 4GB. These (ab)use
1034 + * the metric units. Although JEDEC only defines KB, MB, GB, if
1035 + * JEDEC is selected all units will be powers-of-2 with metric
1036 + * prefixes for clarity in the event of sizes larger than 1024 GB.
1038 + * Although 3 different dialects are possible this enum only uses
1039 + * metric names since adding all 3 different names of essentially the same
1040 + * unit would be pointless. Use BinaryUnitDialect to control the exact
1043 + * @see binaryUnitDialect
1045 + enum BinarySizeUnits {
1046 + /// Auto-choose a unit such that the result is in the range [0, 1000 or 1024)
1047 + DefaultBinaryUnits = 1000,
1049 + // The first real unit must be 0 for the current implementation!
1050 + UnitByte = 0, ///< B 1 byte
1051 + UnitKiloByte, ///< KiB/KB/kB 1024/1000 bytes.
1052 + UnitMegaByte, ///< MiB/MB/MB 2^20/10^06 bytes.
1053 + UnitGigaByte, ///< GiB/GB/GB 2^30/10^09 bytes.
1054 + UnitTeraByte, ///< TiB/TB/TB 2^40/10^12 bytes.
1055 + UnitPetaByte, ///< PiB/PB/PB 2^50/10^15 bytes.
1056 + UnitExaByte, ///< EiB/EB/EB 2^60/10^18 bytes.
1057 + UnitZettaByte, ///< ZiB/ZB/ZB 2^70/10^21 bytes.
1058 + UnitYottaByte, ///< YiB/YB/YB 2^80/10^24 bytes.
1059 + UnitLastUnit = UnitYottaByte
1063 + * This enum chooses what dialect is used for binary units.
1065 + * Note: Although JEDEC abuses the metric prefixes and can therefore be
1066 + * confusing, it has been used to describe *memory* sizes for quite some time
1067 + * and programs should therefore use either Default, JEDEC, or IEC 60027-2
1068 + * for memory sizes.
1070 + * On the other hand network transmission rates are typically in metric so
1071 + * Default, Metric, or IEC (which is unambiguous) should be chosen.
1073 + * Normally choosing DefaultBinaryUnits is the best option as that uses
1074 + * the user's selection for units.
1076 + * @see binaryUnitDialect
1077 + * @see setBinaryUnitDialect
1079 + enum BinaryUnitDialect {
1080 + DefaultBinaryDialect = 1000, ///< Used if no specific preference
1081 + IECBinaryDialect = 0, ///< KDE Default, KiB, MiB, etc. 2^(10*n)
1082 + JEDECBinaryDialect, ///< KDE 3.5 default, KB, MB, etc. 2^(10*n)
1083 + MetricBinaryDialect, ///< SI Units, kB, MB, etc. 10^(3*n)
1084 + LastBinaryDialect = MetricBinaryDialect
1088 + * Converts @p size from bytes to the string representation using the
1089 + * user's default binary unit dialect. The default unit dialect is
1093 + * formatByteSize(1024) returns "1.0 KiB" by default.
1095 + * @param size size in bytes
1096 + * @return converted size as a string - e.g. 123.4 KiB , 12.0 MiB
1097 + * @see BinaryUnitDialect
1098 + * @todo KDE 5: Remove in favor of overload added in KDE 4.4.
1100 + Q_INVOKABLE QString formatByteSize(double size) const;
1104 + * Converts @p size from bytes to the appropriate string representation
1105 + * using the binary unit dialect @p dialect and the specific units @p specificUnit.
1108 + * formatByteSize(1000, unit, Locale::BinaryUnitKilo) returns:
1109 + * for Locale::MetricBinaryUnits, "1.0 kB",
1110 + * for Locale::IECBinaryUnits, "0.9 KiB",
1111 + * for Locale::JEDECBinaryUnits, "0.9 KB".
1113 + * @param size size in bytes
1114 + * @param precision number of places after the decimal point to use. KDE uses
1115 + * 1 by default so when in doubt use 1.
1116 + * @param dialect binary unit standard to use. Use DefaultBinaryUnits to
1117 + * use the localized user selection unless you need to use a specific
1118 + * unit type (such as displaying a flash memory size in JEDEC).
1119 + * @param specificUnit specific unit size to use in result. Use
1120 + * DefaultBinarySize to automatically select a unit that will return
1121 + * a sanely-sized number.
1122 + * @return converted size as a translated string including the units.
1123 + * E.g. "1.23 KiB", "2 GB" (JEDEC), "4.2 kB" (Metric).
1124 + * @see BinaryUnitDialect
1126 + QString formatByteSize(double size, int precision,
1127 + BinaryUnitDialect dialect = Locale::DefaultBinaryDialect,
1128 + BinarySizeUnits specificUnit = Locale::DefaultBinaryUnits) const;
1131 + * Returns the user's configured binary unit dialect.
1132 + * e.g. if MetricBinaryDialect is returned then the values
1133 + * configured for how much a set of bytes are worth would
1134 + * be 10^(3*n) and KB (1000 bytes == 1 KB), in this case.
1136 + * Will never return DefaultBinaryDialect.
1138 + * @return User's configured binary unit dialect
1139 + * @see BinaryUnitDialect
1141 + BinaryUnitDialect binaryUnitDialect() const;
1144 + * Sets @p newDialect to be the default dialect for this locale (and only
1145 + * this locale). Newly created KLocale objects will continue to default
1146 + * to the user's choice.
1148 + * @param newDialect the new dialect to set as default for this locale object.
1150 + void setBinaryUnitDialect(BinaryUnitDialect newDialect);
1153 + * Given a number of milliseconds, converts that to a string containing
1154 + * the localized equivalent
1156 + * e.g. given formatDuration(60000), returns "1.0 minutes"
1158 + * @param mSec Time duration in milliseconds
1159 + * @return converted duration as a string - e.g. "5.5 seconds" "23.0 minutes"
1161 + Q_INVOKABLE QString formatDuration(unsigned long mSec) const;
1164 + * Given a number of milliseconds, converts that to a pretty string containing
1165 + * the localized equivalent.
1167 + * e.g. given prettyFormatDuration(60001) returns "1 minute"
1168 + * given prettyFormatDuration(62005) returns "1 minute and 2 seconds"
1169 + * given prettyFormatDuration(90060000) returns "1 day and 1 hour"
1171 + * @param mSec Time duration in milliseconds
1172 + * @return converted duration as a string.
1173 + * Units not interesting to the user, for example seconds or minutes when the first
1174 + * unit is day, are not returned because they are irrelevant. The same applies for
1175 + * seconds when the first unit is hour.
1177 + Q_INVOKABLE QString prettyFormatDuration(unsigned long mSec) const;
1181 + * Available Calendar Systems
1183 + * @see setCalendarSystem()
1184 + * @see calendarSystem()
1186 + enum CalendarSystem {
1187 + QDateCalendar = 1, /**< KDE Default, hybrid of Gregorian and Julian as used by QDate */
1188 + //BahaiCalendar = 2, /**< Baha'i Calendar */
1189 + //BuddhistLunarCalendar = 3, /**< Buddhist Lunar Calendar*/
1190 + //ChineseCalendar = 4, /**< Chinese Calendar */
1191 + CopticCalendar = 5, /**< Coptic Calendar as used Coptic Church and some parts of Egypt */
1192 + EthiopianCalendar = 6, /**< Ethiopian Calendar, aka Ethiopic Calendar */
1193 + //EthiopianAmeteAlemCalendar = 7, /**< Ethiopian Amete Alem version, aka Ethiopic Amete Alem */
1194 + GregorianCalendar = 8, /**< Gregorian Calendar, pure proleptic implementation */
1195 + HebrewCalendar = 9, /**< Hebrew Calendar, aka Jewish Calendar */
1196 + //HinduCalendar = 10, /**< Hindu Lunar Calendar */
1197 + //IslamicLunarCalendar = 11, /**< Islamic Lunar Calendar */
1198 + IslamicCivilCalendar = 12, /**< Islamic Civil Calendar, aka Hijri, not the Lunar Calendar */
1199 + //IslamicUmAlQuraCalendar = 13, /**< Islamic Lunar Calendar, Um Al Qura varient used in Saudi Arabia */
1200 + IndianNationalCalendar = 14, /**< Indian National Calendar, not the Lunar Calendar */
1201 + //Iso8601Calendar = 15, /**< ISO 8601 Standard Calendar */
1202 + JalaliCalendar = 16, /**< Jalali Calendar, aka Persian or Iranian, also used in Afghanistan */
1203 + //JalaliBirashkCalendar = 17, /**< Jalali Calendar, Birashk Algorythm variant */
1204 + //Jalali33YearCalendar = 18, /**< Jalali Calendar, 33 Year cycle variant */
1205 + JapaneseCalendar= 19, /**< Japanese Calendar, Gregorian calculation using Japanese Era (Nengô) */
1206 + //JucheCalendar = 20, /**< Juche Calendar, used in North Korea */
1207 + JulianCalendar = 21, /**< Julian Calendar, as used in Orthodox Churches */
1208 + MinguoCalendar= 22, /**< Minguo Calendar, aka ROC, Republic of China or Taiwanese */
1209 + ThaiCalendar = 23 /**< Thai Calendar, aka Buddhist or Thai Buddhist */
1214 + * System used for Week Numbers
1216 + * @see setWeekNumberSystem()
1217 + * @see weekNumberSystem()
1219 + enum WeekNumberSystem {
1220 + DefaultWeekNumber = 1000, /**< The system locale default */
1221 + IsoWeekNumber = 0, /**< ISO Week Number */
1222 + FirstFullWeek = 1, /**< Week 1 starts on the first Week Start Day in year ends after 7 days */
1223 + FirstPartialWeek = 2, /**< Week 1 starts Jan 1st ends day before first Week Start Day in year */
1224 + SimpleWeek = 3 /**< Week 1 starts Jan 1st ends after 7 days */
1229 + * The various Components that make up a Date / Time
1230 + * In the future the Components may be combined as flags for dynamic
1231 + * generation of Date Formats.
1233 + * @see CalendarSystem
1234 + * @see KLocalizedDate
1235 + * @see DateTimeComponentFormat
1237 + enum DateTimeComponent {
1238 + Year = 0x1, /**< The Year portion of a date, may be number or name */
1239 + YearName = 0x2, /**< The Year Name portion of a date */
1240 + Month = 0x4, /**< The Month portion of a date, may be number or name */
1241 + MonthName = 0x8, /**< The Month Name portion of a date */
1242 + Day = 0x10, /**< The Day portion of a date, may be number or name */
1243 + DayName = 0x20, /**< The Day Name portion of a date */
1244 + JulianDay = 0x40, /**< The Julian Day of a date */
1245 + EraName = 0x80, /**< The Era Name portion of a date */
1246 + EraYear = 0x100, /**< The Era and Year portion of a date */
1247 + YearInEra = 0x200, /**< The Year In Era portion of a date */
1248 + DayOfYear = 0x400, /**< The Day Of Year portion of a date, may be number or name */
1249 + DayOfYearName = 0x800, /**< The Day Of Year Name portion of a date */
1250 + DayOfWeek = 0x1000, /**< The Day Of Week / Weekday portion of a date, may be number or name */
1251 + DayOfWeekName = 0x2000, /**< The Day Of Week Name / Weekday Name portion of a date */
1252 + Week = 0x4000, /**< The Week Number portion of a date */
1253 + WeekYear = 0x8000, /**< The Week Year portion of a date */
1254 + MonthsInYear = 0x10000, /**< The Months In Year portion of a date */
1255 + WeeksInYear = 0x20000, /**< The Weeks In Year portion of a date */
1256 + DaysInYear = 0x40000, /**< The Days In Year portion of a date */
1257 + DaysInMonth = 0x80000, /**< The Days In Month portion of a date */
1258 + DaysInWeek = 0x100000, /**< The Days In Week portion of a date */
1259 + Hour = 0x200000, /**< The Hours portion of a date */
1260 + Minute = 0x400000, /**< The Minutes portion of a date */
1261 + Second = 0x800000, /**< The Seconds portion of a date */
1262 + Millisecond = 0x1000000, /**< The Milliseconds portion of a date */
1263 + DayPeriod = 0x2000000, /**< The Day Period portion of a date, e.g. AM/PM */
1264 + DayPeriodHour = 0x4000000, /**< The Day Period Hour portion of a date */
1265 + Timezone = 0x8000000, /**< The Time Zone portion of a date, may be offset or name */
1266 + TimezoneName = 0x10000000, /**< The Time Zone Name portion of a date */
1267 + UnixTime = 0x20000000 /**< The UNIX Time portion of a date */
1272 + * Format used for individual Date/Time Components when converted to/from a string
1273 + * Largely equivalent to the UNICODE CLDR format width definitions 1..5
1275 + * @see DateTimeComponentFormat
1277 + enum DateTimeComponentFormat {
1278 + DefaultComponentFormat = 1000, /**< The system locale default for the componant */
1279 + ShortNumber = 0, /**< Number at its natural width, e.g. 2 for the 2nd*/
1280 + LongNumber, /**< Number padded to a required width, e.g. 02 for the 2nd*/
1281 + //OrdinalNumber /**< Ordinal number format, e.g. "2nd" for the 2nd */
1282 + NarrowName = 3, /**< Narrow text format, may not be unique, e.g. M for Monday */
1283 + ShortName, /**< Short text format, e.g. Mon for Monday */
1284 + LongName /**< Long text format, e.g. Monday for Monday */
1287 + Q_DECLARE_FLAGS(DateTimeComponents, DateTimeComponent)
1290 + * Format for date string.
1293 + ShortDate, /**< Locale Short date format, e.g. 08-04-2007 */
1294 + LongDate, /**< Locale Long date format, e.g. Sunday 08 April 2007 */
1295 + FancyShortDate, /**< Same as ShortDate for dates a week or more ago. For more
1296 + recent dates, it is represented as Today, Yesterday, or
1297 + the weekday name. */
1298 + FancyLongDate, /**< Same as LongDate for dates a week or more ago. For more
1299 + recent dates, it is represented as Today, Yesterday, or
1300 + the weekday name. */
1301 + IsoDate, /**< ISO-8601 Date format YYYY-MM-DD, e.g. 2009-12-31 */
1302 + IsoWeekDate, /**< ISO-8601 Week Date format YYYY-Www-D, e.g. 2009-W01-1 */
1303 + IsoOrdinalDate /**< ISO-8601 Ordinal Date format YYYY-DDD, e.g. 2009-001 */
1307 + * Returns a string formatted to the current locale's conventions
1308 + * regarding dates.
1310 + * @param date the date to be formatted
1311 + * @param format category of date format to use
1313 + * @return the date as a string
1315 + Q_INVOKABLE QString formatDate(const QDate &date, DateFormat format = LongDate) const;
1318 + * Options for formatting date-time values.
1320 + enum DateTimeFormatOption {
1321 + TimeZone = 0x01, /**< Include a time zone string */
1322 + Seconds = 0x02 /**< Include the seconds value */
1325 + Q_DECLARE_FLAGS(DateTimeFormatOptions, DateTimeFormatOption)
1328 + * Returns a string formatted to the current locale's conventions
1329 + * regarding both date and time.
1331 + * @param dateTime the date and time to be formatted
1332 + * @param format category of date format to use
1333 + * @param options additional output options
1335 + * @return The date and time as a string
1337 + Q_INVOKABLE QString formatDateTime(const QDateTime &dateTime, DateFormat format = ShortDate,
1338 + DateTimeFormatOptions options = 0) const;
1341 + * Use this to determine whether in dates a possessive form of month
1342 + * name is preferred ("of January" rather than "January")
1344 + * @return If possessive form should be used
1346 + bool dateMonthNamePossessive() const;
1350 + * Format flags for readLocaleTime() and formatLocaleTime()
1352 + enum TimeFormatOption {
1353 + TimeDefault = 0x0, ///< Default formatting using seconds and the format
1354 + ///< as specified by the locale.
1355 + TimeWithoutSeconds = 0x1, ///< Exclude the seconds part of the time from display
1356 + TimeWithoutAmPm = 0x2, ///< Read/format time string without am/pm suffix but
1357 + ///< keep the 12/24h format as specified by locale time
1358 + ///< format, eg. "07.33.05" instead of "07.33.05 pm" for
1359 + ///< time format "%I.%M.%S %p".
1360 + TimeDuration = 0x6, ///< Read/format time string as duration. This will strip
1361 + ///< the am/pm suffix and read/format times with an hour
1362 + ///< value of 0-23 hours, eg. "19.33.05" instead of
1363 + ///< "07.33.05 pm" for time format "%I.%M.%S %p".
1364 + ///< This automatically implies @c TimeWithoutAmPm.
1365 + TimeFoldHours = 0xE ///< Read/format time string as duration. This will not
1366 + ///< not output the hours part of the duration but will
1367 + ///< add the hours (times sixty) to the number of minutes,
1368 + ///< eg. "70.23" instead of "01.10.23" for time format
1369 + ///< "%I.%M.%S %p".
1372 + Q_DECLARE_FLAGS(TimeFormatOptions, TimeFormatOption)
1376 + * Returns a string formatted to the current locale's conventions
1377 + * regarding times.
1379 + * @param pTime the time to be formatted
1380 + * @param options format option to use when formatting the time
1381 + * @return The time as a string
1383 + Q_INVOKABLE QString formatLocaleTime(const QTime &pTime,
1384 + TimeFormatOptions options = Locale::TimeDefault) const;
1388 + * Returns the identifier of the digit set used to display dates and time.
1390 + * @return the digit set identifier
1392 + * @see digitSetToName
1394 + DigitSet dateTimeDigitSet() const;
1397 + * Use this to determine if the user wants a 12 hour clock.
1399 + * @return If the user wants 12h clock
1401 + bool use12Clock() const;
1405 + * Returns the Day Period matching the time given
1407 + * @param time the time to return the day period for
1408 + * @param format the format to return teh day period in
1409 + * @return the Day Period for the given time
1411 + Q_INVOKABLE QString dayPeriodText(const QTime &time, DateTimeComponentFormat format = DefaultComponentFormat) const;
1414 + * Use this to determine which day is the first day of the week.
1416 + * @return an integer (Monday=1..Sunday=7)
1418 + int weekStartDay() const;
1421 + * Use this to determine which day is the first working day of the week.
1423 + * @return an integer (Monday=1..Sunday=7)
1425 + int workingWeekStartDay() const;
1428 + * Use this to determine which day is the last working day of the week.
1430 + * @return an integer (Monday=1..Sunday=7)
1432 + int workingWeekEndDay() const;
1435 + * Use this to determine which day is reserved for religious observance
1437 + * @return day number (None = 0, Monday = 1, ..., Sunday = 7)
1439 + int weekDayOfPray() const;
1443 + * Returns the type of Calendar System used in this Locale
1445 + * @see Locale::CalendarSystem
1446 + * @see CalendarSystem
1447 + * @return the type of Calendar System
1449 + Locale::CalendarSystem calendarSystem() const;
1453 + * Sets the type of Calendar System to use in this Locale
1455 + * @see Locale::CalendarSystem
1456 + * @see CalendarSystem
1457 + * @param calendarSystem the Calendar System to use
1459 + void setCalendarSystem(Locale::CalendarSystem calendarSystem);
1463 + * Sets the type of Week Number System to use in this Locale
1465 + * @see Klocale::WeekNumberSystem
1466 + * @see weekNumberSystem()
1467 + * @param weekNumberSystem the Week Number System to use
1469 + void setWeekNumberSystem(Locale::WeekNumberSystem weekNumberSystem);
1473 + * Returns the type of Week Number System used in this Locale
1475 + * @see Klocale::WeekNumberSystem
1476 + * @see setWeekNumberSystem()
1477 + * @returns the Week Number System used
1479 + Locale::WeekNumberSystem weekNumberSystem() const;
1482 + * Converts a localized monetary string to a double.
1484 + * @param numStr the string we want to convert.
1485 + * @param ok the boolean that is set to false if it's not a number.
1486 + * If @p ok is 0, it will be ignored
1488 + * @return The string converted to a double
1490 + Q_INVOKABLE double readMoney(const QString &numStr) const;
1493 + * Converts a localized numeric string to a double.
1495 + * @param numStr the string we want to convert.
1496 + * @return The string converted to a double
1498 + Q_INVOKABLE double readNumber(const QString &numStr) const;
1501 + * Flags for readDate()
1503 + enum ReadDateFlags {
1504 + NormalFormat = 1, /**< Only accept a date string in
1505 + the locale LongDate format */
1506 + ShortFormat = 2, /**< Only accept a date string in
1507 + the locale ShortDate format */
1508 + IsoFormat = 4, /**< Only accept a date string in
1509 + ISO date format (YYYY-MM-DD) */
1510 + IsoWeekFormat = 8, /**< Only accept a date string in
1511 + ISO Week date format (YYYY-Www-D) */
1512 + IsoOrdinalFormat = 16 /**< Only accept a date string in
1513 + ISO Week date format (YYYY-DDD) */
1517 + * Converts a localized date string to a QDate.
1518 + * This method is stricter than readDate(str,&ok): it will only accept
1519 + * a date in a specific format, depending on @p flags.
1521 + * @param str the string we want to convert.
1522 + * @param flags what format the the date string will be in
1523 + * @return The string converted to a QDate
1524 + * @see CalendarSystem::readDate()
1526 + Q_INVOKABLE QDate readDate(const QString &str, ReadDateFlags flags) const;
1529 + * Converts a localized time string to a QTime.
1530 + * This method will try to parse it with seconds, then without seconds.
1532 + * @param str the string we want to convert.
1534 + * @return The string converted to a QTime
1536 + Q_INVOKABLE QTime readTime(const QString &str) const;
1539 + * Additional processing options for readLocaleTime().
1541 + * @remarks This is currently used as an enum but declared as a flag
1542 + * to be extensible
1544 + enum TimeProcessingOption {
1545 + ProcessStrict = 0x1, ///< Process time in a strict manner, ie.
1546 + ///< a read time string has to exactly match
1547 + ///< the defined time format.
1548 + ProcessNonStrict = 0x2 ///< Process time in a lax manner, ie.
1549 + ///< allow spaces in the time-format to be
1550 + ///< left out when entering a time string.
1553 + Q_DECLARE_FLAGS(TimeProcessingOptions, TimeProcessingOption)
1557 + * Converts a localized time string to a QTime.
1558 + * This method is stricter than readTime(str, &ok) in that it will either
1559 + * accept a time with seconds or a time without seconds.
1561 + * @param str the string we want to convert
1562 + * @param ok the boolean that is set to false if it's not a valid time.
1563 + * If @p ok is 0, it will be ignored.
1564 + * @param options format option to apply when formatting the time
1565 + * @param processing if set to @c ProcessStrict, checking will be strict
1566 + * and the read time string has to have the exact time format
1567 + * specified. If set to @c ProcessNonStrict processing the time
1568 + * is lax and spaces in the time string can be left out.
1570 + * @return The string converted to a QTime
1573 + Q_INVOKABLE QTime readLocaleTime(const QString &str,
1574 + TimeFormatOptions options = Locale::TimeDefault,
1575 + TimeProcessingOptions processing = ProcessNonStrict) const;
1578 + * Returns the language code used by this object. The domain AND the
1579 + * library translation must be available in this language.
1580 + * defaultLanguage() is returned by default, if no other available.
1582 + * Use languageCodeToName(language) to get human readable, localized
1585 + * @return the currently used language code
1587 + * @see languageCodeToName
1589 + QString language() const;
1592 + * Returns the country code of the country where the user lives.
1594 + * The returned code complies with the ISO 3166-1 alpha-2 standard,
1595 + * except by KDE convention it is returned in lowercase whereas the
1596 + * official standard is uppercase.
1597 + * See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for details.
1599 + * defaultCountry() is returned by default, if no other available,
1600 + * this will always be uppercase 'C'.
1602 + * Use countryCodeToName(country) to get human readable, localized
1605 + * @return the country code for the user
1607 + * @see countryCodeToName
1609 + QString country() const;
1613 + * Returns the Country Division Code of the Country where the user lives.
1614 + * When no value is set, then the Country Code will be returned.
1616 + * The returned code complies with the ISO 3166-2 standard.
1617 + * See http://en.wikipedia.org/wiki/ISO_3166-2 for details.
1619 + * Note that unlike country() this method will return the correct case,
1620 + * i.e. normally uppercase..
1622 + * In KDE 4.6 it is the apps responsibility to obtain a translation for the
1623 + * code, translation and other services will be priovided in KDE 4.7.
1625 + * @return the Country Division Code for the user
1626 + * @see setCountryDivisionCode
1628 + QString countryDivisionCode() const;
1631 + * Returns the language codes selected by user, ordered by decreasing
1634 + * Use languageCodeToName(language) to get human readable, localized
1637 + * @return list of language codes
1639 + * @see languageCodeToName
1641 + QStringList languageList() const;
1645 + * Returns the ISO Currency Codes used in the locale, ordered by decreasing
1648 + * Use KCurrency::currencyCodeToName(currencyCode) to get human readable,
1649 + * localized language name.
1651 + * @return list of ISO Currency Codes
1653 + * @see currencyCodeToName
1655 + QStringList currencyCodeList() const;
1658 + * Returns the file encoding.
1660 + * @return The Mib of the file encoding
1662 + * @see QFile::encodeName
1663 + * @see QFile::decodeName
1665 + int fileEncodingMib() const;
1668 + * Changes the current date format.
1670 + * The format of the date is a string which contains variables that will
1672 + * @li %Y with the whole year (e.g. "2004" for "2004")
1673 + * @li %y with the lower 2 digits of the year (e.g. "04" for "2004")
1674 + * @li %n with the month (January="1", December="12")
1675 + * @li %m with the month with two digits (January="01", December="12")
1676 + * @li %e with the day of the month (e.g. "1" on the first of march)
1677 + * @li %d with the day of the month with two digits (e.g. "01" on the first of march)
1678 + * @li %b with the short form of the month (e.g. "Jan" for January)
1679 + * @li %B with the long form of the month (e.g. "January")
1680 + * @li %a with the short form of the weekday (e.g. "Wed" for Wednesday)
1681 + * @li %A with the long form of the weekday (e.g. "Wednesday" for Wednesday)
1683 + * Everything else in the format string will be taken as is.
1684 + * For example, March 20th 1989 with the format "%y:%m:%d" results
1687 + * @param format The new date format
1689 + void setDateFormat(const QString & format);
1692 + * Changes the current short date format.
1694 + * The format of the date is a string which contains variables that will
1696 + * @li %Y with the whole year (e.g. "1984" for "1984")
1697 + * @li %y with the lower 2 digits of the year (e.g. "84" for "1984")
1698 + * @li %n with the month (January="1", December="12")
1699 + * @li %m with the month with two digits (January="01", December="12")
1700 + * @li %e with the day of the month (e.g. "1" on the first of march)
1701 + * @li %d with the day of the month with two digits(e.g. "01" on the first of march)
1702 + * @li %b with the short form of the month (e.g. "Jan" for January)
1703 + * @li %B with the long form of the month (e.g. "January")
1704 + * @li %a with the short form of the weekday (e.g. "Wed" for Wednesday)
1705 + * @li %A with the long form of the weekday (e.g. "Wednesday" for Wednesday)
1707 + * Everything else in the format string will be taken as is.
1708 + * For example, March 20th 1989 with the format "%y:%m:%d" results
1711 + * @param format The new short date format
1713 + void setDateFormatShort(const QString & format);
1716 + * Changes the form of month name used in dates.
1718 + * @param possessive True if possessive forms should be used
1720 + void setDateMonthNamePossessive(bool possessive);
1723 + * Changes the current time format.
1725 + * The format of the time is string a which contains variables that will
1727 + * @li %H with the hour in 24h format and 2 digits (e.g. 5pm is "17", 5am is "05")
1728 + * @li %k with the hour in 24h format and one digits (e.g. 5pm is "17", 5am is "5")
1729 + * @li %I with the hour in 12h format and 2 digits (e.g. 5pm is "05", 5am is "05")
1730 + * @li %l with the hour in 12h format and one digits (e.g. 5pm is "5", 5am is "5")
1731 + * @li %M with the minute with 2 digits (e.g. the minute of 07:02:09 is "02")
1732 + * @li %S with the seconds with 2 digits (e.g. the minute of 07:02:09 is "09")
1733 + * @li %p with pm or am (e.g. 17.00 is "pm", 05.00 is "am")
1735 + * Everything else in the format string will be taken as is.
1736 + * For example, 5.23pm with the format "%H:%M" results
1739 + * @param format The new time format
1741 + void setTimeFormat(const QString & format);
1745 + * Set digit characters used to display dates and time.
1747 + * @param digitSet the digit set identifier
1750 + void setDateTimeDigitSet(DigitSet digitSet);
1753 + * Changes how KLocale defines the first day in week.
1755 + * @param day first day of the week (Monday=1..Sunday=7) as integer
1757 + void setWeekStartDay(int day);
1760 + * Changes how KLocale defines the first working day in week.
1762 + * @param day first working day of the week (Monday=1..Sunday=7) as integer
1764 + void setWorkingWeekStartDay(int day);
1767 + * Changes how KLocale defines the last working day in week.
1769 + * @param day last working day of the week (Monday=1..Sunday=7) as integer
1771 + void setWorkingWeekEndDay(int day);
1774 + * Changes how KLocale defines the day reserved for religious observance.
1776 + * @param day day of the week for religious observance (None=0,Monday=1..Sunday=7) as integer
1778 + void setWeekDayOfPray(int day);
1781 + * Returns the currently selected date format.
1783 + * @return Current date format.
1784 + * @see setDateFormat()
1786 + QString dateFormat() const;
1789 + * Returns the currently selected short date format.
1791 + * @return Current short date format.
1792 + * @see setDateFormatShort()
1794 + QString dateFormatShort() const;
1797 + * Returns the currently selected time format.
1799 + * @return Current time format.
1800 + * @see setTimeFormat()
1802 + QString timeFormat() const;
1805 + * Changes the symbol used to identify the decimal pointer.
1807 + * @param symbol The new decimal symbol.
1809 + void setDecimalSymbol(const QString & symbol);
1812 + * Changes the separator used to group digits when formating numbers.
1814 + * @param separator The new thousands separator.
1816 + void setThousandsSeparator(const QString & separator);
1819 + * Changes the sign used to identify a positive number. Normally this is
1822 + * @param sign Sign used for positive numbers.
1824 + void setPositiveSign(const QString & sign);
1827 + * Changes the sign used to identify a negative number.
1829 + * @param sign Sign used for negative numbers.
1831 + void setNegativeSign(const QString & sign);
1835 + * Changes the set of digit characters used to display numbers.
1837 + * @param digitSet the digit set identifier
1840 + void setDigitSet(DigitSet digitSet);
1843 + * Changes the sign position used for positive monetary values.
1845 + * @param signpos The new sign position
1847 + void setPositiveMonetarySignPosition(SignPosition signpos);
1850 + * Changes the sign position used for negative monetary values.
1852 + * @param signpos The new sign position
1854 + void setNegativeMonetarySignPosition(SignPosition signpos);
1857 + * Changes the position where the currency symbol should be printed for
1858 + * positive monetary values.
1860 + * @param prefix True if the currency symbol should be prefixed instead of
1863 + void setPositivePrefixCurrencySymbol(bool prefix);
1866 + * Changes the position where the currency symbol should be printed for
1867 + * negative monetary values.
1869 + * @param prefix True if the currency symbol should be prefixed instead of
1872 + void setNegativePrefixCurrencySymbol(bool prefix);
1876 + * Changes the number of decimal places used when formating numbers.
1878 + * @param digits The default number of digits to use.
1880 + void setDecimalPlaces(int digits);
1884 + * Changes the number of decimal places used when formating money.
1886 + * @param digits The default number of digits to use.
1888 + void setMonetaryDecimalPlaces(int digits);
1891 + * Changes the separator used to group digits when formating monetary values.
1893 + * @param separator The new thousands separator.
1895 + void setMonetaryThousandsSeparator(const QString & separator);
1898 + * Changes the symbol used to identify the decimal pointer for monetary
1901 + * @param symbol The new decimal symbol.
1903 + void setMonetaryDecimalSymbol(const QString & symbol);
1907 + * Changes the current ISO Currency Code.
1909 + * @param newCurrencyCode The new Currency Code
1911 + void setCurrencyCode(const QString &newCurrencyCode);
1914 + * Changes the current currency symbol.
1916 + * This symbol should be consistant with the selected Currency Code
1918 + * @param symbol The new currency symbol
1919 + * @see currencyCode, KCurrency::currencySymbols
1921 + void setCurrencySymbol(const QString & symbol);
1925 + * Set digit characters used to display monetary values.
1927 + * @param digitSet the digit set identifier
1930 + void setMonetaryDigitSet(DigitSet digitSet);
1933 + * Returns the preferred page size for printing.
1935 + * @return The preferred page size, cast it to QPrinter::PageSize
1937 + int pageSize() const;
1940 + * Changes the preferred page size when printing.
1942 + * @param paperFormat the new preferred page size in the format QPrinter::PageSize
1944 + void setPageSize(int paperFormat);
1947 + * The Metric system will give you information in mm, while the
1948 + * Imperial system will give you information in inches.
1950 + enum MeasureSystem {
1951 + Metric, ///< Metric system (used e.g. in Europe)
1952 + Imperial ///< Imperial system (used e.g. in the United States)
1956 + * Returns which measuring system we use.
1958 + * @return The preferred measuring system
1960 + MeasureSystem measureSystem() const;
1963 + * Changes the preferred measuring system.
1965 + * @return value The preferred measuring system
1967 + void setMeasureSystem(MeasureSystem value);
1970 + * Translates a message as a QTranslator is supposed to.
1971 + * The parameters are similar to i18n(), but the result
1972 + * value has other semantics (it can be QString())
1974 + Q_INVOKABLE QString translateQt(const char *context, const char *sourceText, const char *comment) const;
1977 + * Provides list of all known language codes.
1979 + * Use languageCodeToName(language) to get human readable, localized
1982 + * @return list of all language codes
1984 + * @see languageCodeToName
1985 + * @see installedLanguages
1987 + QStringList allLanguagesList() const;
1991 + * Provides list of all installed KDE Language Translations.
1993 + * Use languageCodeToName(language) to get human readable, localized
1996 + * @return list of all installed language codes
1998 + * @see languageCodeToName
2000 + QStringList installedLanguages() const;
2003 + * Convert a known language code to a human readable, localized form.
2004 + * If an unknown language code is supplied, empty string is returned;
2005 + * this will never happen if the code has been obtained by one of the
2006 + * KLocale methods.
2008 + * @param language the language code
2010 + * @return the human readable and localized form if the code is known,
2014 + * @see languageList
2015 + * @see allLanguagesList
2016 + * @see installedLanguages
2018 + Q_INVOKABLE QString languageCodeToName(const QString &language) const;
2021 + * Provides list of all known country codes.
2023 + * Use countryCodeToName(country) to get human readable, localized
2026 + * @return a list of all country codes
2028 + * @see countryCodeToName
2030 + QStringList allCountriesList() const;
2033 + * Convert a known country code to a human readable, localized form.
2035 + * If an unknown country code is supplied, empty string is returned;
2036 + * this will never happen if the code has been obtained by one of the
2037 + * KLocale methods.
2039 + * @param country the country code
2041 + * @return the human readable and localized form of the country name
2044 + * @see allCountriesList
2046 + Q_INVOKABLE QString countryCodeToName(const QString &country) const;
2049 + * Parses locale string into distinct parts.
2050 + * The format of locale is language_COUNTRY@modifier.CHARSET
2052 + * @param locale the locale string to split
2053 + * @param language set to the language part of the locale
2054 + * @param country set to the country part of the locale
2055 + * @param modifier set to the modifer part of the locale
2056 + * @param charset set to the charset part of the locale
2058 + Q_INVOKABLE void splitLocale(const QString &locale, QString &language, QString &country,
2059 + QString &modifier, QString &charset);
2062 + * Returns the name of the internal language.
2064 + * @return Name of the default language
2066 + QString defaultLanguage();
2069 + * Returns the code of the default country, i.e. "C"
2071 + * This function will not provide a sensible value to use in your app,
2072 + * please use country() instead.
2076 + * @return Name of the default country
2078 + QString defaultCountry();
2082 + * Returns the ISO Code of the default currency.
2084 + * @return ISO Currency Code of the default currency
2086 + QString defaultCurrencyCode();
2089 + * Reports whether evaluation of translation scripts is enabled.
2091 + * @return true if script evaluation is enabled, false otherwise.
2093 + bool useTranscript() const;
2096 + * Checks whether or not the active catalog is found for the given language.
2098 + * @param language language to check
2100 + Q_INVOKABLE bool isApplicationTranslatedInto(const QString & language);
2104 + * Sets the Country Division Code of the Country where the user lives.
2106 + * The code must comply with the ISO 3166-2 standard.
2107 + * See http://en.wikipedia.org/wiki/ISO_3166-2 for details.
2109 + * In KDE 4.6 it is the apps responsibility to validate the input,
2110 + * full validation and other services will be provided in KDE 4.7.
2112 + * @param countryDivision the Country Division Code for the user
2113 + * @return @c true on success, @c false on failure
2114 + * @see countryDivisionCode
2116 + bool setCountryDivisionCode(const QString & countryDivision);
2120 + * Removes accelerator marker from a UI text label.
2122 + * Accelerator marker is not always a plain ampersand (&),
2123 + * so it is not enough to just remove it by @c QString::remove().
2124 + * The label may contain escaped markers ("&&") which must be resolved
2125 + * and skipped, as well as CJK-style markers ("Foo (&F)") where
2126 + * the whole parenthesis construct should be removed.
2127 + * Therefore always use this function to remove accelerator marker
2130 + * @param label UI label which may contain an accelerator marker
2131 + * @return label without the accelerator marker
2133 + Q_INVOKABLE QString removeAcceleratorMarker(const QString &label) const;
2137 + * Convert all digits in the string to the given digit set.
2139 + * Conversion is normally not performed if the given digit set
2140 + * is not appropriate in the current locale and language context.
2141 + * Unconditional conversion may be requested by setting
2142 + * @p ignoreContext to @c true.
2144 + * @param str the string to convert
2145 + * @param digitSet the digit set identifier
2146 + * @param ignoreContext unconditional conversion if @c true
2148 + * @return string with converted digits
2152 + Q_INVOKABLE QString convertDigits(const QString &str, DigitSet digitSet,
2153 + bool ignoreContext = false) const;
2157 + * Reparse locale configuration files for the current selected
2160 + Q_INVOKABLE void reparseConfiguration();
2163 + KLocale *m_locale;
2166 + void binaryUnitDialectChanged();
2167 + void calendarSystemChanged();
2168 + void countryDivisionCodeChanged();
2169 + void currencyCodeChanged();
2170 + void decimalSymbolChanged();
2171 + void currencySymbolChanged();
2172 + void dateFormatChanged();
2173 + void dateFormatShortChanged();
2174 + void dateMonthNamePossessiveChanged();
2175 + void dateTimeDigitSetChanged();
2176 + void decimalPlacesChanged();
2177 + void digitSetChanged();
2178 + void measureSystemChanged();
2179 + void monetaryDecimalPlacesChanged();
2180 + void monetaryDecimalSymbolChanged();
2181 + void monetaryDigitSetChanged();
2182 + void monetaryThousandsSeparatorChanged();
2183 + void negativeMonetarySignPositionChanged();
2184 + void negativePrefixCurrencySymbolChanged();
2185 + void negativeSignChanged();
2186 + void pageSizeChanged();
2187 + void positiveMonetarySignPositionChanged();
2188 + void positivePrefixCurrencySymbolChanged();
2189 + void positiveSignChanged();
2190 + void thousandsSeparatorChanged();
2191 + void timeFormatChanged();
2192 + void weekDayOfPrayChanged();
2193 + void WeekNumberSystemChanged();
2194 + void weekStartDayChanged();
2195 + void workingWeekEndDayChanged();
2196 + void workingWeekStartDayChanged();
2200 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/localebindingsplugin.cpp kde-runtime-4.9.0/plasma/declarativeimports/locale/localebindingsplugin.cpp
2201 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/localebindingsplugin.cpp 2012-05-23 01:59:52.000000000 +0200
2202 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/localebindingsplugin.cpp 2012-07-29 10:43:56.072917751 +0200
2205 #include "localebindingsplugin.h"
2206 #include <QtDeclarative/qdeclarative.h>
2207 -#include "locale.h"
2208 +#include "kdelocale.h"
2209 #include "calendarsystem.h"
2211 void LocaleBindingsPlugin::registerTypes(const char *uri)
2212 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/locale.cpp kde-runtime-4.9.0/plasma/declarativeimports/locale/locale.cpp
2213 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/locale.cpp 2012-05-23 01:59:52.000000000 +0200
2214 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/locale.cpp 1970-01-01 01:00:00.000000000 +0100
2216 -/* This file is part of the KDE libraries
2217 - Copyright (C) 2012 Giorgos Tsiapaliwkas <terietor@gmail.com>
2218 - Copyright (C) 2012 Antonis Tsiapaliokas <kok3rs@gmail.com>
2220 - This library is free software; you can redistribute it and/or
2221 - modify it under the terms of the GNU Library General Public
2222 - License as published by the Free Software Foundation; either
2223 - version 2 of the License, or (at your option) any later version.
2225 - This library is distributed in the hope that it will be useful,
2226 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2227 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2228 - Library General Public License for more details.
2230 - You should have received a copy of the GNU Library General Public License
2231 - along with this library; see the file COPYING.LIB. If not, write to
2232 - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
2233 - Boston, MA 02110-1301, USA.
2237 -#include "locale.h"
2242 -Locale::Locale(QObject* parent)
2245 - m_locale = KGlobal::locale();
2248 -bool Locale::setCountryDivisionCode(const QString &countryDivisionCode)
2250 - bool ok = m_locale->setCountryDivisionCode(countryDivisionCode);
2251 - emit countryDivisionCodeChanged();
2255 -void Locale::setCurrencyCode(const QString &newCurrencyCode)
2257 - m_locale->setCurrencyCode(newCurrencyCode);
2258 - emit currencyCodeChanged();
2261 -bool Locale::isApplicationTranslatedInto(const QString &lang)
2263 - return m_locale->isApplicationTranslatedInto(lang);
2266 -void Locale::splitLocale(const QString &locale, QString &language, QString &country, QString &modifier,
2269 - Locale::splitLocale(locale, language, country, modifier, charset);
2272 -QString Locale::language() const
2274 - return m_locale->language();
2277 -QString Locale::country() const
2279 - return m_locale->country();
2282 -QString Locale::countryDivisionCode() const
2284 - return m_locale->countryDivisionCode();
2287 -QString Locale::currencyCode() const
2289 - return m_locale->currencyCode();
2292 -QString Locale::translateQt(const char *context, const char *sourceText, const char *comment) const
2294 - return m_locale->translateQt(context, sourceText, comment);
2297 -QList<int> Locale::allDigitSetsList() const
2299 - QList<int> digitList;
2301 - foreach(KLocale::DigitSet digit, m_locale->allDigitSetsList()) {
2302 - digitList.append((int)digit);
2308 -QString Locale::digitSetToName(Locale::DigitSet digitSet, bool withDigits) const
2310 - return m_locale->digitSetToName((KLocale::DigitSet)digitSet, withDigits);
2313 -QString Locale::convertDigits(const QString &str, DigitSet digitSet, bool ignoreContext) const
2315 - return m_locale->convertDigits(str, (KLocale::DigitSet)digitSet, ignoreContext);
2318 -bool Locale::dateMonthNamePossessive() const
2320 - return m_locale->dateMonthNamePossessive();
2323 -int Locale::weekStartDay() const
2325 - return m_locale->weekStartDay();
2328 -int Locale::workingWeekStartDay() const
2330 - return m_locale->workingWeekStartDay();
2333 -int Locale::workingWeekEndDay() const
2335 - return m_locale->workingWeekEndDay();
2338 -int Locale::weekDayOfPray() const
2340 - return m_locale->weekDayOfPray();
2343 -int Locale::decimalPlaces() const
2345 - return m_locale->decimalPlaces();
2348 -QString Locale::decimalSymbol() const
2350 - return m_locale->decimalSymbol();
2353 -QString Locale::thousandsSeparator() const
2355 - return m_locale->thousandsSeparator();
2358 -QString Locale::currencySymbol() const
2360 - return m_locale->currencySymbol();
2363 -QString Locale::monetaryDecimalSymbol() const
2365 - return m_locale->monetaryDecimalSymbol();
2368 -QString Locale::monetaryThousandsSeparator() const
2370 - return m_locale->monetaryThousandsSeparator();
2373 -QString Locale::positiveSign() const
2375 - return m_locale->positiveSign();
2378 -QString Locale::negativeSign() const
2380 - return m_locale->negativeSign();
2383 -int Locale::monetaryDecimalPlaces() const
2385 - return m_locale->monetaryDecimalPlaces();
2388 -bool Locale::positivePrefixCurrencySymbol() const
2390 - return m_locale->positivePrefixCurrencySymbol();
2393 -bool Locale::negativePrefixCurrencySymbol() const
2395 - return m_locale->negativePrefixCurrencySymbol();
2398 -Locale::SignPosition Locale::positiveMonetarySignPosition() const
2400 - return (Locale::SignPosition)m_locale->positiveMonetarySignPosition();
2403 -Locale::SignPosition Locale::negativeMonetarySignPosition() const
2405 - return (Locale::SignPosition)m_locale->negativeMonetarySignPosition();
2408 -QString Locale::formatMoney(double num, const QString &symbol, int precision) const
2410 - return m_locale->formatMoney(num, symbol, precision);
2413 -QString Locale::formatLong(long num) const
2415 - return m_locale->formatLong(num);
2418 -QString Locale::formatNumber(const QString &numStr, bool round, int precision) const
2420 - return m_locale->formatNumber(numStr, round, precision);
2423 -QString Locale::formatByteSize(double size, int precision, Locale::BinaryUnitDialect dialect,
2424 - Locale::BinarySizeUnits specificUnit) const
2426 - return m_locale->formatByteSize(size, precision, (KLocale::BinaryUnitDialect)dialect, (KLocale::BinarySizeUnits)specificUnit);
2429 -QString Locale::formatByteSize(double size) const
2431 - return m_locale->formatByteSize(size);
2434 -Locale::BinaryUnitDialect Locale::binaryUnitDialect() const
2436 - return (Locale::BinaryUnitDialect)m_locale->binaryUnitDialect();
2439 -void Locale::setBinaryUnitDialect(Locale::BinaryUnitDialect newDialect)
2441 - m_locale->setBinaryUnitDialect((KLocale::BinaryUnitDialect)newDialect);
2442 - emit binaryUnitDialectChanged();
2445 -QString Locale::formatDuration(unsigned long mSec) const
2447 - return m_locale->formatDuration(mSec);
2450 -QString Locale::prettyFormatDuration(unsigned long mSec) const
2452 - return m_locale->prettyFormatDuration(mSec);
2455 -QString Locale::formatDate(const QDate &date, Locale::DateFormat format) const
2457 - return m_locale->formatDate(date, (KLocale::DateFormat)format);
2460 -double Locale::readNumber(const QString &_str) const
2463 - return m_locale->readNumber(_str, &ok);
2466 -double Locale::readMoney(const QString &_str) const
2469 - return m_locale->readMoney(_str, &ok);
2472 -QDate Locale::readDate(const QString &intstr, ReadDateFlags flags) const
2475 - return m_locale->readDate(intstr, (KLocale::ReadDateFlags)flags, &ok);
2478 -QTime Locale::readTime(const QString &intstr) const
2481 - return m_locale->readTime(intstr, &ok);
2484 -QTime Locale::readLocaleTime(const QString &intstr, TimeFormatOptions options,
2485 - TimeProcessingOptions processing) const
2488 - return m_locale->readLocaleTime(intstr, &ok, (KLocale::TimeFormatOptions)(int)options, (KLocale::TimeProcessingOptions)(int)processing);
2491 -QString Locale::formatLocaleTime(const QTime &time, TimeFormatOptions options) const
2493 - return m_locale->formatLocaleTime(time, (KLocale::TimeFormatOptions)(int)options);
2496 -bool Locale::use12Clock() const
2498 - return m_locale->use12Clock();
2501 -QString Locale::dayPeriodText(const QTime &time, DateTimeComponentFormat format) const
2503 - return m_locale->dayPeriodText(time, (KLocale::DateTimeComponentFormat)format);
2506 -QStringList Locale::languageList() const
2508 - return m_locale->languageList();
2511 -QStringList Locale::currencyCodeList() const
2513 - return m_locale->currencyCodeList();
2516 -QString Locale::formatDateTime(const QDateTime &dateTime, Locale::DateFormat format, DateTimeFormatOptions options) const
2518 - return m_locale->formatDateTime(dateTime, (KLocale::DateFormat)format, (KLocale::DateTimeFormatOptions)(int)options);
2521 -void Locale::setDateFormat(const QString &format)
2523 - m_locale->setDateFormat(format);
2524 - emit dateFormatChanged();
2527 -void Locale::setDateFormatShort(const QString &format)
2529 - m_locale->setDateFormatShort(format);
2530 - emit dateFormatShortChanged();
2533 -void Locale::setDateMonthNamePossessive(bool possessive)
2535 - m_locale->setDateMonthNamePossessive(possessive);
2536 - emit dateMonthNamePossessiveChanged();
2539 -void Locale::setTimeFormat(const QString &format)
2541 - m_locale->setTimeFormat(format);
2542 - emit timeFormatChanged();
2545 -void Locale::setWeekStartDay(int day)
2547 - m_locale->setWeekStartDay(day);
2548 - emit weekStartDayChanged();
2551 -void Locale::setWorkingWeekStartDay(int day)
2553 - m_locale->setWorkingWeekStartDay(day);
2554 - emit workingWeekStartDayChanged();
2557 -void Locale::setWorkingWeekEndDay(int day)
2559 - m_locale->setWorkingWeekEndDay(day);
2560 - emit workingWeekEndDayChanged();
2563 -void Locale::setWeekDayOfPray(int day)
2565 - m_locale->setWeekDayOfPray(day);
2566 - emit weekDayOfPrayChanged();
2569 -QString Locale::dateFormat() const
2571 - return m_locale->dateFormat();
2574 -QString Locale::dateFormatShort() const
2576 - return m_locale->dateFormatShort();
2579 -QString Locale::timeFormat() const
2581 - return m_locale->timeFormat();
2584 -void Locale::setDecimalPlaces(int digits)
2586 - m_locale->setDecimalPlaces(digits);
2587 - emit decimalPlacesChanged();
2590 -void Locale::setDecimalSymbol(const QString &symbol)
2592 - m_locale->setDecimalSymbol(symbol);
2593 - emit decimalSymbolChanged();
2596 -void Locale::setThousandsSeparator(const QString &separator)
2598 - m_locale->setThousandsSeparator(separator);
2599 - emit thousandsSeparatorChanged();
2602 -void Locale::setPositiveSign(const QString &sign)
2604 - m_locale->setPositiveSign(sign);
2605 - emit positiveSignChanged();
2608 -void Locale::setNegativeSign(const QString &sign)
2610 - m_locale->setNegativeSign(sign);
2611 - emit negativeSignChanged();
2614 -void Locale::setPositiveMonetarySignPosition(Locale::SignPosition signpos)
2616 - m_locale->setPositiveMonetarySignPosition((KLocale::SignPosition)signpos);
2617 - emit positiveMonetarySignPositionChanged();
2620 -void Locale::setNegativeMonetarySignPosition(Locale::SignPosition signpos)
2622 - m_locale->setNegativeMonetarySignPosition((KLocale::SignPosition)signpos);
2623 - emit negativeMonetarySignPositionChanged();
2626 -void Locale::setPositivePrefixCurrencySymbol(bool prefix)
2628 - m_locale->setPositivePrefixCurrencySymbol(prefix);
2629 - emit positivePrefixCurrencySymbolChanged();
2632 -void Locale::setNegativePrefixCurrencySymbol(bool prefix)
2634 - m_locale->setNegativePrefixCurrencySymbol(prefix);
2635 - emit negativePrefixCurrencySymbolChanged();
2638 -void Locale::setMonetaryDecimalPlaces(int digits)
2640 - m_locale->setMonetaryDecimalPlaces(digits);
2641 - emit monetaryDecimalPlacesChanged();
2644 -void Locale::setMonetaryThousandsSeparator(const QString &separator)
2646 - m_locale->setMonetaryThousandsSeparator(separator);
2647 - emit monetaryThousandsSeparatorChanged();
2650 -void Locale::setMonetaryDecimalSymbol(const QString &symbol)
2652 - m_locale->setMonetaryDecimalSymbol(symbol);
2653 - emit monetaryDecimalSymbolChanged();
2656 -void Locale::setCurrencySymbol(const QString & symbol)
2658 - m_locale->setCurrencySymbol(symbol);
2659 - emit currencySymbolChanged();
2662 -int Locale::pageSize() const
2664 - return m_locale->pageSize();
2667 -void Locale::setPageSize(int size)
2669 - m_locale->setPageSize(size);
2670 - emit pageSizeChanged();
2673 -Locale::MeasureSystem Locale::measureSystem() const
2675 - return (Locale::MeasureSystem)m_locale->measureSystem();
2678 -void Locale::setMeasureSystem(Locale::MeasureSystem value)
2680 - m_locale->setMeasureSystem((KLocale::MeasureSystem)value);
2681 - emit measureSystemChanged();
2684 -QString Locale::defaultLanguage()
2686 - return KLocale::defaultLanguage();
2689 -QString Locale::defaultCountry()
2691 - return KLocale::defaultCountry();
2694 -QString Locale::defaultCurrencyCode()
2696 - return KLocale::defaultCurrencyCode();
2699 -bool Locale::useTranscript() const
2701 - return m_locale->useTranscript();
2704 -int Locale::fileEncodingMib() const
2706 - return m_locale->fileEncodingMib();
2709 -QStringList Locale::allLanguagesList() const
2711 - return m_locale->allLanguagesList();
2714 -QStringList Locale::installedLanguages() const
2716 - return m_locale->installedLanguages();
2719 -QString Locale::languageCodeToName(const QString &language) const
2721 - return m_locale->languageCodeToName(language);
2724 -QStringList Locale::allCountriesList() const
2726 - return m_locale->allCountriesList();
2729 -QString Locale::countryCodeToName(const QString &country) const
2731 - return m_locale->countryCodeToName(country);
2734 -void Locale::setCalendarSystem(Locale::CalendarSystem calendarSystem)
2736 - m_locale->setCalendarSystem((KLocale::CalendarSystem)calendarSystem);
2737 - emit calendarSystemChanged();
2740 -Locale::CalendarSystem Locale::calendarSystem() const
2742 - return (Locale::CalendarSystem)m_locale->calendarSystem();
2745 -void Locale::setWeekNumberSystem(Locale::WeekNumberSystem weekNumberSystem)
2747 - m_locale->setWeekNumberSystem((KLocale::WeekNumberSystem)weekNumberSystem);
2748 - emit WeekNumberSystemChanged();
2751 -Locale::WeekNumberSystem Locale::weekNumberSystem() const
2753 - return (Locale::WeekNumberSystem)m_locale->weekNumberSystem();
2756 -QString Locale::removeAcceleratorMarker(const QString &label) const
2758 - return m_locale->removeAcceleratorMarker(label);
2761 -void Locale::setDigitSet(Locale::DigitSet digitSet)
2763 - m_locale->setDigitSet((KLocale::DigitSet)digitSet);
2764 - emit digitSetChanged();
2767 -Locale::DigitSet Locale::digitSet() const
2769 - return (Locale::DigitSet)m_locale->digitSet();
2772 -void Locale::setMonetaryDigitSet(Locale::DigitSet digitSet)
2774 - m_locale->setMonetaryDigitSet((KLocale::DigitSet)digitSet);
2775 - emit monetaryDigitSetChanged();
2778 -Locale::DigitSet Locale::monetaryDigitSet() const
2780 - return (Locale::DigitSet)m_locale->monetaryDigitSet();
2783 -void Locale::setDateTimeDigitSet(Locale::DigitSet digitSet)
2785 - m_locale->setDateTimeDigitSet((KLocale::DigitSet)digitSet);
2786 - emit dateTimeDigitSetChanged();
2789 -Locale::DigitSet Locale::dateTimeDigitSet() const
2791 - return (Locale::DigitSet)m_locale->dateTimeDigitSet();
2794 -void Locale::reparseConfiguration()
2796 - m_locale->reparseConfiguration();
2798 diff -urN kde-runtime-4.9.0.org/plasma/declarativeimports/locale/locale.h kde-runtime-4.9.0/plasma/declarativeimports/locale/locale.h
2799 --- kde-runtime-4.9.0.org/plasma/declarativeimports/locale/locale.h 2012-05-23 01:59:52.000000000 +0200
2800 +++ kde-runtime-4.9.0/plasma/declarativeimports/locale/locale.h 1970-01-01 01:00:00.000000000 +0100
2802 -/* This file is part of the KDE libraries
2803 - Copyright (C) 2012 Giorgos Tsiapaliwkas <terietor@gmail.com>
2804 - Copyright (C) 2012 Antonis Tsiapaliokas <kok3rs@gmail.com>
2806 - This library is free software; you can redistribute it and/or
2807 - modify it under the terms of the GNU Library General Public
2808 - License as published by the Free Software Foundation; either
2809 - version 2 of the License, or (at your option) any later version.
2811 - This library is distributed in the hope that it will be useful,
2812 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2813 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2814 - Library General Public License for more details.
2816 - You should have received a copy of the GNU Library General Public License
2817 - along with this library; see the file COPYING.LIB. If not, write to
2818 - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
2819 - Boston, MA 02110-1301, USA.
2843 - * KLocale provides support for country specific stuff like
2844 - * the national language.
2846 - * KLocale supports translating, as well as specifying the format
2847 - * for numbers, currency, time, and date.
2849 - * Use KGlobal::locale() to get pointer to the global KLocale object,
2850 - * containing the applications current locale settings.
2852 - * For example, to format the date May 17, 1995 in the current locale, use:
2855 - * QString date = KGlobal::locale()->formatDate(QDate(1995,5,17));
2858 - * @author Stephan Kulow <coolo@kde.org>, Preston Brown <pbrown@kde.org>,
2859 - * Hans Petter Bieker <bieker@kde.org>, Lukas Tinkl <lukas.tinkl@suse.cz>
2860 - * @short class for supporting locale settings and national language
2862 -class Locale : public QObject
2867 -Q_ENUMS(BinarySizeUnits)
2868 -Q_ENUMS(BinaryUnitDialect)
2869 -Q_ENUMS(CalendarSystem)
2870 -Q_ENUMS(DateFormat)
2871 -Q_ENUMS(DateTimeComponent)
2872 -Q_ENUMS(DateTimeComponentFormat)
2873 -Q_ENUMS(DateTimeFormatOption )
2875 -Q_ENUMS(MeasureSystem)
2876 -Q_ENUMS(ReadDateFlags)
2877 -Q_ENUMS(SignPosition)
2878 -Q_ENUMS(TimeFormatOption)
2879 -Q_ENUMS(TimeProcessingOption)
2880 -Q_ENUMS(WeekNumberSystem)
2883 -Q_PROPERTY(BinaryUnitDialect binaryUnitDialect READ binaryUnitDialect WRITE setBinaryUnitDialect NOTIFY binaryUnitDialectChanged)
2884 -Q_PROPERTY(Locale::CalendarSystem calendarSystem READ calendarSystem WRITE setCalendarSystem NOTIFY calendarSystemChanged)
2885 -Q_PROPERTY(QString country READ country CONSTANT) //read-only
2886 -Q_PROPERTY(QString countryDivisionCode READ countryDivisionCode WRITE setCountryDivisionCode NOTIFY countryDivisionCodeChanged)
2887 -Q_PROPERTY(QString currencyCode READ currencyCode WRITE setCurrencyCode NOTIFY currencyCodeChanged)
2888 -Q_PROPERTY(QString currencySymbol READ currencySymbol WRITE setCurrencySymbol NOTIFY currencySymbolChanged)
2889 -Q_PROPERTY(QString dateFormat READ dateFormat WRITE setDateFormat NOTIFY dateFormatChanged)
2890 -Q_PROPERTY(QString dateFormatShort READ dateFormatShort WRITE setDateFormat NOTIFY dateFormatShortChanged)
2891 -Q_PROPERTY(bool dateMonthNamePossessive READ dateMonthNamePossessive WRITE setDateMonthNamePossessive NOTIFY dateMonthNamePossessiveChanged)
2892 -Q_PROPERTY(DigitSet dateTimeDigitSet READ dateTimeDigitSet WRITE setDateTimeDigitSet NOTIFY dateTimeDigitSetChanged)
2893 -Q_PROPERTY(int decimalPlaces READ decimalPlaces WRITE setDecimalPlaces NOTIFY decimalPlacesChanged)
2894 -Q_PROPERTY(QString decimalSymbol READ decimalSymbol WRITE setDecimalSymbol NOTIFY decimalSymbolChanged)
2895 -Q_PROPERTY(DigitSet digitSet READ digitSet WRITE setDigitSet NOTIFY digitSetChanged)
2896 -Q_PROPERTY(QString language READ language CONSTANT) //read-only
2897 -Q_PROPERTY(MeasureSystem measureSystem READ measureSystem WRITE setMeasureSystem NOTIFY measureSystemChanged)
2898 -Q_PROPERTY(int monetaryDecimalPlaces READ monetaryDecimalPlaces WRITE setMonetaryDecimalPlaces NOTIFY monetaryDecimalPlacesChanged)
2899 -Q_PROPERTY(QString monetaryDecimalSymbol READ monetaryDecimalSymbol WRITE setMonetaryDecimalSymbol NOTIFY monetaryDecimalSymbolChanged)
2900 -Q_PROPERTY(DigitSet monetaryDigitSet READ monetaryDigitSet WRITE setMonetaryDigitSet NOTIFY monetaryDigitSetChanged)
2901 -Q_PROPERTY(QString monetaryThousandsSeparator READ monetaryThousandsSeparator WRITE setMonetaryThousandsSeparator NOTIFY monetaryThousandsSeparatorChanged)
2902 -Q_PROPERTY(SignPosition negativeMonetarySignPosition READ negativeMonetarySignPosition WRITE setNegativeMonetarySignPosition NOTIFY negativeMonetarySignPositionChanged)
2903 -Q_PROPERTY(bool negativePrefixCurrencySymbol READ negativePrefixCurrencySymbol WRITE setNegativePrefixCurrencySymbol NOTIFY negativePrefixCurrencySymbolChanged)
2904 -Q_PROPERTY(QString negativeSign READ negativeSign WRITE setNegativeSign NOTIFY negativeSignChanged)
2905 -Q_PROPERTY(int pageSize READ pageSize WRITE setPageSize NOTIFY pageSizeChanged)
2906 -Q_PROPERTY(SignPosition positiveMonetarySignPosition READ positiveMonetarySignPosition WRITE setPositiveMonetarySignPosition NOTIFY positiveMonetarySignPositionChanged)
2907 -Q_PROPERTY(bool positivePrefixCurrencySymbol READ positivePrefixCurrencySymbol WRITE setPositivePrefixCurrencySymbol NOTIFY positivePrefixCurrencySymbolChanged)
2908 -Q_PROPERTY(QString positiveSign READ positiveSign WRITE setPositiveSign NOTIFY positiveSignChanged)
2909 -Q_PROPERTY(QString thousandsSeparator READ thousandsSeparator WRITE setThousandsSeparator NOTIFY thousandsSeparatorChanged)
2910 -Q_PROPERTY(int weekDayOfPray READ weekDayOfPray WRITE setWeekDayOfPray NOTIFY weekDayOfPrayChanged)
2911 -Q_PROPERTY(Locale::WeekNumberSystem weekNumberSystem READ weekNumberSystem WRITE setWeekNumberSystem NOTIFY WeekNumberSystemChanged)
2912 -Q_PROPERTY(int weekStartDay READ weekStartDay WRITE setWeekStartDay NOTIFY weekStartDayChanged)
2913 -Q_PROPERTY(int workingWeekEndDay READ workingWeekEndDay WRITE setWorkingWeekEndDay NOTIFY workingWeekEndDayChanged)
2914 -Q_PROPERTY(int workingWeekStartDay READ workingWeekStartDay WRITE setWorkingWeekStartDay NOTIFY workingWeekStartDayChanged)
2915 -Q_PROPERTY(bool use12Clock READ use12Clock CONSTANT)
2916 -Q_PROPERTY(QString defaultLanguage READ defaultLanguage CONSTANT)//read-only
2917 -Q_PROPERTY(QString defaultCountry READ defaultCountry CONSTANT)//read-only
2918 -Q_PROPERTY(QString defaultCurrencyCode READ defaultCurrencyCode CONSTANT)//read-only
2919 -Q_PROPERTY(bool useTranscript READ useTranscript CONSTANT) //read-only
2920 -Q_PROPERTY(int fileEncodingMib READ fileEncodingMib CONSTANT) //read-only
2921 -Q_PROPERTY(QStringList languageList READ languageList CONSTANT) //read-only
2922 -Q_PROPERTY(QStringList currencyCodeList READ currencyCodeList CONSTANT) //read-only
2923 -Q_PROPERTY(QStringList allLanguagesList READ allLanguagesList CONSTANT) //read-only
2924 -Q_PROPERTY(QStringList installedLanguages READ installedLanguages CONSTANT) //read-only
2925 -Q_PROPERTY(QStringList allCountriesList READ allCountriesList CONSTANT) //read-only
2926 -Q_PROPERTY(QList<int> allDigitSetsList READ allDigitSetsList CONSTANT) //read-only
2932 - Locale(QObject *parent = 0);
2935 - * Various positions for where to place the positive or negative
2936 - * sign when they are related to a monetary value.
2938 - enum SignPosition {
2940 - * Put parantheses around the quantity, e.g. "$ (217)"
2944 - * Prefix the quantity with the sign, e.g. "$ -217"
2946 - BeforeQuantityMoney = 1,
2948 - * Suffix the quanitity with the sign, e.g. "$ 217-"
2950 - AfterQuantityMoney = 2,
2952 - * Prefix the currency symbol with the sign, e.g. "-$ 217"
2956 - * Suffix the currency symbol with the sign, e.g. "$- 217"
2963 - * The set of digit characters used to display and enter numbers.
2966 - ArabicDigits, /**< 0123456789 (European and some Asian
2967 - languages and western Arabic dialects) */
2968 - ArabicIndicDigits, /**< ٠١٢٣٤٥٦٧٨٩ (eastern Arabic dialects) */
2969 - EasternArabicIndicDigits, /**< ۰۱۲۳۴۵۶۷۸۹ (Persian and Urdu) */
2970 - DevenagariDigits, /**< ०१२३४५६७८९ (Hindi) */
2971 - BengaliDigits, /**< ০১২৩৪৫৬৭৮৯ (Bengali and Assamese) */
2972 - GujaratiDigits, /**< ૦૧૨૩૪૫૬૭૮૯ (Gujarati) */
2973 - GurmukhiDigits, /**< ੦੧੨੩੪੫੬੭੮੯ (Punjabi) */
2974 - KannadaDigits, /**< ೦೧೨೩೪೫೬೭೮೯ (Kannada) */
2975 - KhmerDigits, /**< ០១២៣៤៥៦៧៨៩ (Khmer) */
2976 - MalayalamDigits, /**< ൦൧൨൩൪൫൬൭൮൯ (Malayalam) */
2977 - OriyaDigits, /**< ୦୧୨୩୪୫୬୭୮୯ (Oriya) */
2978 - TamilDigits, /**< ௦௧௨௩௪௫௬௭௮ (Tamil) */
2979 - TeluguDigits, /**< ౦౧౨౩౪౫౬౭౯ (Telugu) */
2980 - ThaiDigits /**< ๐๑๒๓๔๕๖๗๘๙ (Thai) */
2981 - // The following Decimal Digit Sets are defined in Unicode but the associated
2982 - // languages are not yet translated in KDE, so are not yet enabled.
2983 - // The script names are taken from the Unicode standard, the associated
2984 - // languages from Wikipedia.
2985 - // BalineseDigits, /**< ᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙ (Balinese) */
2986 - // ChamDigits, /**< ꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙ (Cham) */
2987 - // JavaneseDigits, /**< ꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙ (Javanese) */
2988 - // KayahLiDigits, /**< ꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉ (Kayah) */
2989 - // LaoDigits, /**< ໐໑໒໓໔໕໖໗໘໙ (Lao) */
2990 - // LepchaDigits, /**< ᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉ (Lepcha) */
2991 - // LimbuDigits, /**< ᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏ (Limbu) */
2992 - // MeeteiMayekDigits, /**< ꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹ (Meitei) */
2993 - // MongolianDigits, /**< ᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙ (Mongolian) */
2994 - // MyanmarDigits, /**< ၀၁၂၃၄၅၆၇၈၉ (Myanmar/Burmese ) */
2995 - // MyanmarShanDigits, /**< ႐႑႒႓႔႕႖႗႘႙ (Shan) */
2996 - // NewTaiLueDigits, /**< ᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙ (Tai Lü) */
2997 - // NKoDigits, /**< ߀߁߂߃߄߅߆߇߈߉ (Mande and N'Ko) */
2998 - // OlChikiDigits, /**< ᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙ (Santali) */
2999 - // OsmanyaDigits, /**< ҠҡҢңҤҥҦҧҨҩ (Somali) */
3000 - // SaurashtraDigits, /**< ꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙ (Saurashtra) */
3001 - // SundaneseDigits, /**< ᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹ (Sundanese) */
3002 - // TaiThamDigits, /**< ᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙ (Tai Lü) */
3003 - // TibetanDigits, /**< ༠༡༢༣༤༥༦༧༨༩ (Tibetan) */
3004 - // VaiDigits, /**< ꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩ (Vai) */
3009 - * Convert a digit set identifier to a human readable, localized name.
3011 - * @param digitSet the digit set identifier
3012 - * @param withDigits whether to add the digits themselves to the name
3014 - * @return the human readable and localized name of the digit set
3018 - QString digitSetToName(DigitSet digitSet, bool withDigits = false) const;
3022 - * Provides list of all known digit set identifiers.
3024 - * @return list of all digit set identifiers
3026 - * @see digitSetToName
3028 - QList<int> allDigitSetsList() const;
3031 - * Returns what a decimal point should look like ("." or "," etc.)
3032 - * according to the current locale or user settings.
3034 - * @return The decimal symbol used by locale.
3036 - QString decimalSymbol() const;
3039 - * Returns what the thousands separator should look
3040 - * like ("," or "." etc.)
3041 - * according to the current locale or user settings.
3043 - * @return The thousands separator used by locale.
3045 - QString thousandsSeparator() const;
3049 - * Returns the identifier of the digit set used to display numbers.
3051 - * @return the digit set identifier
3053 - * @see digitSetToName
3055 - DigitSet digitSet() const;
3059 - * Returns the ISO 4217 Currency Code for the current locale
3061 - * @return The default ISO Currency Code used by locale.
3063 - QString currencyCode() const;
3066 - * Returns what the symbol denoting currency in the current locale
3067 - * as as defined by user settings should look like.
3069 - * @return The default currency symbol used by locale.
3071 - QString currencySymbol() const;
3074 - * Returns what a decimal point should look like ("." or "," etc.)
3075 - * for monetary values, according to the current locale or user
3078 - * @return The monetary decimal symbol used by locale.
3080 - QString monetaryDecimalSymbol() const;
3083 - * Returns what a thousands separator for monetary values should
3084 - * look like ("," or " " etc.) according to the current locale or
3087 - * @return The monetary thousands separator used by locale.
3089 - QString monetaryThousandsSeparator() const;
3092 - * Returns what a positive sign should look like ("+", " ", etc.)
3093 - * according to the current locale or user settings.
3095 - * @return The positive sign used by locale.
3097 - QString positiveSign() const;
3100 - * Returns what a negative sign should look like ("-", etc.)
3101 - * according to the current locale or user settings.
3103 - * @return The negative sign used by locale.
3105 - QString negativeSign() const;
3109 - * The number of decimal places to include in numeric values (usually 2).
3111 - * @return Default number of numeric decimal places used by locale.
3113 - int decimalPlaces() const;
3117 - * The number of decimal places to include in monetary values (usually 2).
3119 - * @return Default number of monetary decimal places used by locale.
3121 - int monetaryDecimalPlaces() const;
3124 - * If and only if the currency symbol precedes a positive value,
3125 - * this will be true.
3127 - * @return Where to print the currency symbol for positive numbers.
3129 - bool positivePrefixCurrencySymbol() const;
3132 - * If and only if the currency symbol precedes a negative value,
3133 - * this will be true.
3135 - * @return True if the currency symbol precedes negative numbers.
3137 - bool negativePrefixCurrencySymbol() const;
3140 - * Returns the position of a positive sign in relation to a
3143 - * @return Where/how to print the positive sign.
3144 - * @see SignPosition
3146 - SignPosition positiveMonetarySignPosition() const;
3149 - * Denotes where to place a negative sign in relation to a
3152 - * @return Where/how to print the negative sign.
3153 - * @see SignPosition
3155 - SignPosition negativeMonetarySignPosition() const;
3159 - * Retuns the digit set used to display monetary values.
3161 - * @return the digit set identifier
3163 - * @see digitSetToName
3165 - DigitSet monetaryDigitSet() const;
3168 - * Given a double, converts that to a numeric string containing
3169 - * the localized monetary equivalent.
3171 - * e.g. given 123456, return "$ 123,456.00".
3173 - * If precision isn't specified or is < 0, then the default monetaryDecimalPlaces() is used.
3175 - * @param num The number we want to format
3176 - * @param currency The currency symbol you want.
3177 - * @param precision Number of decimal places displayed
3179 - * @return The number of money as a localized string
3180 - * @see monetaryDecimalPlaces()
3182 - Q_INVOKABLE QString formatMoney(double num, const QString ¤cy = QString(), int precision = -1) const;
3185 - * Given a string representing a number, converts that to a numeric
3186 - * string containing the localized numeric equivalent.
3188 - * e.g. given 123456.78F, return "123,456.78" (for some European country).
3190 - * If precision isn't specified or is < 0, then the default decimalPlaces() is used.
3192 - * @param numStr The number to format, as a string.
3193 - * @param round Round fractional digits. (default true)
3194 - * @param precision Number of fractional digits used for rounding. Unused if round=false.
3196 - * @return The number as a localized string
3198 - Q_INVOKABLE QString formatNumber(const QString &numStr, bool round = true, int precision = -1) const;
3201 - * Given an integer, converts that to a numeric string containing
3202 - * the localized numeric equivalent.
3204 - * e.g. given 123456L, return "123,456" (for some European country).
3206 - * @param num The number to convert
3208 - * @return The number as a localized string
3210 - Q_INVOKABLE QString formatLong(long num) const;
3213 - * These binary units are used in KDE by the formatByteSize()
3216 - * NOTE: There are several different units standards:
3217 - * 1) SI (i.e. metric), powers-of-10.
3218 - * 2) IEC, powers-of-2, with specific units KiB, MiB, etc.
3219 - * 3) JEDEC, powers-of-2, used for solid state memory sizing which
3220 - * is why you see flash cards labels as e.g. 4GB. These (ab)use
3221 - * the metric units. Although JEDEC only defines KB, MB, GB, if
3222 - * JEDEC is selected all units will be powers-of-2 with metric
3223 - * prefixes for clarity in the event of sizes larger than 1024 GB.
3225 - * Although 3 different dialects are possible this enum only uses
3226 - * metric names since adding all 3 different names of essentially the same
3227 - * unit would be pointless. Use BinaryUnitDialect to control the exact
3230 - * @see binaryUnitDialect
3232 - enum BinarySizeUnits {
3233 - /// Auto-choose a unit such that the result is in the range [0, 1000 or 1024)
3234 - DefaultBinaryUnits = 1000,
3236 - // The first real unit must be 0 for the current implementation!
3237 - UnitByte = 0, ///< B 1 byte
3238 - UnitKiloByte, ///< KiB/KB/kB 1024/1000 bytes.
3239 - UnitMegaByte, ///< MiB/MB/MB 2^20/10^06 bytes.
3240 - UnitGigaByte, ///< GiB/GB/GB 2^30/10^09 bytes.
3241 - UnitTeraByte, ///< TiB/TB/TB 2^40/10^12 bytes.
3242 - UnitPetaByte, ///< PiB/PB/PB 2^50/10^15 bytes.
3243 - UnitExaByte, ///< EiB/EB/EB 2^60/10^18 bytes.
3244 - UnitZettaByte, ///< ZiB/ZB/ZB 2^70/10^21 bytes.
3245 - UnitYottaByte, ///< YiB/YB/YB 2^80/10^24 bytes.
3246 - UnitLastUnit = UnitYottaByte
3250 - * This enum chooses what dialect is used for binary units.
3252 - * Note: Although JEDEC abuses the metric prefixes and can therefore be
3253 - * confusing, it has been used to describe *memory* sizes for quite some time
3254 - * and programs should therefore use either Default, JEDEC, or IEC 60027-2
3255 - * for memory sizes.
3257 - * On the other hand network transmission rates are typically in metric so
3258 - * Default, Metric, or IEC (which is unambiguous) should be chosen.
3260 - * Normally choosing DefaultBinaryUnits is the best option as that uses
3261 - * the user's selection for units.
3263 - * @see binaryUnitDialect
3264 - * @see setBinaryUnitDialect
3266 - enum BinaryUnitDialect {
3267 - DefaultBinaryDialect = 1000, ///< Used if no specific preference
3268 - IECBinaryDialect = 0, ///< KDE Default, KiB, MiB, etc. 2^(10*n)
3269 - JEDECBinaryDialect, ///< KDE 3.5 default, KB, MB, etc. 2^(10*n)
3270 - MetricBinaryDialect, ///< SI Units, kB, MB, etc. 10^(3*n)
3271 - LastBinaryDialect = MetricBinaryDialect
3275 - * Converts @p size from bytes to the string representation using the
3276 - * user's default binary unit dialect. The default unit dialect is
3280 - * formatByteSize(1024) returns "1.0 KiB" by default.
3282 - * @param size size in bytes
3283 - * @return converted size as a string - e.g. 123.4 KiB , 12.0 MiB
3284 - * @see BinaryUnitDialect
3285 - * @todo KDE 5: Remove in favor of overload added in KDE 4.4.
3287 - Q_INVOKABLE QString formatByteSize(double size) const;
3291 - * Converts @p size from bytes to the appropriate string representation
3292 - * using the binary unit dialect @p dialect and the specific units @p specificUnit.
3295 - * formatByteSize(1000, unit, Locale::BinaryUnitKilo) returns:
3296 - * for Locale::MetricBinaryUnits, "1.0 kB",
3297 - * for Locale::IECBinaryUnits, "0.9 KiB",
3298 - * for Locale::JEDECBinaryUnits, "0.9 KB".
3300 - * @param size size in bytes
3301 - * @param precision number of places after the decimal point to use. KDE uses
3302 - * 1 by default so when in doubt use 1.
3303 - * @param dialect binary unit standard to use. Use DefaultBinaryUnits to
3304 - * use the localized user selection unless you need to use a specific
3305 - * unit type (such as displaying a flash memory size in JEDEC).
3306 - * @param specificUnit specific unit size to use in result. Use
3307 - * DefaultBinarySize to automatically select a unit that will return
3308 - * a sanely-sized number.
3309 - * @return converted size as a translated string including the units.
3310 - * E.g. "1.23 KiB", "2 GB" (JEDEC), "4.2 kB" (Metric).
3311 - * @see BinaryUnitDialect
3313 - QString formatByteSize(double size, int precision,
3314 - BinaryUnitDialect dialect = Locale::DefaultBinaryDialect,
3315 - BinarySizeUnits specificUnit = Locale::DefaultBinaryUnits) const;
3318 - * Returns the user's configured binary unit dialect.
3319 - * e.g. if MetricBinaryDialect is returned then the values
3320 - * configured for how much a set of bytes are worth would
3321 - * be 10^(3*n) and KB (1000 bytes == 1 KB), in this case.
3323 - * Will never return DefaultBinaryDialect.
3325 - * @return User's configured binary unit dialect
3326 - * @see BinaryUnitDialect
3328 - BinaryUnitDialect binaryUnitDialect() const;
3331 - * Sets @p newDialect to be the default dialect for this locale (and only
3332 - * this locale). Newly created KLocale objects will continue to default
3333 - * to the user's choice.
3335 - * @param newDialect the new dialect to set as default for this locale object.
3337 - void setBinaryUnitDialect(BinaryUnitDialect newDialect);
3340 - * Given a number of milliseconds, converts that to a string containing
3341 - * the localized equivalent
3343 - * e.g. given formatDuration(60000), returns "1.0 minutes"
3345 - * @param mSec Time duration in milliseconds
3346 - * @return converted duration as a string - e.g. "5.5 seconds" "23.0 minutes"
3348 - Q_INVOKABLE QString formatDuration(unsigned long mSec) const;
3351 - * Given a number of milliseconds, converts that to a pretty string containing
3352 - * the localized equivalent.
3354 - * e.g. given prettyFormatDuration(60001) returns "1 minute"
3355 - * given prettyFormatDuration(62005) returns "1 minute and 2 seconds"
3356 - * given prettyFormatDuration(90060000) returns "1 day and 1 hour"
3358 - * @param mSec Time duration in milliseconds
3359 - * @return converted duration as a string.
3360 - * Units not interesting to the user, for example seconds or minutes when the first
3361 - * unit is day, are not returned because they are irrelevant. The same applies for
3362 - * seconds when the first unit is hour.
3364 - Q_INVOKABLE QString prettyFormatDuration(unsigned long mSec) const;
3368 - * Available Calendar Systems
3370 - * @see setCalendarSystem()
3371 - * @see calendarSystem()
3373 - enum CalendarSystem {
3374 - QDateCalendar = 1, /**< KDE Default, hybrid of Gregorian and Julian as used by QDate */
3375 - //BahaiCalendar = 2, /**< Baha'i Calendar */
3376 - //BuddhistLunarCalendar = 3, /**< Buddhist Lunar Calendar*/
3377 - //ChineseCalendar = 4, /**< Chinese Calendar */
3378 - CopticCalendar = 5, /**< Coptic Calendar as used Coptic Church and some parts of Egypt */
3379 - EthiopianCalendar = 6, /**< Ethiopian Calendar, aka Ethiopic Calendar */
3380 - //EthiopianAmeteAlemCalendar = 7, /**< Ethiopian Amete Alem version, aka Ethiopic Amete Alem */
3381 - GregorianCalendar = 8, /**< Gregorian Calendar, pure proleptic implementation */
3382 - HebrewCalendar = 9, /**< Hebrew Calendar, aka Jewish Calendar */
3383 - //HinduCalendar = 10, /**< Hindu Lunar Calendar */
3384 - //IslamicLunarCalendar = 11, /**< Islamic Lunar Calendar */
3385 - IslamicCivilCalendar = 12, /**< Islamic Civil Calendar, aka Hijri, not the Lunar Calendar */
3386 - //IslamicUmAlQuraCalendar = 13, /**< Islamic Lunar Calendar, Um Al Qura varient used in Saudi Arabia */
3387 - IndianNationalCalendar = 14, /**< Indian National Calendar, not the Lunar Calendar */
3388 - //Iso8601Calendar = 15, /**< ISO 8601 Standard Calendar */
3389 - JalaliCalendar = 16, /**< Jalali Calendar, aka Persian or Iranian, also used in Afghanistan */
3390 - //JalaliBirashkCalendar = 17, /**< Jalali Calendar, Birashk Algorythm variant */
3391 - //Jalali33YearCalendar = 18, /**< Jalali Calendar, 33 Year cycle variant */
3392 - JapaneseCalendar= 19, /**< Japanese Calendar, Gregorian calculation using Japanese Era (Nengô) */
3393 - //JucheCalendar = 20, /**< Juche Calendar, used in North Korea */
3394 - JulianCalendar = 21, /**< Julian Calendar, as used in Orthodox Churches */
3395 - MinguoCalendar= 22, /**< Minguo Calendar, aka ROC, Republic of China or Taiwanese */
3396 - ThaiCalendar = 23 /**< Thai Calendar, aka Buddhist or Thai Buddhist */
3401 - * System used for Week Numbers
3403 - * @see setWeekNumberSystem()
3404 - * @see weekNumberSystem()
3406 - enum WeekNumberSystem {
3407 - DefaultWeekNumber = 1000, /**< The system locale default */
3408 - IsoWeekNumber = 0, /**< ISO Week Number */
3409 - FirstFullWeek = 1, /**< Week 1 starts on the first Week Start Day in year ends after 7 days */
3410 - FirstPartialWeek = 2, /**< Week 1 starts Jan 1st ends day before first Week Start Day in year */
3411 - SimpleWeek = 3 /**< Week 1 starts Jan 1st ends after 7 days */
3416 - * The various Components that make up a Date / Time
3417 - * In the future the Components may be combined as flags for dynamic
3418 - * generation of Date Formats.
3420 - * @see CalendarSystem
3421 - * @see KLocalizedDate
3422 - * @see DateTimeComponentFormat
3424 - enum DateTimeComponent {
3425 - Year = 0x1, /**< The Year portion of a date, may be number or name */
3426 - YearName = 0x2, /**< The Year Name portion of a date */
3427 - Month = 0x4, /**< The Month portion of a date, may be number or name */
3428 - MonthName = 0x8, /**< The Month Name portion of a date */
3429 - Day = 0x10, /**< The Day portion of a date, may be number or name */
3430 - DayName = 0x20, /**< The Day Name portion of a date */
3431 - JulianDay = 0x40, /**< The Julian Day of a date */
3432 - EraName = 0x80, /**< The Era Name portion of a date */
3433 - EraYear = 0x100, /**< The Era and Year portion of a date */
3434 - YearInEra = 0x200, /**< The Year In Era portion of a date */
3435 - DayOfYear = 0x400, /**< The Day Of Year portion of a date, may be number or name */
3436 - DayOfYearName = 0x800, /**< The Day Of Year Name portion of a date */
3437 - DayOfWeek = 0x1000, /**< The Day Of Week / Weekday portion of a date, may be number or name */
3438 - DayOfWeekName = 0x2000, /**< The Day Of Week Name / Weekday Name portion of a date */
3439 - Week = 0x4000, /**< The Week Number portion of a date */
3440 - WeekYear = 0x8000, /**< The Week Year portion of a date */
3441 - MonthsInYear = 0x10000, /**< The Months In Year portion of a date */
3442 - WeeksInYear = 0x20000, /**< The Weeks In Year portion of a date */
3443 - DaysInYear = 0x40000, /**< The Days In Year portion of a date */
3444 - DaysInMonth = 0x80000, /**< The Days In Month portion of a date */
3445 - DaysInWeek = 0x100000, /**< The Days In Week portion of a date */
3446 - Hour = 0x200000, /**< The Hours portion of a date */
3447 - Minute = 0x400000, /**< The Minutes portion of a date */
3448 - Second = 0x800000, /**< The Seconds portion of a date */
3449 - Millisecond = 0x1000000, /**< The Milliseconds portion of a date */
3450 - DayPeriod = 0x2000000, /**< The Day Period portion of a date, e.g. AM/PM */
3451 - DayPeriodHour = 0x4000000, /**< The Day Period Hour portion of a date */
3452 - Timezone = 0x8000000, /**< The Time Zone portion of a date, may be offset or name */
3453 - TimezoneName = 0x10000000, /**< The Time Zone Name portion of a date */
3454 - UnixTime = 0x20000000 /**< The UNIX Time portion of a date */
3459 - * Format used for individual Date/Time Components when converted to/from a string
3460 - * Largely equivalent to the UNICODE CLDR format width definitions 1..5
3462 - * @see DateTimeComponentFormat
3464 - enum DateTimeComponentFormat {
3465 - DefaultComponentFormat = 1000, /**< The system locale default for the componant */
3466 - ShortNumber = 0, /**< Number at its natural width, e.g. 2 for the 2nd*/
3467 - LongNumber, /**< Number padded to a required width, e.g. 02 for the 2nd*/
3468 - //OrdinalNumber /**< Ordinal number format, e.g. "2nd" for the 2nd */
3469 - NarrowName = 3, /**< Narrow text format, may not be unique, e.g. M for Monday */
3470 - ShortName, /**< Short text format, e.g. Mon for Monday */
3471 - LongName /**< Long text format, e.g. Monday for Monday */
3474 - Q_DECLARE_FLAGS(DateTimeComponents, DateTimeComponent)
3477 - * Format for date string.
3480 - ShortDate, /**< Locale Short date format, e.g. 08-04-2007 */
3481 - LongDate, /**< Locale Long date format, e.g. Sunday 08 April 2007 */
3482 - FancyShortDate, /**< Same as ShortDate for dates a week or more ago. For more
3483 - recent dates, it is represented as Today, Yesterday, or
3484 - the weekday name. */
3485 - FancyLongDate, /**< Same as LongDate for dates a week or more ago. For more
3486 - recent dates, it is represented as Today, Yesterday, or
3487 - the weekday name. */
3488 - IsoDate, /**< ISO-8601 Date format YYYY-MM-DD, e.g. 2009-12-31 */
3489 - IsoWeekDate, /**< ISO-8601 Week Date format YYYY-Www-D, e.g. 2009-W01-1 */
3490 - IsoOrdinalDate /**< ISO-8601 Ordinal Date format YYYY-DDD, e.g. 2009-001 */
3494 - * Returns a string formatted to the current locale's conventions
3495 - * regarding dates.
3497 - * @param date the date to be formatted
3498 - * @param format category of date format to use
3500 - * @return the date as a string
3502 - Q_INVOKABLE QString formatDate(const QDate &date, DateFormat format = LongDate) const;
3505 - * Options for formatting date-time values.
3507 - enum DateTimeFormatOption {
3508 - TimeZone = 0x01, /**< Include a time zone string */
3509 - Seconds = 0x02 /**< Include the seconds value */
3512 - Q_DECLARE_FLAGS(DateTimeFormatOptions, DateTimeFormatOption)
3515 - * Returns a string formatted to the current locale's conventions
3516 - * regarding both date and time.
3518 - * @param dateTime the date and time to be formatted
3519 - * @param format category of date format to use
3520 - * @param options additional output options
3522 - * @return The date and time as a string
3524 - Q_INVOKABLE QString formatDateTime(const QDateTime &dateTime, DateFormat format = ShortDate,
3525 - DateTimeFormatOptions options = 0) const;
3528 - * Use this to determine whether in dates a possessive form of month
3529 - * name is preferred ("of January" rather than "January")
3531 - * @return If possessive form should be used
3533 - bool dateMonthNamePossessive() const;
3537 - * Format flags for readLocaleTime() and formatLocaleTime()
3539 - enum TimeFormatOption {
3540 - TimeDefault = 0x0, ///< Default formatting using seconds and the format
3541 - ///< as specified by the locale.
3542 - TimeWithoutSeconds = 0x1, ///< Exclude the seconds part of the time from display
3543 - TimeWithoutAmPm = 0x2, ///< Read/format time string without am/pm suffix but
3544 - ///< keep the 12/24h format as specified by locale time
3545 - ///< format, eg. "07.33.05" instead of "07.33.05 pm" for
3546 - ///< time format "%I.%M.%S %p".
3547 - TimeDuration = 0x6, ///< Read/format time string as duration. This will strip
3548 - ///< the am/pm suffix and read/format times with an hour
3549 - ///< value of 0-23 hours, eg. "19.33.05" instead of
3550 - ///< "07.33.05 pm" for time format "%I.%M.%S %p".
3551 - ///< This automatically implies @c TimeWithoutAmPm.
3552 - TimeFoldHours = 0xE ///< Read/format time string as duration. This will not
3553 - ///< not output the hours part of the duration but will
3554 - ///< add the hours (times sixty) to the number of minutes,
3555 - ///< eg. "70.23" instead of "01.10.23" for time format
3556 - ///< "%I.%M.%S %p".
3559 - Q_DECLARE_FLAGS(TimeFormatOptions, TimeFormatOption)
3563 - * Returns a string formatted to the current locale's conventions
3564 - * regarding times.
3566 - * @param pTime the time to be formatted
3567 - * @param options format option to use when formatting the time
3568 - * @return The time as a string
3570 - Q_INVOKABLE QString formatLocaleTime(const QTime &pTime,
3571 - TimeFormatOptions options = Locale::TimeDefault) const;
3575 - * Returns the identifier of the digit set used to display dates and time.
3577 - * @return the digit set identifier
3579 - * @see digitSetToName
3581 - DigitSet dateTimeDigitSet() const;
3584 - * Use this to determine if the user wants a 12 hour clock.
3586 - * @return If the user wants 12h clock
3588 - bool use12Clock() const;
3592 - * Returns the Day Period matching the time given
3594 - * @param time the time to return the day period for
3595 - * @param format the format to return teh day period in
3596 - * @return the Day Period for the given time
3598 - Q_INVOKABLE QString dayPeriodText(const QTime &time, DateTimeComponentFormat format = DefaultComponentFormat) const;
3601 - * Use this to determine which day is the first day of the week.
3603 - * @return an integer (Monday=1..Sunday=7)
3605 - int weekStartDay() const;
3608 - * Use this to determine which day is the first working day of the week.
3610 - * @return an integer (Monday=1..Sunday=7)
3612 - int workingWeekStartDay() const;
3615 - * Use this to determine which day is the last working day of the week.
3617 - * @return an integer (Monday=1..Sunday=7)
3619 - int workingWeekEndDay() const;
3622 - * Use this to determine which day is reserved for religious observance
3624 - * @return day number (None = 0, Monday = 1, ..., Sunday = 7)
3626 - int weekDayOfPray() const;
3630 - * Returns the type of Calendar System used in this Locale
3632 - * @see Locale::CalendarSystem
3633 - * @see CalendarSystem
3634 - * @return the type of Calendar System
3636 - Locale::CalendarSystem calendarSystem() const;
3640 - * Sets the type of Calendar System to use in this Locale
3642 - * @see Locale::CalendarSystem
3643 - * @see CalendarSystem
3644 - * @param calendarSystem the Calendar System to use
3646 - void setCalendarSystem(Locale::CalendarSystem calendarSystem);
3650 - * Sets the type of Week Number System to use in this Locale
3652 - * @see Klocale::WeekNumberSystem
3653 - * @see weekNumberSystem()
3654 - * @param weekNumberSystem the Week Number System to use
3656 - void setWeekNumberSystem(Locale::WeekNumberSystem weekNumberSystem);
3660 - * Returns the type of Week Number System used in this Locale
3662 - * @see Klocale::WeekNumberSystem
3663 - * @see setWeekNumberSystem()
3664 - * @returns the Week Number System used
3666 - Locale::WeekNumberSystem weekNumberSystem() const;
3669 - * Converts a localized monetary string to a double.
3671 - * @param numStr the string we want to convert.
3672 - * @param ok the boolean that is set to false if it's not a number.
3673 - * If @p ok is 0, it will be ignored
3675 - * @return The string converted to a double
3677 - Q_INVOKABLE double readMoney(const QString &numStr) const;
3680 - * Converts a localized numeric string to a double.
3682 - * @param numStr the string we want to convert.
3683 - * @return The string converted to a double
3685 - Q_INVOKABLE double readNumber(const QString &numStr) const;
3688 - * Flags for readDate()
3690 - enum ReadDateFlags {
3691 - NormalFormat = 1, /**< Only accept a date string in
3692 - the locale LongDate format */
3693 - ShortFormat = 2, /**< Only accept a date string in
3694 - the locale ShortDate format */
3695 - IsoFormat = 4, /**< Only accept a date string in
3696 - ISO date format (YYYY-MM-DD) */
3697 - IsoWeekFormat = 8, /**< Only accept a date string in
3698 - ISO Week date format (YYYY-Www-D) */
3699 - IsoOrdinalFormat = 16 /**< Only accept a date string in
3700 - ISO Week date format (YYYY-DDD) */
3704 - * Converts a localized date string to a QDate.
3705 - * This method is stricter than readDate(str,&ok): it will only accept
3706 - * a date in a specific format, depending on @p flags.
3708 - * @param str the string we want to convert.
3709 - * @param flags what format the the date string will be in
3710 - * @return The string converted to a QDate
3711 - * @see CalendarSystem::readDate()
3713 - Q_INVOKABLE QDate readDate(const QString &str, ReadDateFlags flags) const;
3716 - * Converts a localized time string to a QTime.
3717 - * This method will try to parse it with seconds, then without seconds.
3719 - * @param str the string we want to convert.
3721 - * @return The string converted to a QTime
3723 - Q_INVOKABLE QTime readTime(const QString &str) const;
3726 - * Additional processing options for readLocaleTime().
3728 - * @remarks This is currently used as an enum but declared as a flag
3729 - * to be extensible
3731 - enum TimeProcessingOption {
3732 - ProcessStrict = 0x1, ///< Process time in a strict manner, ie.
3733 - ///< a read time string has to exactly match
3734 - ///< the defined time format.
3735 - ProcessNonStrict = 0x2 ///< Process time in a lax manner, ie.
3736 - ///< allow spaces in the time-format to be
3737 - ///< left out when entering a time string.
3740 - Q_DECLARE_FLAGS(TimeProcessingOptions, TimeProcessingOption)
3744 - * Converts a localized time string to a QTime.
3745 - * This method is stricter than readTime(str, &ok) in that it will either
3746 - * accept a time with seconds or a time without seconds.
3748 - * @param str the string we want to convert
3749 - * @param ok the boolean that is set to false if it's not a valid time.
3750 - * If @p ok is 0, it will be ignored.
3751 - * @param options format option to apply when formatting the time
3752 - * @param processing if set to @c ProcessStrict, checking will be strict
3753 - * and the read time string has to have the exact time format
3754 - * specified. If set to @c ProcessNonStrict processing the time
3755 - * is lax and spaces in the time string can be left out.
3757 - * @return The string converted to a QTime
3760 - Q_INVOKABLE QTime readLocaleTime(const QString &str,
3761 - TimeFormatOptions options = Locale::TimeDefault,
3762 - TimeProcessingOptions processing = ProcessNonStrict) const;
3765 - * Returns the language code used by this object. The domain AND the
3766 - * library translation must be available in this language.
3767 - * defaultLanguage() is returned by default, if no other available.
3769 - * Use languageCodeToName(language) to get human readable, localized
3772 - * @return the currently used language code
3774 - * @see languageCodeToName
3776 - QString language() const;
3779 - * Returns the country code of the country where the user lives.
3781 - * The returned code complies with the ISO 3166-1 alpha-2 standard,
3782 - * except by KDE convention it is returned in lowercase whereas the
3783 - * official standard is uppercase.
3784 - * See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for details.
3786 - * defaultCountry() is returned by default, if no other available,
3787 - * this will always be uppercase 'C'.
3789 - * Use countryCodeToName(country) to get human readable, localized
3792 - * @return the country code for the user
3794 - * @see countryCodeToName
3796 - QString country() const;
3800 - * Returns the Country Division Code of the Country where the user lives.
3801 - * When no value is set, then the Country Code will be returned.
3803 - * The returned code complies with the ISO 3166-2 standard.
3804 - * See http://en.wikipedia.org/wiki/ISO_3166-2 for details.
3806 - * Note that unlike country() this method will return the correct case,
3807 - * i.e. normally uppercase..
3809 - * In KDE 4.6 it is the apps responsibility to obtain a translation for the
3810 - * code, translation and other services will be priovided in KDE 4.7.
3812 - * @return the Country Division Code for the user
3813 - * @see setCountryDivisionCode
3815 - QString countryDivisionCode() const;
3818 - * Returns the language codes selected by user, ordered by decreasing
3821 - * Use languageCodeToName(language) to get human readable, localized
3824 - * @return list of language codes
3826 - * @see languageCodeToName
3828 - QStringList languageList() const;
3832 - * Returns the ISO Currency Codes used in the locale, ordered by decreasing
3835 - * Use KCurrency::currencyCodeToName(currencyCode) to get human readable,
3836 - * localized language name.
3838 - * @return list of ISO Currency Codes
3840 - * @see currencyCodeToName
3842 - QStringList currencyCodeList() const;
3845 - * Returns the file encoding.
3847 - * @return The Mib of the file encoding
3849 - * @see QFile::encodeName
3850 - * @see QFile::decodeName
3852 - int fileEncodingMib() const;
3855 - * Changes the current date format.
3857 - * The format of the date is a string which contains variables that will
3859 - * @li %Y with the whole year (e.g. "2004" for "2004")
3860 - * @li %y with the lower 2 digits of the year (e.g. "04" for "2004")
3861 - * @li %n with the month (January="1", December="12")
3862 - * @li %m with the month with two digits (January="01", December="12")
3863 - * @li %e with the day of the month (e.g. "1" on the first of march)
3864 - * @li %d with the day of the month with two digits (e.g. "01" on the first of march)
3865 - * @li %b with the short form of the month (e.g. "Jan" for January)
3866 - * @li %B with the long form of the month (e.g. "January")
3867 - * @li %a with the short form of the weekday (e.g. "Wed" for Wednesday)
3868 - * @li %A with the long form of the weekday (e.g. "Wednesday" for Wednesday)
3870 - * Everything else in the format string will be taken as is.
3871 - * For example, March 20th 1989 with the format "%y:%m:%d" results
3874 - * @param format The new date format
3876 - void setDateFormat(const QString & format);
3879 - * Changes the current short date format.
3881 - * The format of the date is a string which contains variables that will
3883 - * @li %Y with the whole year (e.g. "1984" for "1984")
3884 - * @li %y with the lower 2 digits of the year (e.g. "84" for "1984")
3885 - * @li %n with the month (January="1", December="12")
3886 - * @li %m with the month with two digits (January="01", December="12")
3887 - * @li %e with the day of the month (e.g. "1" on the first of march)
3888 - * @li %d with the day of the month with two digits(e.g. "01" on the first of march)
3889 - * @li %b with the short form of the month (e.g. "Jan" for January)
3890 - * @li %B with the long form of the month (e.g. "January")
3891 - * @li %a with the short form of the weekday (e.g. "Wed" for Wednesday)
3892 - * @li %A with the long form of the weekday (e.g. "Wednesday" for Wednesday)
3894 - * Everything else in the format string will be taken as is.
3895 - * For example, March 20th 1989 with the format "%y:%m:%d" results
3898 - * @param format The new short date format
3900 - void setDateFormatShort(const QString & format);
3903 - * Changes the form of month name used in dates.
3905 - * @param possessive True if possessive forms should be used
3907 - void setDateMonthNamePossessive(bool possessive);
3910 - * Changes the current time format.
3912 - * The format of the time is string a which contains variables that will
3914 - * @li %H with the hour in 24h format and 2 digits (e.g. 5pm is "17", 5am is "05")
3915 - * @li %k with the hour in 24h format and one digits (e.g. 5pm is "17", 5am is "5")
3916 - * @li %I with the hour in 12h format and 2 digits (e.g. 5pm is "05", 5am is "05")
3917 - * @li %l with the hour in 12h format and one digits (e.g. 5pm is "5", 5am is "5")
3918 - * @li %M with the minute with 2 digits (e.g. the minute of 07:02:09 is "02")
3919 - * @li %S with the seconds with 2 digits (e.g. the minute of 07:02:09 is "09")
3920 - * @li %p with pm or am (e.g. 17.00 is "pm", 05.00 is "am")
3922 - * Everything else in the format string will be taken as is.
3923 - * For example, 5.23pm with the format "%H:%M" results
3926 - * @param format The new time format
3928 - void setTimeFormat(const QString & format);
3932 - * Set digit characters used to display dates and time.
3934 - * @param digitSet the digit set identifier
3937 - void setDateTimeDigitSet(DigitSet digitSet);
3940 - * Changes how KLocale defines the first day in week.
3942 - * @param day first day of the week (Monday=1..Sunday=7) as integer
3944 - void setWeekStartDay(int day);
3947 - * Changes how KLocale defines the first working day in week.
3949 - * @param day first working day of the week (Monday=1..Sunday=7) as integer
3951 - void setWorkingWeekStartDay(int day);
3954 - * Changes how KLocale defines the last working day in week.
3956 - * @param day last working day of the week (Monday=1..Sunday=7) as integer
3958 - void setWorkingWeekEndDay(int day);
3961 - * Changes how KLocale defines the day reserved for religious observance.
3963 - * @param day day of the week for religious observance (None=0,Monday=1..Sunday=7) as integer
3965 - void setWeekDayOfPray(int day);
3968 - * Returns the currently selected date format.
3970 - * @return Current date format.
3971 - * @see setDateFormat()
3973 - QString dateFormat() const;
3976 - * Returns the currently selected short date format.
3978 - * @return Current short date format.
3979 - * @see setDateFormatShort()
3981 - QString dateFormatShort() const;
3984 - * Returns the currently selected time format.
3986 - * @return Current time format.
3987 - * @see setTimeFormat()
3989 - QString timeFormat() const;
3992 - * Changes the symbol used to identify the decimal pointer.
3994 - * @param symbol The new decimal symbol.
3996 - void setDecimalSymbol(const QString & symbol);
3999 - * Changes the separator used to group digits when formating numbers.
4001 - * @param separator The new thousands separator.
4003 - void setThousandsSeparator(const QString & separator);
4006 - * Changes the sign used to identify a positive number. Normally this is
4009 - * @param sign Sign used for positive numbers.
4011 - void setPositiveSign(const QString & sign);
4014 - * Changes the sign used to identify a negative number.
4016 - * @param sign Sign used for negative numbers.
4018 - void setNegativeSign(const QString & sign);
4022 - * Changes the set of digit characters used to display numbers.
4024 - * @param digitSet the digit set identifier
4027 - void setDigitSet(DigitSet digitSet);
4030 - * Changes the sign position used for positive monetary values.
4032 - * @param signpos The new sign position
4034 - void setPositiveMonetarySignPosition(SignPosition signpos);
4037 - * Changes the sign position used for negative monetary values.
4039 - * @param signpos The new sign position
4041 - void setNegativeMonetarySignPosition(SignPosition signpos);
4044 - * Changes the position where the currency symbol should be printed for
4045 - * positive monetary values.
4047 - * @param prefix True if the currency symbol should be prefixed instead of
4050 - void setPositivePrefixCurrencySymbol(bool prefix);
4053 - * Changes the position where the currency symbol should be printed for
4054 - * negative monetary values.
4056 - * @param prefix True if the currency symbol should be prefixed instead of
4059 - void setNegativePrefixCurrencySymbol(bool prefix);
4063 - * Changes the number of decimal places used when formating numbers.
4065 - * @param digits The default number of digits to use.
4067 - void setDecimalPlaces(int digits);
4071 - * Changes the number of decimal places used when formating money.
4073 - * @param digits The default number of digits to use.
4075 - void setMonetaryDecimalPlaces(int digits);
4078 - * Changes the separator used to group digits when formating monetary values.
4080 - * @param separator The new thousands separator.
4082 - void setMonetaryThousandsSeparator(const QString & separator);
4085 - * Changes the symbol used to identify the decimal pointer for monetary
4088 - * @param symbol The new decimal symbol.
4090 - void setMonetaryDecimalSymbol(const QString & symbol);
4094 - * Changes the current ISO Currency Code.
4096 - * @param newCurrencyCode The new Currency Code
4098 - void setCurrencyCode(const QString &newCurrencyCode);
4101 - * Changes the current currency symbol.
4103 - * This symbol should be consistant with the selected Currency Code
4105 - * @param symbol The new currency symbol
4106 - * @see currencyCode, KCurrency::currencySymbols
4108 - void setCurrencySymbol(const QString & symbol);
4112 - * Set digit characters used to display monetary values.
4114 - * @param digitSet the digit set identifier
4117 - void setMonetaryDigitSet(DigitSet digitSet);
4120 - * Returns the preferred page size for printing.
4122 - * @return The preferred page size, cast it to QPrinter::PageSize
4124 - int pageSize() const;
4127 - * Changes the preferred page size when printing.
4129 - * @param paperFormat the new preferred page size in the format QPrinter::PageSize
4131 - void setPageSize(int paperFormat);
4134 - * The Metric system will give you information in mm, while the
4135 - * Imperial system will give you information in inches.
4137 - enum MeasureSystem {
4138 - Metric, ///< Metric system (used e.g. in Europe)
4139 - Imperial ///< Imperial system (used e.g. in the United States)
4143 - * Returns which measuring system we use.
4145 - * @return The preferred measuring system
4147 - MeasureSystem measureSystem() const;
4150 - * Changes the preferred measuring system.
4152 - * @return value The preferred measuring system
4154 - void setMeasureSystem(MeasureSystem value);
4157 - * Translates a message as a QTranslator is supposed to.
4158 - * The parameters are similar to i18n(), but the result
4159 - * value has other semantics (it can be QString())
4161 - Q_INVOKABLE QString translateQt(const char *context, const char *sourceText, const char *comment) const;
4164 - * Provides list of all known language codes.
4166 - * Use languageCodeToName(language) to get human readable, localized
4169 - * @return list of all language codes
4171 - * @see languageCodeToName
4172 - * @see installedLanguages
4174 - QStringList allLanguagesList() const;
4178 - * Provides list of all installed KDE Language Translations.
4180 - * Use languageCodeToName(language) to get human readable, localized
4183 - * @return list of all installed language codes
4185 - * @see languageCodeToName
4187 - QStringList installedLanguages() const;
4190 - * Convert a known language code to a human readable, localized form.
4191 - * If an unknown language code is supplied, empty string is returned;
4192 - * this will never happen if the code has been obtained by one of the
4193 - * KLocale methods.
4195 - * @param language the language code
4197 - * @return the human readable and localized form if the code is known,
4201 - * @see languageList
4202 - * @see allLanguagesList
4203 - * @see installedLanguages
4205 - Q_INVOKABLE QString languageCodeToName(const QString &language) const;
4208 - * Provides list of all known country codes.
4210 - * Use countryCodeToName(country) to get human readable, localized
4213 - * @return a list of all country codes
4215 - * @see countryCodeToName
4217 - QStringList allCountriesList() const;
4220 - * Convert a known country code to a human readable, localized form.
4222 - * If an unknown country code is supplied, empty string is returned;
4223 - * this will never happen if the code has been obtained by one of the
4224 - * KLocale methods.
4226 - * @param country the country code
4228 - * @return the human readable and localized form of the country name
4231 - * @see allCountriesList
4233 - Q_INVOKABLE QString countryCodeToName(const QString &country) const;
4236 - * Parses locale string into distinct parts.
4237 - * The format of locale is language_COUNTRY@modifier.CHARSET
4239 - * @param locale the locale string to split
4240 - * @param language set to the language part of the locale
4241 - * @param country set to the country part of the locale
4242 - * @param modifier set to the modifer part of the locale
4243 - * @param charset set to the charset part of the locale
4245 - Q_INVOKABLE void splitLocale(const QString &locale, QString &language, QString &country,
4246 - QString &modifier, QString &charset);
4249 - * Returns the name of the internal language.
4251 - * @return Name of the default language
4253 - QString defaultLanguage();
4256 - * Returns the code of the default country, i.e. "C"
4258 - * This function will not provide a sensible value to use in your app,
4259 - * please use country() instead.
4263 - * @return Name of the default country
4265 - QString defaultCountry();
4269 - * Returns the ISO Code of the default currency.
4271 - * @return ISO Currency Code of the default currency
4273 - QString defaultCurrencyCode();
4276 - * Reports whether evaluation of translation scripts is enabled.
4278 - * @return true if script evaluation is enabled, false otherwise.
4280 - bool useTranscript() const;
4283 - * Checks whether or not the active catalog is found for the given language.
4285 - * @param language language to check
4287 - Q_INVOKABLE bool isApplicationTranslatedInto(const QString & language);
4291 - * Sets the Country Division Code of the Country where the user lives.
4293 - * The code must comply with the ISO 3166-2 standard.
4294 - * See http://en.wikipedia.org/wiki/ISO_3166-2 for details.
4296 - * In KDE 4.6 it is the apps responsibility to validate the input,
4297 - * full validation and other services will be provided in KDE 4.7.
4299 - * @param countryDivision the Country Division Code for the user
4300 - * @return @c true on success, @c false on failure
4301 - * @see countryDivisionCode
4303 - bool setCountryDivisionCode(const QString & countryDivision);
4307 - * Removes accelerator marker from a UI text label.
4309 - * Accelerator marker is not always a plain ampersand (&),
4310 - * so it is not enough to just remove it by @c QString::remove().
4311 - * The label may contain escaped markers ("&&") which must be resolved
4312 - * and skipped, as well as CJK-style markers ("Foo (&F)") where
4313 - * the whole parenthesis construct should be removed.
4314 - * Therefore always use this function to remove accelerator marker
4317 - * @param label UI label which may contain an accelerator marker
4318 - * @return label without the accelerator marker
4320 - Q_INVOKABLE QString removeAcceleratorMarker(const QString &label) const;
4324 - * Convert all digits in the string to the given digit set.
4326 - * Conversion is normally not performed if the given digit set
4327 - * is not appropriate in the current locale and language context.
4328 - * Unconditional conversion may be requested by setting
4329 - * @p ignoreContext to @c true.
4331 - * @param str the string to convert
4332 - * @param digitSet the digit set identifier
4333 - * @param ignoreContext unconditional conversion if @c true
4335 - * @return string with converted digits
4339 - Q_INVOKABLE QString convertDigits(const QString &str, DigitSet digitSet,
4340 - bool ignoreContext = false) const;
4344 - * Reparse locale configuration files for the current selected
4347 - Q_INVOKABLE void reparseConfiguration();
4350 - KLocale *m_locale;
4353 - void binaryUnitDialectChanged();
4354 - void calendarSystemChanged();
4355 - void countryDivisionCodeChanged();
4356 - void currencyCodeChanged();
4357 - void decimalSymbolChanged();
4358 - void currencySymbolChanged();
4359 - void dateFormatChanged();
4360 - void dateFormatShortChanged();
4361 - void dateMonthNamePossessiveChanged();
4362 - void dateTimeDigitSetChanged();
4363 - void decimalPlacesChanged();
4364 - void digitSetChanged();
4365 - void measureSystemChanged();
4366 - void monetaryDecimalPlacesChanged();
4367 - void monetaryDecimalSymbolChanged();
4368 - void monetaryDigitSetChanged();
4369 - void monetaryThousandsSeparatorChanged();
4370 - void negativeMonetarySignPositionChanged();
4371 - void negativePrefixCurrencySymbolChanged();
4372 - void negativeSignChanged();
4373 - void pageSizeChanged();
4374 - void positiveMonetarySignPositionChanged();
4375 - void positivePrefixCurrencySymbolChanged();
4376 - void positiveSignChanged();
4377 - void thousandsSeparatorChanged();
4378 - void timeFormatChanged();
4379 - void weekDayOfPrayChanged();
4380 - void WeekNumberSystemChanged();
4381 - void weekStartDayChanged();
4382 - void workingWeekEndDayChanged();
4383 - void workingWeekStartDayChanged();