2012-01-14 06:58:53 +01:00
|
|
|
/* This file is part of the KDE libraries
|
|
|
|
Copyright (C) 2012 Giorgos Tsiapaliwkas <terietor@gmail.com>
|
|
|
|
Copyright (C) 2012 Antonis Tsiapaliokas <kok3rs@gmail.com>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
|
|
along with this library; see the file COPYING.LIB. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2012-01-19 21:16:14 +01:00
|
|
|
#include "locale.h"
|
|
|
|
#include <KGlobal>
|
2012-01-24 20:02:33 +01:00
|
|
|
#include <QTime>
|
|
|
|
#include <QDate>
|
2012-01-14 06:58:53 +01:00
|
|
|
|
2012-01-19 21:16:14 +01:00
|
|
|
Locale::Locale(QObject* parent)
|
|
|
|
: QObject(parent)
|
2012-01-14 06:58:53 +01:00
|
|
|
{
|
2012-01-23 20:43:42 +01:00
|
|
|
m_locale = new KLocale(*KGlobal::locale());
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::setCountryDivisionCode(const QString &countryDivisionCode)
|
|
|
|
{
|
2012-01-15 08:38:34 +01:00
|
|
|
emit countryDivisionCodeChanged();
|
2012-01-23 20:16:14 +01:00
|
|
|
return m_locale->setCountryDivisionCode(countryDivisionCode);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setCurrencyCode(const QString &newCurrencyCode)
|
|
|
|
{
|
2012-01-15 08:38:34 +01:00
|
|
|
emit currencyCodeChanged();
|
2012-01-23 20:16:14 +01:00
|
|
|
m_locale->setCurrencyCode(newCurrencyCode);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::isApplicationTranslatedInto(const QString &lang)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->isApplicationTranslatedInto(lang);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::splitLocale(const QString &locale, QString &language, QString &country, QString &modifier,
|
|
|
|
QString &charset)
|
|
|
|
{
|
2012-01-15 08:38:34 +01:00
|
|
|
Locale::splitLocale(locale, language, country, modifier, charset);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::language() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->language();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::country() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->country();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::countryDivisionCode() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->countryDivisionCode();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::currencyCode() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->currencyCode();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setActiveCatalog(const QString &catalog)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setActiveCatalog(catalog);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::translateQt(const char *context, const char *sourceText, const char *comment) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->translateQt(context, sourceText, comment);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
2012-03-19 12:32:21 +01:00
|
|
|
QList<int> Locale::allDigitSetsList() const
|
2012-01-14 06:58:53 +01:00
|
|
|
{
|
2012-03-19 12:32:21 +01:00
|
|
|
QList<int> digitList;
|
2012-01-31 12:09:22 +01:00
|
|
|
|
|
|
|
foreach(KLocale::DigitSet digit, m_locale->allDigitSetsList()) {
|
2012-03-19 12:32:21 +01:00
|
|
|
digitList.append((int)digit);
|
2012-01-31 12:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return digitList;
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::digitSetToName(Locale::DigitSet digitSet, bool withDigits) const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->digitSetToName((KLocale::DigitSet)digitSet, withDigits);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::convertDigits(const QString &str, DigitSet digitSet, bool ignoreContext) const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->convertDigits(str, (KLocale::DigitSet)digitSet, ignoreContext);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::dateMonthNamePossessive() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->dateMonthNamePossessive();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::weekStartDay() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->weekStartDay();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::workingWeekStartDay() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->workingWeekStartDay();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::workingWeekEndDay() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->workingWeekEndDay();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::weekDayOfPray() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->weekDayOfPray();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::decimalPlaces() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->decimalPlaces();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::decimalSymbol() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->decimalSymbol();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::thousandsSeparator() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->thousandsSeparator();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::currencySymbol() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->currencySymbol();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::monetaryDecimalSymbol() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->monetaryDecimalSymbol();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::monetaryThousandsSeparator() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->monetaryThousandsSeparator();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::positiveSign() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->positiveSign();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::negativeSign() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->negativeSign();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::monetaryDecimalPlaces() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->monetaryDecimalPlaces();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::positivePrefixCurrencySymbol() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->positivePrefixCurrencySymbol();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::negativePrefixCurrencySymbol() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->negativePrefixCurrencySymbol();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::SignPosition Locale::positiveMonetarySignPosition() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::SignPosition)m_locale->positiveMonetarySignPosition();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::SignPosition Locale::negativeMonetarySignPosition() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::SignPosition)m_locale->negativeMonetarySignPosition();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatMoney(double num, const QString &symbol, int precision) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->formatMoney(num, symbol, precision);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatNumber(double num, int precision) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->formatNumber(num, precision);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatLong(long num) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->formatLong(num);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatNumber(const QString &numStr, bool round, int precision) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->formatNumber(numStr, round, precision);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatByteSize(double size, int precision, Locale::BinaryUnitDialect dialect,
|
|
|
|
Locale::BinarySizeUnits specificUnit) const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->formatByteSize(size, precision, (KLocale::BinaryUnitDialect)dialect, (KLocale::BinarySizeUnits)specificUnit);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatByteSize(double size) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->formatByteSize(size);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::BinaryUnitDialect Locale::binaryUnitDialect() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::BinaryUnitDialect)m_locale->binaryUnitDialect();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setBinaryUnitDialect(Locale::BinaryUnitDialect newDialect)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setBinaryUnitDialect((KLocale::BinaryUnitDialect)newDialect);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit binaryUnitDialectChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatDuration(unsigned long mSec) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->formatDuration(mSec);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::prettyFormatDuration(unsigned long mSec) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->prettyFormatDuration(mSec);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatDate(const QDate &date, Locale::DateFormat format) const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->formatDate(date, (KLocale::DateFormat)format);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setMainCatalog(const char *catalog)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
KLocale::setMainCatalog(catalog);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
double Locale::readNumber(const QString &_str, bool * ok) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->readNumber(_str, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
double Locale::readMoney(const QString &_str, bool *ok) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->readMoney(_str, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QDate Locale::readDate(const QString &intstr, bool *ok) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->readDate(intstr, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QDate Locale::readDate(const QString &intstr, ReadDateFlags flags, bool *ok) const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->readDate(intstr, (KLocale::ReadDateFlags)flags, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QDate Locale::readDate(const QString &intstr, const QString &fmt, bool *ok) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->readDate(intstr, fmt, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QTime Locale::readTime(const QString &intstr, bool *ok) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->readTime(intstr, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QTime Locale::readLocaleTime(const QString &intstr, bool *ok, TimeFormatOptions options,
|
|
|
|
TimeProcessingOptions processing) const
|
|
|
|
{
|
2012-02-10 15:04:57 +01:00
|
|
|
Q_UNUSED(options)
|
|
|
|
Q_UNUSED(processing)
|
|
|
|
return m_locale->readLocaleTime(intstr, ok);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatLocaleTime(const QTime &time, TimeFormatOptions options) const
|
|
|
|
{
|
2012-02-10 15:04:57 +01:00
|
|
|
Q_UNUSED(options)
|
|
|
|
return m_locale->formatLocaleTime(time);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::use12Clock() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->use12Clock();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
2012-01-16 18:58:35 +01:00
|
|
|
QString Locale::dayPeriodText(const QTime &time, DateTimeComponentFormat format) const
|
2012-01-14 06:58:53 +01:00
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->dayPeriodText(time, (KLocale::DateTimeComponentFormat)format);
|
2012-01-16 18:58:35 +01:00
|
|
|
}
|
2012-01-14 06:58:53 +01:00
|
|
|
|
|
|
|
QStringList Locale::languageList() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->languageList();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QStringList Locale::currencyCodeList() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->currencyCodeList();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatDateTime(const QDateTime &dateTime, Locale::DateFormat format, bool includeSeconds) const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return m_locale->formatDateTime(dateTime, (KLocale::DateFormat)format, (KLocale::DateFormat)includeSeconds);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::formatDateTime(const KDateTime &dateTime, Locale::DateFormat format, DateTimeFormatOptions options) const
|
|
|
|
{
|
2012-02-10 15:04:57 +01:00
|
|
|
Q_UNUSED(format)
|
|
|
|
Q_UNUSED(options)
|
|
|
|
return m_locale->formatDateTime(dateTime);
|
2012-01-16 18:58:35 +01:00
|
|
|
}
|
2012-01-15 08:44:24 +01:00
|
|
|
|
2012-01-14 06:58:53 +01:00
|
|
|
void Locale::setDateFormat(const QString &format)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setDateFormat(format);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit dateFormatChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setDateFormatShort(const QString &format)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setDateFormatShort(format);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit dateFormatShortChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setDateMonthNamePossessive(bool possessive)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setDateMonthNamePossessive(possessive);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit dateMonthNamePossessiveChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setTimeFormat(const QString &format)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setTimeFormat(format);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit timeFormatChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setWeekStartDay(int day)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setWeekStartDay(day);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit weekStartDayChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setWorkingWeekStartDay(int day)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setWorkingWeekStartDay(day);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit workingWeekStartDayChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setWorkingWeekEndDay(int day)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setWorkingWeekEndDay(day);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit workingWeekEndDayChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setWeekDayOfPray(int day)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setWeekDayOfPray(day);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit weekDayOfPrayChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::dateFormat() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->dateFormat();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::dateFormatShort() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->dateFormatShort();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::timeFormat() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->timeFormat();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setDecimalPlaces(int digits)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setDecimalPlaces(digits);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit decimalPlacesChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setDecimalSymbol(const QString &symbol)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setDecimalSymbol(symbol);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit decimalSymbolChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setThousandsSeparator(const QString &separator)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setThousandsSeparator(separator);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit thousandsSeparatorChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setPositiveSign(const QString &sign)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setPositiveSign(sign);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit positiveSignChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setNegativeSign(const QString &sign)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setNegativeSign(sign);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit negativeSignChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setPositiveMonetarySignPosition(Locale::SignPosition signpos)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setPositiveMonetarySignPosition((KLocale::SignPosition)signpos);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit positiveMonetarySignPositionChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setNegativeMonetarySignPosition(Locale::SignPosition signpos)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setNegativeMonetarySignPosition((KLocale::SignPosition)signpos);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit negativeMonetarySignPositionChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setPositivePrefixCurrencySymbol(bool prefix)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setPositivePrefixCurrencySymbol(prefix);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit positivePrefixCurrencySymbolChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setNegativePrefixCurrencySymbol(bool prefix)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setNegativePrefixCurrencySymbol(prefix);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit negativePrefixCurrencySymbolChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setMonetaryDecimalPlaces(int digits)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setMonetaryDecimalPlaces(digits);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit monetaryDecimalPlacesChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setMonetaryThousandsSeparator(const QString &separator)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setMonetaryThousandsSeparator(separator);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit monetaryThousandsSeparatorChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setMonetaryDecimalSymbol(const QString &symbol)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setMonetaryDecimalSymbol(symbol);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit monetaryDecimalSymbolChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setCurrencySymbol(const QString & symbol)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setCurrencySymbol(symbol);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit currencySymbolChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::pageSize() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->pageSize();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setPageSize(int size)
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->setPageSize(size);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit pageSizeChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::MeasureSystem Locale::measureSystem() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::MeasureSystem)m_locale->measureSystem();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setMeasureSystem(Locale::MeasureSystem value)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setMeasureSystem((KLocale::MeasureSystem)value);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit measureSystemChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::defaultLanguage()
|
|
|
|
{
|
2012-02-26 16:04:04 +01:00
|
|
|
return KLocale::defaultLanguage();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::defaultCountry()
|
|
|
|
{
|
2012-02-26 16:04:04 +01:00
|
|
|
return KLocale::defaultCountry();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::defaultCurrencyCode()
|
|
|
|
{
|
2012-02-26 16:04:04 +01:00
|
|
|
return KLocale::defaultCurrencyCode();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Locale::useTranscript() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->useTranscript();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Locale::fileEncodingMib() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->fileEncodingMib();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QStringList Locale::allLanguagesList() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->allLanguagesList();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QStringList Locale::installedLanguages() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->installedLanguages();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::languageCodeToName(const QString &language) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->languageCodeToName(language);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QStringList Locale::allCountriesList() const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->allCountriesList();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::countryCodeToName(const QString &country) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->countryCodeToName(country);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setCalendarSystem(Locale::CalendarSystem calendarSystem)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setCalendarSystem((KLocale::CalendarSystem)calendarSystem);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit calendarSystemChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::CalendarSystem Locale::calendarSystem() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::CalendarSystem)m_locale->calendarSystem();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setWeekNumberSystem(Locale::WeekNumberSystem weekNumberSystem)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setWeekNumberSystem((KLocale::WeekNumberSystem)weekNumberSystem);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit WeekNumberSystemChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::WeekNumberSystem Locale::weekNumberSystem()
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::WeekNumberSystem)m_locale->weekNumberSystem();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::WeekNumberSystem Locale::weekNumberSystem() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::WeekNumberSystem)m_locale->weekNumberSystem();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Locale::removeAcceleratorMarker(const QString &label) const
|
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
return m_locale->removeAcceleratorMarker(label);
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setDigitSet(Locale::DigitSet digitSet)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setDigitSet((KLocale::DigitSet)digitSet);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit digitSetChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::DigitSet Locale::digitSet() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::DigitSet)m_locale->digitSet();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setMonetaryDigitSet(Locale::DigitSet digitSet)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setMonetaryDigitSet((KLocale::DigitSet)digitSet);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit monetaryDigitSetChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::DigitSet Locale::monetaryDigitSet() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::DigitSet)m_locale->monetaryDigitSet();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Locale::setDateTimeDigitSet(Locale::DigitSet digitSet)
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
m_locale->setDateTimeDigitSet((KLocale::DigitSet)digitSet);
|
2012-01-15 08:38:34 +01:00
|
|
|
emit dateTimeDigitSetChanged();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Locale::DigitSet Locale::dateTimeDigitSet() const
|
|
|
|
{
|
2012-01-24 20:02:33 +01:00
|
|
|
return (Locale::DigitSet)m_locale->dateTimeDigitSet();
|
2012-01-14 06:58:53 +01:00
|
|
|
}
|
|
|
|
|
2012-01-16 18:58:35 +01:00
|
|
|
void Locale::reparseConfiguration()
|
2012-01-14 06:58:53 +01:00
|
|
|
{
|
2012-01-19 21:16:14 +01:00
|
|
|
m_locale->reparseConfiguration();
|
2012-01-16 18:58:35 +01:00
|
|
|
}
|