Jump to content

Plasma/Locale

From KDE Community Wiki
Revision as of 10:55, 14 January 2012 by Terietor (talk | contribs) (Created page with "=QML Bindings for KLocale= ==enums==(Q_ENUMS) enum BinarySizeUnits { DefaultBinaryUnits = -1, UnitByte, UnitKiloByte, UnitMegaByte, UnitGigaByte, UnitTeraByte, UnitPetaBy...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

QML Bindings for KLocale

==enums==(Q_ENUMS) enum BinarySizeUnits {

 DefaultBinaryUnits = -1, UnitByte, UnitKiloByte, UnitMegaByte, 
 UnitGigaByte, UnitTeraByte, UnitPetaByte, UnitExaByte, 
 UnitZettaByte, UnitYottaByte, UnitLastUnit = UnitYottaByte 

} enum BinaryUnitDialect {

 DefaultBinaryDialect = -1, IECBinaryDialect, JEDECBinaryDialect, MetricBinaryDialect, 
 LastBinaryDialect = MetricBinaryDialect 

} enum CalendarSystem {

 QDateCalendar = 1, CopticCalendar = 5, EthiopianCalendar = 6, GregorianCalendar = 8, 
 HebrewCalendar = 9, IslamicCivilCalendar = 12, IndianNationalCalendar = 14, JalaliCalendar = 16, 
 JapaneseCalendar = 19, JulianCalendar = 21, MinguoCalendar = 22, ThaiCalendar = 23 

} enum DateFormat {

 ShortDate, LongDate, FancyShortDate, FancyLongDate, 
 IsoDate, IsoWeekDate, IsoOrdinalDate 

} enum DateTimeComponent {

 Year = 0x1, YearName = 0x2, Month = 0x4, MonthName = 0x8, 
 Day = 0x10, DayName = 0x20, JulianDay = 0x40, EraName = 0x80, 
 EraYear = 0x100, YearInEra = 0x200, DayOfYear = 0x400, DayOfYearName = 0x800, 
 DayOfWeek = 0x1000, DayOfWeekName = 0x2000, Week = 0x4000, WeekYear = 0x8000, 
 MonthsInYear = 0x10000, WeeksInYear = 0x20000, DaysInYear = 0x40000, DaysInMonth = 0x80000, 
 DaysInWeek = 0x100000, Hour = 0x200000, Minute = 0x400000, Second = 0x800000, 
 Millisecond = 0x1000000, DayPeriod = 0x2000000, DayPeriodHour = 0x4000000, Timezone = 0x8000000, 
 TimezoneName = 0x10000000, UnixTime = 0x20000000 

} enum DateTimeComponentFormat {

 DefaultComponentFormat = -1, ShortNumber = 0, LongNumber, NarrowName = 3, 
 ShortName, LongName 

} enum DateTimeFormatOption { TimeZone = 0x01, Seconds = 0x02 } enum DateTimeFormatStandard { KdeFormat, PosixFormat, UnicodeFormat } enum DateTimeParseMode { LiberalParsing } enum DigitSet {

 ArabicDigits, ArabicIndicDigits, EasternArabicIndicDigits, DevenagariDigits, 
 BengaliDigits, GujaratiDigits, GurmukhiDigits, KannadaDigits, 
 KhmerDigits, MalayalamDigits, OriyaDigits, TamilDigits, 
 TeluguDigits, ThaiDigits 

} enum MeasureSystem { Metric, Imperial } enum ReadDateFlags {

 NormalFormat = 1, ShortFormat = 2, IsoFormat = 4, IsoWeekFormat = 8, 
 IsoOrdinalFormat = 16 

} enum ReadTimeFlags { WithSeconds = 0, WithoutSeconds = 1 } enum SignPosition {

 ParensAround = 0, BeforeQuantityMoney = 1, AfterQuantityMoney = 2, BeforeMoney = 3, 
 AfterMoney = 4 

} enum TimeFormatOption {

 TimeDefault = 0x0, TimeWithoutSeconds = 0x1, TimeWithoutAmPm = 0x2, TimeDuration = 0x6, 
 TimeFoldHours = 0xE 

} enum TimeProcessingOption { ProcessStrict = 0x1, ProcessNonStrict = 0x2 } enum WeekNumberSystem {

 DefaultWeekNumber = -1, IsoWeekNumber = 0, FirstFullWeek = 1, FirstPartialWeek = 2, 
 SimpleWeek = 3 

} Public Member Functions

	KLocale (const QString &catalog, KSharedConfig::Ptr config=KSharedConfig::Ptr())
	KLocale (const QString &catalog, const QString &language, const QString &country=QString(), KConfig *config=0)
	KLocale (const KLocale &rhs)

virtual ~KLocale () QStringList allCountriesList () const QList< DigitSet > allDigitSetsList () const QStringList allLanguagesList () const BinaryUnitDialect binaryUnitDialect () const const KCalendarSystem * calendar () const KLocale::CalendarSystem calendarSystem () const QString calendarType () const QTextCodec * codecForEncoding () const QString convertDigits (const QString &str, DigitSet digitSet, bool ignoreContext=false) const void copyCatalogsTo (KLocale *locale) QString country () const QString countryCodeToName (const QString &country) const QString countryDivisionCode () const KCurrencyCode * currency () const QString currencyCode () const QStringList currencyCodeList () const QString currencySymbol () const QString dateFormat () const QString dateFormatShort () const bool dateMonthNamePossessive () const DigitSet dateTimeDigitSet () const QString dayPeriodText (const QTime &time, DateTimeComponentFormat format=DefaultComponentFormat) const int decimalPlaces () const QString decimalSymbol () const DigitSet digitSet () const QString digitSetToName (DigitSet digitSet, bool withDigits=false) const const QByteArray encoding () const int encodingMib () const int fileEncodingMib () const QString formatByteSize (double size) const QString formatByteSize (double size, int precision, BinaryUnitDialect dialect=KLocale::DefaultBinaryDialect, BinarySizeUnits specificUnit=KLocale::DefaultBinaryUnits) const QString formatDate (const QDate &date, DateFormat format=LongDate) const QString formatDateTime (const QDateTime &dateTime, DateFormat format=ShortDate, bool includeSecs=false) const QString formatDateTime (const KDateTime &dateTime, DateFormat format=ShortDate, DateTimeFormatOptions options=0) const QString formatDuration (unsigned long mSec) const QString formatLocaleTime (const QTime &pTime, TimeFormatOptions options=KLocale::TimeDefault) const QString formatLong (long num) const QString formatMoney (double num, const QString &currency=QString(), int precision=-1) const QString formatNumber (double num, int precision=-1) const QString formatNumber (const QString &numStr, bool round=true, int precision=-1) const QString formatTime (const QTime &pTime, bool includeSecs=false, bool isDuration=false) const int fracDigits () const void insertCatalog (const QString &catalog) QStringList installedLanguages () const bool isApplicationTranslatedInto (const QString &language) QString language () const QString languageCodeToName (const QString &language) const QStringList languageList () const QString localizedFilePath (const QString &filePath) const MeasureSystem measureSystem () const int monetaryDecimalPlaces () const QString monetaryDecimalSymbol () const DigitSet monetaryDigitSet () const QString monetaryThousandsSeparator () const SignPosition negativeMonetarySignPosition () const bool negativePrefixCurrencySymbol () const QString negativeSign () const bool nounDeclension () const KLocale & operator= (const KLocale &rhs) int pageSize () const SignPosition positiveMonetarySignPosition () const bool positivePrefixCurrencySymbol () const QString positiveSign () const QString prettyFormatDuration (unsigned long mSec) const QDate readDate (const QString &str, bool *ok=0) const QDate readDate (const QString &intstr, const QString &fmt, bool *ok=0) const QDate readDate (const QString &str, ReadDateFlags flags, bool *ok=0) const QTime readLocaleTime (const QString &str, bool *ok=0, TimeFormatOptions options=KLocale::TimeDefault, TimeProcessingOptions processing=ProcessNonStrict) const double readMoney (const QString &numStr, bool *ok=0) const double readNumber (const QString &numStr, bool *ok=0) const QTime readTime (const QString &str, bool *ok=0) const QTime readTime (const QString &str, ReadTimeFlags flags, bool *ok=0) const QString removeAcceleratorMarker (const QString &label) const void removeCatalog (const QString &catalog) void setActiveCatalog (const QString &catalog) void setBinaryUnitDialect (BinaryUnitDialect newDialect) void setCalendar (const QString &calendarType) void setCalendarSystem (KLocale::CalendarSystem calendarSystem) bool setCountry (const QString &country, KConfig *config) bool setCountryDivisionCode (const QString &countryDivision) void setCurrencyCode (const QString &newCurrencyCode) void setCurrencySymbol (const QString &symbol) void setDateFormat (const QString &format) void setDateFormatShort (const QString &format) void setDateMonthNamePossessive (bool possessive) void setDateTimeDigitSet (DigitSet digitSet) void setDecimalPlaces (int digits) void setDecimalSymbol (const QString &symbol) void setDigitSet (DigitSet digitSet) bool setEncoding (int mibEnum) void setFracDigits (int digits) bool setLanguage (const QStringList &languages) bool setLanguage (const QString &language, KConfig *config) void setMeasureSystem (MeasureSystem value) void setMonetaryDecimalPlaces (int digits) void setMonetaryDecimalSymbol (const QString &symbol) void setMonetaryDigitSet (DigitSet digitSet) void setMonetaryThousandsSeparator (const QString &separator) void setNegativeMonetarySignPosition (SignPosition signpos) void setNegativePrefixCurrencySymbol (bool prefix) void setNegativeSign (const QString &sign) void setPageSize (int paperFormat) void setPositiveMonetarySignPosition (SignPosition signpos) void setPositivePrefixCurrencySymbol (bool prefix) void setPositiveSign (const QString &sign) void setThousandsSeparator (const QString &separator) void setTimeFormat (const QString &format) void setWeekDayOfPray (int day) void setWeekNumberSystem (KLocale::WeekNumberSystem weekNumberSystem) void setWeekStartDay (int day) void setWorkingWeekEndDay (int day) void setWorkingWeekStartDay (int day) QString thousandsSeparator () const QString timeFormat () const QString translateQt (const char *context, const char *sourceText, const char *comment) const void translateRaw (const char *ctxt, const char *msg, QString *lang, QString *trans) const void translateRaw (const char *msg, QString *lang, QString *trans) const void translateRaw (const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const void translateRaw (const char *ctxt, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const void translateRawFrom (const char *catname, const char *msg, QString *lang, QString *trans) const void translateRawFrom (const char *catname, const char *ctxt, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const void translateRawFrom (const char *catname, const char *ctxt, const char *msg, QString *lang, QString *trans) const void translateRawFrom (const char *catname, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const bool use12Clock () const bool useTranscript () const int weekDayOfPray () const KLocale::WeekNumberSystem weekNumberSystem () KLocale::WeekNumberSystem weekNumberSystem () const int weekStartDay () const int workingWeekEndDay () const int workingWeekStartDay () const Static Public Member Functions

static QString defaultCountry () static QString defaultCurrencyCode () static QString defaultLanguage () static QString langLookup (const QString &fname, const char *rtype="html") static void setMainCatalog (const char *catalog) static void splitLocale (const QString &locale, QString &language, QString &country, QString &modifier, QString &charset)