• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • localization
klocale.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Stephan Kulow <coolo@kde.org>
3 Copyright (C) 1999-2003 Hans Petter Bieker <bieker@kde.org>
4 Copyright (c) 2002 Lukas Tinkl <lukas@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21#ifndef KLOCALE_H
22#define KLOCALE_H
23
24#include <kdecore_export.h>
25#include <klocalizedstring.h>
26#include <ksharedconfig.h>
27
28#include <QtCore/QString>
29#include <QtCore/QList>
30
31class QStringList;
32class QTextCodec;
33class QDate;
34class QTime;
35class QDateTime;
36
37class KDateTime;
38class KCalendarSystem;
39class KCurrencyCode;
40class KDayPeriod;
41
42class KLocalePrivate;
43
47
69class KDECORE_EXPORT KLocale
70{
71public:
95 explicit KLocale(const QString& catalog, KSharedConfig::Ptr config = KSharedConfig::Ptr());
96
114 KLocale(const QString& catalog, const QString &language, const QString &country = QString(),
115 KConfig *config = 0);
116
120 KLocale(const KLocale & rhs);
121
125 KLocale& operator= (const KLocale & rhs);
126
130 virtual ~KLocale();
131
153 void translateRawFrom(const char* catname, const char* msg, QString *lang, QString *trans) const;
154
160 void translateRaw(const char* msg, QString *lang, QString *trans) const;
161
185 void translateRawFrom(const char *catname, const char *ctxt, const char *msg, QString *lang, QString *trans) const;
186
192 void translateRaw(const char *ctxt, const char *msg, QString *lang, QString *trans) const;
193
219 void translateRawFrom(const char *catname, const char *singular, const char *plural, unsigned long n,
220 QString *lang, QString *trans) const;
221
227 void translateRaw(const char *singular, const char *plural, unsigned long n, QString *lang,
228 QString *trans) const;
229
257 void translateRawFrom(const char *catname, const char *ctxt, const char *singular, const char *plural,
258 unsigned long n, QString *lang, QString *trans) const;
259
265 void translateRaw(const char *ctxt, const char *singular, const char *plural, unsigned long n,
266 QString *lang, QString *trans) const;
267
275 bool setEncoding(int mibEnum);
276
281 enum SignPosition {
285 ParensAround = 0,
289 BeforeQuantityMoney = 1,
293 AfterQuantityMoney = 2,
297 BeforeMoney = 3,
301 AfterMoney = 4
302 };
303
309 enum DigitSet {
310 ArabicDigits,
312 ArabicIndicDigits,
313 EasternArabicIndicDigits,
314 DevenagariDigits,
315 BengaliDigits,
316 GujaratiDigits,
317 GurmukhiDigits,
318 KannadaDigits,
319 KhmerDigits,
320 MalayalamDigits,
321 OriyaDigits,
322 TamilDigits,
323 TeluguDigits,
324 ThaiDigits
325 // The following Decimal Digit Sets are defined in Unicode but the associated
326 // languages are not yet translated in KDE, so are not yet enabled.
327 // The script names are taken from the Unicode standard, the associated
328 // languages from Wikipedia.
329 // BalineseDigits, /**< ᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙ (Balinese) */
330 // ChamDigits, /**< ꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙ (Cham) */
331 // JavaneseDigits, /**< ꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙ (Javanese) */
332 // KayahLiDigits, /**< ꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉ (Kayah) */
333 // LaoDigits, /**< ໐໑໒໓໔໕໖໗໘໙ (Lao) */
334 // LepchaDigits, /**< ᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉ (Lepcha) */
335 // LimbuDigits, /**< ᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏ (Limbu) */
336 // MeeteiMayekDigits, /**< ꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹ (Meitei) */
337 // MongolianDigits, /**< ᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙ (Mongolian) */
338 // MyanmarDigits, /**< ၀၁၂၃၄၅၆၇၈၉ (Myanmar/Burmese ) */
339 // MyanmarShanDigits, /**< ႐႑႒႓႔႕႖႗႘႙ (Shan) */
340 // NewTaiLueDigits, /**< ᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙ (Tai Lü) */
341 // NKoDigits, /**< ߀߁߂߃߄߅߆߇߈߉ (Mande and N'Ko) */
342 // OlChikiDigits, /**< ᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙ (Santali) */
343 // OsmanyaDigits, /**< ҠҡҢңҤҥҦҧҨҩ (Somali) */
344 // SaurashtraDigits, /**< ꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙ (Saurashtra) */
345 // SundaneseDigits, /**< ᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹ (Sundanese) */
346 // TaiThamDigits, /**< ᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙ (Tai Lü) */
347 // TibetanDigits, /**< ༠༡༢༣༤༥༦༧༨༩ (Tibetan) */
348 // VaiDigits, /**< ꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩ (Vai) */
349 };
350
363 QString digitSetToName(DigitSet digitSet, bool withDigits = false) const;
364
374 QList<DigitSet> allDigitSetsList() const;
375
382 QString decimalSymbol() const;
383
391 QString thousandsSeparator() const;
392
402 DigitSet digitSet() const;
403
411 QString currencyCode() const;
412
420 KCurrencyCode *currency() const;
421
428 QString currencySymbol() const;
429
437 QString monetaryDecimalSymbol() const;
438
446 QString monetaryThousandsSeparator() const;
447
454 QString positiveSign() const;
455
462 QString negativeSign() const;
463
471 KDE_DEPRECATED int fracDigits() const;
472
480 int decimalPlaces() const;
481
489 int monetaryDecimalPlaces() const;
490
497 bool positivePrefixCurrencySymbol() const;
498
505 bool negativePrefixCurrencySymbol() const;
506
514 SignPosition positiveMonetarySignPosition() const;
515
523 SignPosition negativeMonetarySignPosition() const;
524
534 DigitSet monetaryDigitSet() const;
535
551 QString formatMoney(double num, const QString &currency = QString(), int precision = -1) const;
552
570 QString formatNumber(double num, int precision = -1) const;
571
586 QString formatNumber(const QString &numStr, bool round = true, int precision = -1) const;
587
598 QString formatLong(long num) const;
599
621 enum BinarySizeUnits {
623 DefaultBinaryUnits = -1,
624
625 // The first real unit must be 0 for the current implementation!
626 UnitByte,
627 UnitKiloByte,
628 UnitMegaByte,
629 UnitGigaByte,
630 UnitTeraByte,
631 UnitPetaByte,
632 UnitExaByte,
633 UnitZettaByte,
634 UnitYottaByte,
635 UnitLastUnit = UnitYottaByte
636 };
637
656 enum BinaryUnitDialect {
657 DefaultBinaryDialect = -1,
658 IECBinaryDialect,
659 JEDECBinaryDialect,
660 MetricBinaryDialect,
661 LastBinaryDialect = MetricBinaryDialect
662 };
663
677 QString formatByteSize(double size) const;
678
704 QString formatByteSize(double size, int precision,
705 BinaryUnitDialect dialect = KLocale::DefaultBinaryDialect,
706 BinarySizeUnits specificUnit = KLocale::DefaultBinaryUnits) const;
707
720 BinaryUnitDialect binaryUnitDialect() const;
721
730 void setBinaryUnitDialect(BinaryUnitDialect newDialect);
731
741 QString formatDuration(unsigned long mSec) const;
742
758 QString prettyFormatDuration(unsigned long mSec) const;
759
769 KDE_DEPRECATED bool nounDeclension() const;
770
771 //KDE5 move to KDateTime namespace
780 enum CalendarSystem {
781 QDateCalendar = 1,
782 //BahaiCalendar = 2, /**< Baha'i Calendar */
783 //BuddhistLunarCalendar = 3, /**< Buddhist Lunar Calendar*/
784 //ChineseCalendar = 4, /**< Chinese Calendar */
785 CopticCalendar = 5,
786 EthiopianCalendar = 6,
787 //EthiopianAmeteAlemCalendar = 7, /**< Ethiopian Amete Alem version, aka Ethiopic Amete Alem */
788 GregorianCalendar = 8,
789 HebrewCalendar = 9,
790 //HinduCalendar = 10, /**< Hindu Lunar Calendar */
791 //IslamicLunarCalendar = 11, /**< Islamic Lunar Calendar */
792 IslamicCivilCalendar = 12,
793 //IslamicUmAlQuraCalendar = 13, /**< Islamic Lunar Calendar, Um Al Qura varient used in Saudi Arabia */
794 IndianNationalCalendar = 14,
795 //Iso8601Calendar = 15, /**< ISO 8601 Standard Calendar */
796 JalaliCalendar = 16,
797 //JalaliBirashkCalendar = 17, /**< Jalali Calendar, Birashk Algorythm variant */
798 //Jalali33YearCalendar = 18, /**< Jalali Calendar, 33 Year cycle variant */
799 JapaneseCalendar= 19,
800 //JucheCalendar = 20, /**< Juche Calendar, used in North Korea */
801 JulianCalendar = 21,
802 MinguoCalendar= 22,
803 ThaiCalendar = 23
804 };
805
806 //KDE5 move to KDateTime namespace
815 enum WeekNumberSystem {
816 DefaultWeekNumber = -1,
817 IsoWeekNumber = 0,
818 FirstFullWeek = 1,
819 FirstPartialWeek = 2,
820 SimpleWeek = 3
821 };
822
823 //KDE5 move to KDateTime namespace
829 enum DateTimeFormatStandard {
830 KdeFormat,
831 PosixFormat,
832 UnicodeFormat
833 };
834
835 //KDE5 move to KDateTime namespace
841 enum DateTimeParseMode {
842 LiberalParsing
845 //ModerateParsing, /**< Parse Date/Time with modeate tolerance.
846 // The date components in the format must all
847 // occur in the input and in the same order,
848 // but the spacing and the componants themselves
849 // may vary from the strict format. */
850 //StrictParsing /**< Parse Date/Time strictly to the format. */
851 };
852
853 //KDE5 move to KDateTime namespace
865 enum DateTimeComponent {
866 Year = 0x1,
867 YearName = 0x2,
868 Month = 0x4,
869 MonthName = 0x8,
870 Day = 0x10,
871 DayName = 0x20,
872 JulianDay = 0x40,
873 EraName = 0x80,
874 EraYear = 0x100,
875 YearInEra = 0x200,
876 DayOfYear = 0x400,
877 DayOfYearName = 0x800,
878 DayOfWeek = 0x1000,
879 DayOfWeekName = 0x2000,
880 Week = 0x4000,
881 WeekYear = 0x8000,
882 MonthsInYear = 0x10000,
883 WeeksInYear = 0x20000,
884 DaysInYear = 0x40000,
885 DaysInMonth = 0x80000,
886 DaysInWeek = 0x100000,
887 Hour = 0x200000,
888 Minute = 0x400000,
889 Second = 0x800000,
890 Millisecond = 0x1000000,
891 DayPeriod = 0x2000000,
892 DayPeriodHour = 0x4000000,
893 Timezone = 0x8000000,
894 TimezoneName = 0x10000000,
895 UnixTime = 0x20000000
896 };
897 Q_DECLARE_FLAGS(DateTimeComponents, DateTimeComponent)
898
899 //KDE5 move to KDateTime namespace
908 enum DateTimeComponentFormat {
909 DefaultComponentFormat = -1,
910 ShortNumber = 0,
911 LongNumber,
912 //OrdinalNumber /**< Ordinal number format, e.g. "2nd" for the 2nd */
913 NarrowName = 3,
914 ShortName,
915 LongName
916 };
917
918 //KDE5 move to KDateTime namespace
922 enum DateFormat {
923 ShortDate,
924 LongDate,
925 FancyShortDate,
928 FancyLongDate,
931 IsoDate,
932 IsoWeekDate,
933 IsoOrdinalDate
934 };
935
936 //KDE5 move to KDateTime namespace
946 QString formatDate(const QDate &date, DateFormat format = LongDate) const;
947
948 //KDE5 move to KDateTime namespace
960 QString formatDateTime(const QDateTime &dateTime, DateFormat format = ShortDate,
961 bool includeSecs = false) const;
962
963 //KDE5 move to KDateTime namespace
967 enum DateTimeFormatOption {
968 TimeZone = 0x01,
969 Seconds = 0x02
970 };
971 Q_DECLARE_FLAGS(DateTimeFormatOptions, DateTimeFormatOption)
972
973 //KDE5 move to KDateTime namespace
984 QString formatDateTime(const KDateTime &dateTime, DateFormat format = ShortDate,
985 DateTimeFormatOptions options = 0) const;
986
993 bool dateMonthNamePossessive() const;
994
1009 QString formatTime(const QTime &pTime, bool includeSecs = false, bool isDuration = false) const;
1010
1011 //KDE5 move to KDateTime namespace
1017 enum TimeFormatOption {
1018 TimeDefault = 0x0,
1020 TimeWithoutSeconds = 0x1,
1021 TimeWithoutAmPm = 0x2,
1025 TimeDuration = 0x6,
1030 TimeFoldHours = 0xE
1035 };
1036 Q_DECLARE_FLAGS(TimeFormatOptions, TimeFormatOption)
1037
1038 //KDE5 move to KDateTime namespace
1049 QString formatLocaleTime(const QTime &pTime,
1050 TimeFormatOptions options = KLocale::TimeDefault) const;
1051
1061 DigitSet dateTimeDigitSet() const;
1062
1068 bool use12Clock() const;
1069
1079 QString dayPeriodText(const QTime &time, DateTimeComponentFormat format = DefaultComponentFormat) const;
1080
1086 int weekStartDay() const;
1087
1094 int workingWeekStartDay() const;
1095
1102 int workingWeekEndDay() const;
1103
1110 int weekDayOfPray() const;
1111
1117 const KCalendarSystem * calendar() const;
1118
1119 //KDE5 remove
1129 KDE_DEPRECATED QString calendarType() const;
1130
1140 KLocale::CalendarSystem calendarSystem() const;
1141
1142 //KDE5 remove
1152 KDE_DEPRECATED void setCalendar(const QString & calendarType);
1153
1163 void setCalendarSystem(KLocale::CalendarSystem calendarSystem);
1164
1174 void setWeekNumberSystem(KLocale::WeekNumberSystem weekNumberSystem);
1175
1176 //KDE5 remove in favour of const version
1186 KLocale::WeekNumberSystem weekNumberSystem();
1187
1197 KLocale::WeekNumberSystem weekNumberSystem() const;
1198
1208 double readMoney(const QString &numStr, bool * ok = 0) const;
1209
1219 double readNumber(const QString &numStr, bool * ok = 0) const;
1220
1221 //KDE5 move to KDateTime namespace
1235 QDate readDate(const QString &str, bool* ok = 0) const;
1236
1237 //KDE5 move to KDateTime namespace
1243 QDate readDate(const QString &intstr, const QString &fmt, bool* ok = 0) const;
1244
1245 //KDE5 move to KDateTime namespace
1249 enum ReadDateFlags {
1250 NormalFormat = 1,
1252 ShortFormat = 2,
1254 IsoFormat = 4,
1256 IsoWeekFormat = 8,
1258 IsoOrdinalFormat = 16
1260 };
1261
1262 //KDE5 move to KDateTime namespace
1276 QDate readDate(const QString &str, ReadDateFlags flags, bool *ok = 0) const;
1277
1290 QTime readTime(const QString &str, bool* ok = 0) const;
1291
1297 enum ReadTimeFlags {
1298 WithSeconds = 0,
1299 WithoutSeconds = 1
1300 }; // (maybe use this enum as a bitfield, if adding independent features?)
1301
1317 QTime readTime(const QString &str, ReadTimeFlags flags, bool *ok = 0) const;
1318
1325 enum TimeProcessingOption {
1326 ProcessStrict = 0x1,
1329 ProcessNonStrict = 0x2
1332 };
1333 Q_DECLARE_FLAGS(TimeProcessingOptions, TimeProcessingOption)
1334
1335
1353 QTime readLocaleTime(const QString &str, bool *ok = 0,
1354 TimeFormatOptions options = KLocale::TimeDefault,
1355 TimeProcessingOptions processing = ProcessNonStrict) const;
1356
1369 QString language() const;
1370
1389 QString country() const;
1390
1409 QString countryDivisionCode() const;
1410
1422 QStringList languageList() const;
1423
1437 QStringList currencyCodeList() const;
1438
1447 const QByteArray encoding() const;
1448
1457 int encodingMib() const;
1458
1467 QTextCodec * codecForEncoding() const;
1468
1477 int fileEncodingMib() const;
1478
1501 void setDateFormat(const QString & format);
1502
1525 void setDateFormatShort(const QString & format);
1526
1532 void setDateMonthNamePossessive(bool possessive);
1533
1553 void setTimeFormat(const QString & format);
1554
1563 void setDateTimeDigitSet(DigitSet digitSet);
1564
1570 void setWeekStartDay(int day);
1571
1578 void setWorkingWeekStartDay(int day);
1579
1586 void setWorkingWeekEndDay(int day);
1587
1594 void setWeekDayOfPray(int day);
1595
1602 QString dateFormat() const;
1603
1610 QString dateFormatShort() const;
1611
1618 QString timeFormat() const;
1619
1625 void setDecimalSymbol(const QString & symbol);
1626
1632 void setThousandsSeparator(const QString & separator);
1633
1640 void setPositiveSign(const QString & sign);
1641
1647 void setNegativeSign(const QString & sign);
1648
1657 void setDigitSet(DigitSet digitSet);
1658
1664 void setPositiveMonetarySignPosition(SignPosition signpos);
1665
1671 void setNegativeMonetarySignPosition(SignPosition signpos);
1672
1680 void setPositivePrefixCurrencySymbol(bool prefix);
1681
1689 void setNegativePrefixCurrencySymbol(bool prefix);
1690
1698 KDE_DEPRECATED void setFracDigits(int digits);
1699
1707 void setDecimalPlaces(int digits);
1708
1716 void setMonetaryDecimalPlaces(int digits);
1717
1723 void setMonetaryThousandsSeparator(const QString & separator);
1724
1731 void setMonetaryDecimalSymbol(const QString & symbol);
1732
1740 void setCurrencyCode(const QString &newCurrencyCode);
1741
1750 void setCurrencySymbol(const QString & symbol);
1751
1760 void setMonetaryDigitSet(DigitSet digitSet);
1761
1767 int pageSize() const;
1768
1774 void setPageSize(int paperFormat);
1775
1780 enum MeasureSystem {
1781 Metric,
1782 Imperial
1783 };
1784
1790 MeasureSystem measureSystem() const;
1791
1797 void setMeasureSystem(MeasureSystem value);
1798
1809 void insertCatalog(const QString& catalog);
1810
1816 void removeCatalog(const QString &catalog);
1817
1822 void setActiveCatalog(const QString &catalog);
1823
1829 QString translateQt(const char *context, const char *sourceText, const char *comment) const;
1830
1842 QStringList allLanguagesList() const;
1843
1856 QStringList installedLanguages() const;
1857
1874 QString languageCodeToName(const QString &language) const;
1875
1886 QStringList allCountriesList() const;
1887
1902 QString countryCodeToName(const QString &country) const;
1903
1914 static void splitLocale(const QString &locale, QString &language, QString &country,
1915 QString &modifier, QString &charset);
1916
1925 static void setMainCatalog(const char *catalog);
1926
1943 static QString langLookup(const QString &fname, const char *rtype = "html");
1944
1950 static QString defaultLanguage();
1951
1962 static QString defaultCountry();
1963
1971 static QString defaultCurrencyCode();
1972
1978 bool useTranscript() const;
1979
1985 bool isApplicationTranslatedInto(const QString & language);
1986
1992 void copyCatalogsTo(KLocale *locale);
1993
2012 bool setCountry(const QString & country, KConfig *config);
2013
2029 bool setCountryDivisionCode(const QString & countryDivision);
2030
2047 bool setLanguage(const QString &language, KConfig *config);
2048
2058 bool setLanguage(const QStringList &languages);
2059
2082 QString localizedFilePath(const QString &filePath) const;
2083
2100 QString removeAcceleratorMarker(const QString &label) const;
2101
2120 QString convertDigits(const QString &str, DigitSet digitSet,
2121 bool ignoreContext = false) const;
2122
2129 void reparseConfiguration();
2130
2131private:
2132 friend class KLocalePrivate;
2133 friend class KLocaleTest;
2134 friend class KDateTimeFormatter;
2135 KLocalePrivate * const d;
2136};
2137
2138Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::DateTimeFormatOptions)
2139Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::DateTimeComponents)
2140Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::TimeFormatOptions)
2141Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::TimeProcessingOptions)
2142
2143#endif
KCalendarSystem
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
Definition kcalendarsystem.h:41
KConfig
The central class of the KDE configuration data system.
Definition kconfig.h:71
KCurrencyCode
Definition kcurrencycode.h:46
KDateTime
A class representing a date and time with an associated time zone.
Definition kdatetime.h:172
KDayPeriod
Definition kdayperiod_p.h:55
KLocalePrivate
Definition klocale_p.h:35
KLocale
KLocale provides support for country specific stuff like the national language.
Definition klocale.h:70
KLocale::WeekNumberSystem
WeekNumberSystem
Definition klocale.h:815
KLocale::IsoWeekNumber
@ IsoWeekNumber
ISO Week Number.
Definition klocale.h:817
KLocale::SimpleWeek
@ SimpleWeek
Week 1 starts Jan 1st ends after 7 days.
Definition klocale.h:820
KLocale::DefaultWeekNumber
@ DefaultWeekNumber
The system locale default.
Definition klocale.h:816
KLocale::FirstPartialWeek
@ FirstPartialWeek
Week 1 starts Jan 1st ends day before first Week Start Day in year.
Definition klocale.h:819
KLocale::FirstFullWeek
@ FirstFullWeek
Week 1 starts on the first Week Start Day in year ends after 7 days.
Definition klocale.h:818
KLocale::DigitSet
DigitSet
Definition klocale.h:309
KLocale::KannadaDigits
@ KannadaDigits
೦೧೨೩೪೫೬೭೮೯ (Kannada)
Definition klocale.h:318
KLocale::ArabicIndicDigits
@ ArabicIndicDigits
٠١٢٣٤٥٦٧٨٩ (eastern Arabic dialects)
Definition klocale.h:312
KLocale::EasternArabicIndicDigits
@ EasternArabicIndicDigits
۰۱۲۳۴۵۶۷۸۹ (Persian and Urdu)
Definition klocale.h:313
KLocale::OriyaDigits
@ OriyaDigits
୦୧୨୩୪୫୬୭୮୯ (Oriya)
Definition klocale.h:321
KLocale::ThaiDigits
@ ThaiDigits
๐๑๒๓๔๕๖๗๘๙ (Thai)
Definition klocale.h:324
KLocale::ArabicDigits
@ ArabicDigits
0123456789 (European and some Asian languages and western Arabic dialects)
Definition klocale.h:310
KLocale::TeluguDigits
@ TeluguDigits
౦౧౨౩౪౫౬౭౯ (Telugu)
Definition klocale.h:323
KLocale::TamilDigits
@ TamilDigits
௦௧௨௩௪௫௬௭௮ (Tamil)
Definition klocale.h:322
KLocale::GurmukhiDigits
@ GurmukhiDigits
੦੧੨੩੪੫੬੭੮੯ (Punjabi)
Definition klocale.h:317
KLocale::BengaliDigits
@ BengaliDigits
০১২৩৪৫৬৭৮৯ (Bengali and Assamese)
Definition klocale.h:315
KLocale::GujaratiDigits
@ GujaratiDigits
૦૧૨૩૪૫૬૭૮૯ (Gujarati)
Definition klocale.h:316
KLocale::MalayalamDigits
@ MalayalamDigits
൦൧൨൩൪൫൬൭൮൯ (Malayalam)
Definition klocale.h:320
KLocale::KhmerDigits
@ KhmerDigits
០១២៣៤៥៦៧៨៩ (Khmer)
Definition klocale.h:319
KLocale::DevenagariDigits
@ DevenagariDigits
०१२३४५६७८९ (Hindi)
Definition klocale.h:314
KLocale::translateRawFrom
void translateRawFrom(const char *catname, const char *msg, QString *lang, QString *trans) const
Definition klocale.cpp:158
KLocale::BinarySizeUnits
BinarySizeUnits
These binary units are used in KDE by the formatByteSize() functions.
Definition klocale.h:621
KLocale::UnitPetaByte
@ UnitPetaByte
PiB/PB/PB 2^50/10^15 bytes.
Definition klocale.h:631
KLocale::UnitTeraByte
@ UnitTeraByte
TiB/TB/TB 2^40/10^12 bytes.
Definition klocale.h:630
KLocale::UnitMegaByte
@ UnitMegaByte
MiB/MB/MB 2^20/10^06 bytes.
Definition klocale.h:628
KLocale::UnitKiloByte
@ UnitKiloByte
KiB/KB/kB 1024/1000 bytes.
Definition klocale.h:627
KLocale::UnitLastUnit
@ UnitLastUnit
Definition klocale.h:635
KLocale::UnitYottaByte
@ UnitYottaByte
YiB/YB/YB 2^80/10^24 bytes.
Definition klocale.h:634
KLocale::UnitZettaByte
@ UnitZettaByte
ZiB/ZB/ZB 2^70/10^21 bytes.
Definition klocale.h:633
KLocale::UnitByte
@ UnitByte
B 1 byte.
Definition klocale.h:626
KLocale::UnitGigaByte
@ UnitGigaByte
GiB/GB/GB 2^30/10^09 bytes.
Definition klocale.h:629
KLocale::UnitExaByte
@ UnitExaByte
EiB/EB/EB 2^60/10^18 bytes.
Definition klocale.h:632
KLocale::DefaultBinaryUnits
@ DefaultBinaryUnits
Auto-choose a unit such that the result is in the range [0, 1000 or 1024)
Definition klocale.h:623
KLocale::setEncoding
bool setEncoding(int mibEnum)
Changes the current encoding.
Definition klocale.cpp:655
KLocale::SignPosition
SignPosition
Various positions for where to place the positive or negative sign when they are related to a monetar...
Definition klocale.h:281
KLocale::AfterMoney
@ AfterMoney
Suffix the currency symbol with the sign, e.g.
Definition klocale.h:301
KLocale::ParensAround
@ ParensAround
Put parantheses around the quantity, e.g.
Definition klocale.h:285
KLocale::BeforeMoney
@ BeforeMoney
Prefix the currency symbol with the sign, e.g.
Definition klocale.h:297
KLocale::BeforeQuantityMoney
@ BeforeQuantityMoney
Prefix the quantity with the sign, e.g.
Definition klocale.h:289
KLocale::AfterQuantityMoney
@ AfterQuantityMoney
Suffix the quanitity with the sign, e.g.
Definition klocale.h:293
KLocale::TimeFormatOption
TimeFormatOption
Definition klocale.h:1017
KLocale::TimeWithoutSeconds
@ TimeWithoutSeconds
Exclude the seconds part of the time from display.
Definition klocale.h:1020
KLocale::TimeDuration
@ TimeDuration
Read/format time string as duration.
Definition klocale.h:1025
KLocale::TimeFoldHours
@ TimeFoldHours
Read/format time string as duration.
Definition klocale.h:1030
KLocale::TimeWithoutAmPm
@ TimeWithoutAmPm
Read/format time string without am/pm suffix but keep the 12/24h format as specified by locale time f...
Definition klocale.h:1021
KLocale::TimeDefault
@ TimeDefault
Default formatting using seconds and the format as specified by the locale.
Definition klocale.h:1018
KLocale::BinaryUnitDialect
BinaryUnitDialect
This enum chooses what dialect is used for binary units.
Definition klocale.h:656
KLocale::MetricBinaryDialect
@ MetricBinaryDialect
SI Units, kB, MB, etc. 10^(3*n)
Definition klocale.h:660
KLocale::LastBinaryDialect
@ LastBinaryDialect
Definition klocale.h:661
KLocale::IECBinaryDialect
@ IECBinaryDialect
KDE Default, KiB, MiB, etc. 2^(10*n)
Definition klocale.h:658
KLocale::DefaultBinaryDialect
@ DefaultBinaryDialect
Used if no specific preference.
Definition klocale.h:657
KLocale::JEDECBinaryDialect
@ JEDECBinaryDialect
KDE 3.5 default, KB, MB, etc. 2^(10*n)
Definition klocale.h:659
KLocale::DateTimeFormatStandard
DateTimeFormatStandard
Definition klocale.h:829
KLocale::KdeFormat
@ KdeFormat
KDE Standard.
Definition klocale.h:830
KLocale::UnicodeFormat
@ UnicodeFormat
UNICODE Standard (Qt/Java/OSX/Windows)
Definition klocale.h:832
KLocale::PosixFormat
@ PosixFormat
POSIX Standard.
Definition klocale.h:831
KLocale::KLocalePrivate
friend class KLocalePrivate
Definition klocale.h:2132
KLocale::ReadDateFlags
ReadDateFlags
Flags for readDate()
Definition klocale.h:1249
KLocale::IsoFormat
@ IsoFormat
Only accept a date string in ISO date format (YYYY-MM-DD)
Definition klocale.h:1254
KLocale::NormalFormat
@ NormalFormat
Only accept a date string in the locale LongDate format.
Definition klocale.h:1250
KLocale::ShortFormat
@ ShortFormat
Only accept a date string in the locale ShortDate format.
Definition klocale.h:1252
KLocale::IsoOrdinalFormat
@ IsoOrdinalFormat
Only accept a date string in ISO Week date format (YYYY-DDD)
Definition klocale.h:1258
KLocale::IsoWeekFormat
@ IsoWeekFormat
Only accept a date string in ISO Week date format (YYYY-Www-D)
Definition klocale.h:1256
KLocale::DateTimeComponent
DateTimeComponent
Definition klocale.h:865
KLocale::DayPeriod
@ DayPeriod
The Day Period portion of a date, e.g.
Definition klocale.h:891
KLocale::Day
@ Day
The Day portion of a date, may be number or name.
Definition klocale.h:870
KLocale::DaysInWeek
@ DaysInWeek
The Days In Week portion of a date.
Definition klocale.h:886
KLocale::WeeksInYear
@ WeeksInYear
The Weeks In Year portion of a date.
Definition klocale.h:883
KLocale::EraYear
@ EraYear
The Era and Year portion of a date.
Definition klocale.h:874
KLocale::DayPeriodHour
@ DayPeriodHour
The Day Period Hour portion of a date.
Definition klocale.h:892
KLocale::Week
@ Week
The Week Number portion of a date.
Definition klocale.h:880
KLocale::Millisecond
@ Millisecond
The Milliseconds portion of a date.
Definition klocale.h:890
KLocale::Second
@ Second
The Seconds portion of a date.
Definition klocale.h:889
KLocale::DayOfWeekName
@ DayOfWeekName
The Day Of Week Name / Weekday Name portion of a date.
Definition klocale.h:879
KLocale::UnixTime
@ UnixTime
The UNIX Time portion of a date.
Definition klocale.h:895
KLocale::Minute
@ Minute
The Minutes portion of a date.
Definition klocale.h:888
KLocale::DayOfYearName
@ DayOfYearName
The Day Of Year Name portion of a date.
Definition klocale.h:877
KLocale::MonthsInYear
@ MonthsInYear
The Months In Year portion of a date.
Definition klocale.h:882
KLocale::Year
@ Year
The Year portion of a date, may be number or name.
Definition klocale.h:866
KLocale::TimezoneName
@ TimezoneName
The Time Zone Name portion of a date.
Definition klocale.h:894
KLocale::DaysInYear
@ DaysInYear
The Days In Year portion of a date.
Definition klocale.h:884
KLocale::EraName
@ EraName
The Era Name portion of a date.
Definition klocale.h:873
KLocale::Month
@ Month
The Month portion of a date, may be number or name.
Definition klocale.h:868
KLocale::DayName
@ DayName
The Day Name portion of a date.
Definition klocale.h:871
KLocale::Timezone
@ Timezone
The Time Zone portion of a date, may be offset or name.
Definition klocale.h:893
KLocale::DayOfWeek
@ DayOfWeek
The Day Of Week / Weekday portion of a date, may be number or name.
Definition klocale.h:878
KLocale::MonthName
@ MonthName
The Month Name portion of a date.
Definition klocale.h:869
KLocale::JulianDay
@ JulianDay
The Julian Day of a date.
Definition klocale.h:872
KLocale::DaysInMonth
@ DaysInMonth
The Days In Month portion of a date.
Definition klocale.h:885
KLocale::YearInEra
@ YearInEra
The Year In Era portion of a date.
Definition klocale.h:875
KLocale::DayOfYear
@ DayOfYear
The Day Of Year portion of a date, may be number or name.
Definition klocale.h:876
KLocale::WeekYear
@ WeekYear
The Week Year portion of a date.
Definition klocale.h:881
KLocale::YearName
@ YearName
The Year Name portion of a date.
Definition klocale.h:867
KLocale::Hour
@ Hour
The Hours portion of a date.
Definition klocale.h:887
KLocale::KLocaleTest
friend class KLocaleTest
Definition klocale.h:2133
KLocale::TimeProcessingOption
TimeProcessingOption
Additional processing options for readLocaleTime().
Definition klocale.h:1325
KLocale::ProcessNonStrict
@ ProcessNonStrict
Process time in a lax manner, ie.
Definition klocale.h:1329
KLocale::ProcessStrict
@ ProcessStrict
Process time in a strict manner, ie.
Definition klocale.h:1326
KLocale::MeasureSystem
MeasureSystem
The Metric system will give you information in mm, while the Imperial system will give you informatio...
Definition klocale.h:1780
KLocale::Metric
@ Metric
Metric system (used e.g. in Europe)
Definition klocale.h:1781
KLocale::Imperial
@ Imperial
Imperial system (used e.g. in the United States)
Definition klocale.h:1782
KLocale::DateFormat
DateFormat
Format for date string.
Definition klocale.h:922
KLocale::FancyShortDate
@ FancyShortDate
Same as ShortDate for dates a week or more ago.
Definition klocale.h:925
KLocale::IsoOrdinalDate
@ IsoOrdinalDate
ISO-8601 Ordinal Date format YYYY-DDD, e.g.
Definition klocale.h:933
KLocale::IsoWeekDate
@ IsoWeekDate
ISO-8601 Week Date format YYYY-Www-D, e.g.
Definition klocale.h:932
KLocale::IsoDate
@ IsoDate
ISO-8601 Date format YYYY-MM-DD, e.g.
Definition klocale.h:931
KLocale::ShortDate
@ ShortDate
Locale Short date format, e.g.
Definition klocale.h:923
KLocale::FancyLongDate
@ FancyLongDate
Same as LongDate for dates a week or more ago.
Definition klocale.h:928
KLocale::LongDate
@ LongDate
Locale Long date format, e.g.
Definition klocale.h:924
KLocale::KLocale
KLocale(const QString &catalog, KSharedConfig::Ptr config=KSharedConfig::Ptr())
Constructs a KLocale with the given catalog name.
Definition klocale.cpp:48
KLocale::DateTimeFormatOption
DateTimeFormatOption
Options for formatting date-time values.
Definition klocale.h:967
KLocale::Seconds
@ Seconds
Include the seconds value.
Definition klocale.h:969
KLocale::TimeZone
@ TimeZone
Include a time zone string.
Definition klocale.h:968
KLocale::translateRaw
void translateRaw(const char *msg, QString *lang, QString *trans) const
Like translateRawFrom, with implicit lookup through all loaded catalogs.
Definition klocale.cpp:163
KLocale::country
QString country() const
Returns the country code of the country where the user lives.
Definition klocale.cpp:116
KLocale::CalendarSystem
CalendarSystem
Definition klocale.h:780
KLocale::IslamicCivilCalendar
@ IslamicCivilCalendar
Islamic Civil Calendar, aka Hijri, not the Lunar Calendar.
Definition klocale.h:792
KLocale::IndianNationalCalendar
@ IndianNationalCalendar
Indian National Calendar, not the Lunar Calendar.
Definition klocale.h:794
KLocale::JapaneseCalendar
@ JapaneseCalendar
Japanese Calendar, Gregorian calculation using Japanese Era (Nengô)
Definition klocale.h:799
KLocale::QDateCalendar
@ QDateCalendar
KDE Default, hybrid of Gregorian and Julian as used by QDate.
Definition klocale.h:781
KLocale::HebrewCalendar
@ HebrewCalendar
Hebrew Calendar, aka Jewish Calendar.
Definition klocale.h:789
KLocale::EthiopianCalendar
@ EthiopianCalendar
Ethiopian Calendar, aka Ethiopic Calendar.
Definition klocale.h:786
KLocale::CopticCalendar
@ CopticCalendar
Coptic Calendar as used Coptic Church and some parts of Egypt.
Definition klocale.h:785
KLocale::GregorianCalendar
@ GregorianCalendar
Gregorian Calendar, pure proleptic implementation.
Definition klocale.h:788
KLocale::ThaiCalendar
@ ThaiCalendar
Thai Calendar, aka Buddhist or Thai Buddhist.
Definition klocale.h:803
KLocale::JalaliCalendar
@ JalaliCalendar
Jalali Calendar, aka Persian or Iranian, also used in Afghanistan.
Definition klocale.h:796
KLocale::MinguoCalendar
@ MinguoCalendar
Minguo Calendar, aka ROC, Republic of China or Taiwanese.
Definition klocale.h:802
KLocale::JulianCalendar
@ JulianCalendar
Julian Calendar, as used in Orthodox Churches.
Definition klocale.h:801
KLocale::ReadTimeFlags
ReadTimeFlags
Flags for the old version of readTime()
Definition klocale.h:1297
KLocale::WithoutSeconds
@ WithoutSeconds
Only accept a time string without seconds.
Definition klocale.h:1299
KLocale::WithSeconds
@ WithSeconds
Only accept a time string with seconds. Default (no flag set)
Definition klocale.h:1298
KLocale::DateTimeParseMode
DateTimeParseMode
Definition klocale.h:841
KLocale::LiberalParsing
@ LiberalParsing
Parse Date/Time liberally.
Definition klocale.h:842
KLocale::KDateTimeFormatter
friend class KDateTimeFormatter
Definition klocale.h:2134
KLocale::DateTimeComponentFormat
DateTimeComponentFormat
Definition klocale.h:908
KLocale::DefaultComponentFormat
@ DefaultComponentFormat
The system locale default for the componant.
Definition klocale.h:909
KLocale::LongName
@ LongName
Long text format, e.g.
Definition klocale.h:915
KLocale::LongNumber
@ LongNumber
Number padded to a required width, e.g.
Definition klocale.h:911
KLocale::ShortName
@ ShortName
Short text format, e.g.
Definition klocale.h:914
KLocale::NarrowName
@ NarrowName
Narrow text format, may not be unique, e.g.
Definition klocale.h:913
KLocale::ShortNumber
@ ShortNumber
Number at its natural width, e.g.
Definition klocale.h:910
KLocale::language
QString language() const
Returns the language code used by this object.
Definition klocale.cpp:111
KSharedConfig::Ptr
KSharedPtr< KSharedConfig > Ptr
Definition ksharedconfig.h:43
QDateTime
QList
Definition kaboutdata.h:33
QStringList
QString
removeAcceleratorMarker
QString removeAcceleratorMarker(const QString &label_)
Definition common_helpers.cpp:52
kdecore_export.h
klocalizedstring.h
readNumber
static char readNumber(qint64 &value, QIODevice *file)
Definition kmimetyperepository.cpp:368
ksharedconfig.h
prefix
QString prefix()
Definition kstandarddirs_win.cpp:28
DateTimeComponents
Definition kdatetimeparser_p.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal