mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-24 10:52:52 +00:00
104 lines
6.5 KiB
Text
104 lines
6.5 KiB
Text
// Copyright 2010 Simon Edwards <simon@simonzone.com>
|
|
|
|
// Generated by twine2
|
|
|
|
// This program 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, or
|
|
// (at your option) any later version.
|
|
|
|
// This program 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 General Public License for more details
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
// License along with this program; if not, write to the
|
|
// Free Software Foundation, Inc.,
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
class KLocalizedDate
|
|
{
|
|
%TypeHeaderCode
|
|
#include <klocalizeddate.h>
|
|
%End
|
|
|
|
public:
|
|
explicit KLocalizedDate (const QDate& date = QDate(), const KCalendarSystem* calendar = 0);
|
|
KLocalizedDate (int year, int month, int day, const KCalendarSystem* calendar = 0);
|
|
KLocalizedDate (const KLocalizedDate& rhs);
|
|
~KLocalizedDate ();
|
|
void setCalendarSystem (KLocale::CalendarSystem calendarSystem);
|
|
KLocale::CalendarSystem calendarSystem ();
|
|
const KCalendarSystem* calendar () const;
|
|
bool isNull () const;
|
|
bool isValid () const;
|
|
bool setDate (const QDate& date);
|
|
bool setDate (int year, int month, int day);
|
|
bool setDate (int year, int dayOfYear);
|
|
bool setDate (QString eraName, int yearInEra, int month, int day);
|
|
bool setDate (KLocale::WeekNumberSystem weekNumberSystem, int year, int weekOfYear, int dayOfWeek);
|
|
bool setCurrentDate ();
|
|
static KLocalizedDate currentDate ();
|
|
static KLocalizedDate fromDate (const QDate& date);
|
|
static KLocalizedDate fromJulianDay (int jd);
|
|
int toJulianDay () const;
|
|
QDate date () const;
|
|
void getDate (int* year, int* month, int* day) const;
|
|
int year () const;
|
|
int month () const;
|
|
int day () const;
|
|
QString eraName () const;
|
|
QString eraYear () const;
|
|
int yearInEra () const;
|
|
int dayOfYear () const;
|
|
int dayOfWeek () const;
|
|
int week (int* yearNum = 0) const;
|
|
int week (KLocale::WeekNumberSystem weekNumberSystem, int* yearNum = 0) const;
|
|
int monthsInYear () const;
|
|
int weeksInYear () const;
|
|
int weeksInYear (KLocale::WeekNumberSystem weekNumberSystem) const;
|
|
int daysInYear () const;
|
|
int daysInMonth () const;
|
|
int daysInWeek () const;
|
|
bool isLeapYear () const;
|
|
QString formatDate (KLocale::DateFormat dateFormat = KLocale::LongDate) const;
|
|
QString formatDate (const QString& formatString, KLocale::DateTimeFormatStandard formatStandard = KLocale::KdeFormat) const;
|
|
static KLocalizedDate readDate (const QString& dateString, KLocale::DateTimeParseMode parseMode = KLocale::LiberalParsing, const KCalendarSystem* calendar = 0);
|
|
static KLocalizedDate readDate (const QString& dateString, KLocale::ReadDateFlags formatFlags, KLocale::DateTimeParseMode parseMode = KLocale::LiberalParsing, const KCalendarSystem* calendar = 0);
|
|
static KLocalizedDate readDate (const QString& dateString, const QString& dateFormat, KLocale::DateTimeParseMode parseMode = KLocale::LiberalParsing, KLocale::DateTimeFormatStandard formatStandard = KLocale::KdeFormat, const KCalendarSystem* calendar = 0);
|
|
KLocalizedDate addYears (int years) const;
|
|
bool addYearsTo (int years);
|
|
KLocalizedDate addMonths (int months) const;
|
|
bool addMonthsTo (int months);
|
|
KLocalizedDate addDays (int days) const;
|
|
bool addDaysTo (int days);
|
|
void dateDifference (const KLocalizedDate& toDate, int* yearsDiff, int* monthsDiff, int* daysDiff, int* direction) const;
|
|
void dateDifference (const QDate& toDate, int* yearsDiff, int* monthsDiff, int* daysDiff, int* direction) const;
|
|
int yearsDifference (const KLocalizedDate& toDate) const;
|
|
int yearsDifference (const QDate& toDate) const;
|
|
int monthsDifference (const KLocalizedDate& toDate) const;
|
|
int monthsDifference (const QDate& toDate) const;
|
|
int daysDifference (const KLocalizedDate& toDate) const;
|
|
int daysDifference (const QDate& toDate) const;
|
|
KLocalizedDate firstDayOfYear () const;
|
|
KLocalizedDate lastDayOfYear () const;
|
|
KLocalizedDate firstDayOfMonth () const;
|
|
KLocalizedDate lastDayOfMonth () const;
|
|
bool operator == (const KLocalizedDate& other) const;
|
|
bool operator == (const QDate& other) const;
|
|
bool operator != (const KLocalizedDate& other) const;
|
|
bool operator != (const QDate& other) const;
|
|
bool operator < (const KLocalizedDate& other) const;
|
|
bool operator < (const QDate& other) const;
|
|
bool operator <= (const KLocalizedDate& other) const;
|
|
bool operator <= (const QDate& other) const;
|
|
bool operator > (const KLocalizedDate& other) const;
|
|
bool operator > (const QDate& other) const;
|
|
bool operator >= (const KLocalizedDate& other) const;
|
|
bool operator >= (const QDate& other) const;
|
|
QString formatDate (KLocale::DateTimeComponent component, KLocale::DateTimeComponentFormat format = KLocale::DefaultComponentFormat, KLocale::WeekNumberSystem weekNumberSystem = KLocale::DefaultWeekNumber) const;
|
|
};
|
|
QDataStream operator << (QDataStream& out, const KLocalizedDate& date);
|
|
QDataStream operator >> (QDataStream& in, KLocalizedDate& date);
|
|
//ig QDebug operator << (QDebug debug, const KLocalizedDate& date);
|