Home · All Classes · Main Classes · Deprecated
Public Member Functions | Static Public Member Functions

ML10N::MCalendar Class Reference

MCalendar can hold date and time value for with different calendar systems. More...

List of all members.

Public Member Functions

 MCalendar (MLocale::CalendarType calendarType=MLocale::DefaultCalendar, const QString &timezone=QString())
 MCalendar (const MLocale &mLocale, const QString &timezone=QString())
 MCalendar (const MCalendar &other)
virtual ~MCalendar ()
MCalendaroperator= (const MCalendar &other)
bool isValid () const
MLocale::CalendarType type () const
void setDate (int year, int month, int day)
void setDate (const QDate &date)
void setDateTime (QDateTime datetime)
QDateTime qDateTime (Qt::TimeSpec spec=Qt::LocalTime) const
void setYear (int year)
void setMonth (int month)
void setDay (int day)
int dayOfYear () const
int weekOfYear () const
int month () const
int year () const
int yearOfWeek () const
int dayOfMonth () const
int dayOfWeek () const
void setTime (int hours, int minutes, int seconds)
void setHours (int hours)
void setMinutes (int minutes)
void setSeconds (int seconds)
int hour () const
int minute () const
int second () const
void addYears (int years)
void addMonths (int months)
void addDays (int days)
void addHours (int hours)
void addMinutes (int minutes)
void addSeconds (int seconds)
int firstDayOfMonth () const
int lastDayOfMonth () const
void setFirstDayOfWeek (int weekday)
int firstDayOfWeek () const
void setMinimalDaysInFirstWeek (int days)
int minimalDaysInFirstWeek () const
MLocale::WeekdayType getDayOfWeekType (MLocale::Weekday weekday) const
qint32 getWeekendTransition (MLocale::Weekday weekday) const
int weekNumber () const
int maximumWeeksInMonth () const
int daysInWeek () const
bool after (const MCalendar &other) const
bool before (const MCalendar &other) const
bool equals (const MCalendar &other) const
bool operator< (const MCalendar &other) const
bool operator<= (const MCalendar &other) const
bool operator== (const MCalendar &other) const
bool operator!= (const MCalendar &other) const
bool operator> (const MCalendar &other) const
bool operator>= (const MCalendar &other) const

Static Public Member Functions

static void setSystemTimeZone (const QString &timezone)
static QString systemTimeZone ()
static QStringList supportedTimeZones ()
static QStringList supportedTimeZones (const QString &country)

Detailed Description

MCalendar can hold date and time value for with different calendar systems.

Note:
insufficient information: default values are used. e.g. with gregorian calendar the epoch value (1970-1-1)
inconsistent information: preference is on fields set more recently

Constructor & Destructor Documentation

ML10N::MCalendar::MCalendar ( MLocale::CalendarType  calendarType = MLocale::DefaultCalendar,
const QString timezone = QString() 
) [explicit]

Constructs a MCalendar with explicit calendar type.

Parameters:
calendar Calendar type. Default is the type used for default locale.
timezone Timezone to be used. Default is timezone of the default locale. Possible values: id, e.g. PST, country/city, e.g. Europe/Helsinki or GMT offset, e.g. GTM+2:00. supportedTimezones() can be used to enumerate choices.
ML10N::MCalendar::MCalendar ( const MLocale mLocale,
const QString timezone = QString() 
) [explicit]

Constructs a MCalendar based on calendar system used by given MLocale.

ML10N::MCalendar::MCalendar ( const MCalendar other  ) 

Copy constructor.

ML10N::MCalendar::~MCalendar (  )  [virtual]

Destroys the calendar.


Member Function Documentation

void ML10N::MCalendar::addDays ( int  days  ) 

Add number of days days to the current date.

void ML10N::MCalendar::addHours ( int  hours  ) 

Add number of hours hours to the current time.

void ML10N::MCalendar::addMinutes ( int  minutes  ) 

Add number of minutes minutes to the current time.

void ML10N::MCalendar::addMonths ( int  months  ) 

Add number of months months to the current date.

void ML10N::MCalendar::addSeconds ( int  seconds  ) 

Add number of seconds seconds to the current time.

void ML10N::MCalendar::addYears ( int  years  ) 

Add number of years years to the current date.

bool ML10N::MCalendar::after ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is after other.

bool ML10N::MCalendar::before ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is before other.

int ML10N::MCalendar::dayOfMonth (  )  const

Returns day of month.

int ML10N::MCalendar::dayOfWeek (  )  const

Returns day of week. Monday = 1.

int ML10N::MCalendar::dayOfYear (  )  const

returns day number of the year. returns zero on error.

int ML10N::MCalendar::daysInWeek (  )  const

Returns the maximum number of days in a week.

bool ML10N::MCalendar::equals ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is equal to other.

int ML10N::MCalendar::firstDayOfMonth (  )  const

Returns first day of a month.

int ML10N::MCalendar::firstDayOfWeek (  )  const

Returns the first day of a week.

MLocale::WeekdayType ML10N::MCalendar::getDayOfWeekType ( MLocale::Weekday  weekday  )  const

returns whether the given day of the week is a weekday, a weekend day, or a day that transitions from one to the other, in this calendar system.

See also:
MLocale::WeekdayType
qint32 ML10N::MCalendar::getWeekendTransition ( MLocale::Weekday  weekday  )  const

returns the time during the day at which the weekend begins or ends in this calendar system.

Returns the milliseconds after midnight at which the weekend begins or ends.

For regular weekdays it returns -1.

See also:
getDayOfWeekType() const
int ML10N::MCalendar::hour (  )  const

Returns the current hours.

bool ML10N::MCalendar::isValid (  )  const

checks the validity of the information of the calendar. Returns true if calendar is valid.

int ML10N::MCalendar::lastDayOfMonth (  )  const

Returns last day of a month.

int ML10N::MCalendar::maximumWeeksInMonth (  )  const

Returns the maximum number of weeks in a month.

int ML10N::MCalendar::minimalDaysInFirstWeek (  )  const

returns the number of days required for the first week in the year

int ML10N::MCalendar::minute (  )  const

Returns the current minutes.

int ML10N::MCalendar::month (  )  const

Returns month number.

bool ML10N::MCalendar::operator!= ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is different than other.

bool ML10N::MCalendar::operator< ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is before other.

bool ML10N::MCalendar::operator<= ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is equal or before other.

MCalendar & ML10N::MCalendar::operator= ( const MCalendar other  ) 

Assignment operator.

bool ML10N::MCalendar::operator== ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is equal to other.

bool ML10N::MCalendar::operator> ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is after other.

bool ML10N::MCalendar::operator>= ( const MCalendar other  )  const

Returns true if the current date/time of this calendar is equal or after other.

QDateTime ML10N::MCalendar::qDateTime ( Qt::TimeSpec  spec = Qt::LocalTime  )  const

Converts calendar into QDate.

Parameters:
spec (optional) specification for resulting QDateTime, Qt::LocalTime (default) or Qt::UTC
int ML10N::MCalendar::second (  )  const

Returns the current seconds.

void ML10N::MCalendar::setDate ( int  year,
int  month,
int  day 
)

Sets the calendar date. Parameters self explanatory.

void ML10N::MCalendar::setDate ( const QDate date  ) 

Sets the calendar date from QDate.

void ML10N::MCalendar::setDateTime ( QDateTime  datetime  ) 

Sets the calendar according to given QDate.

void ML10N::MCalendar::setDay ( int  day  ) 

Set the day of the date to day.

void ML10N::MCalendar::setFirstDayOfWeek ( int  weekday  ) 

Sets the first day of the week to weekday.

void ML10N::MCalendar::setHours ( int  hours  ) 

Set the hours of the date/time to hours.

void ML10N::MCalendar::setMinimalDaysInFirstWeek ( int  days  ) 

sets what is the required amount of days for the first week of the year.

void ML10N::MCalendar::setMinutes ( int  minutes  ) 

Set the minutes of the time to minutes.

void ML10N::MCalendar::setMonth ( int  month  ) 

Set the month of the date to month.

void ML10N::MCalendar::setSeconds ( int  seconds  ) 

Set the seconds of the time to seconds.

void ML10N::MCalendar::setSystemTimeZone ( const QString timezone  )  [static]
void ML10N::MCalendar::setTime ( int  hours,
int  minutes,
int  seconds 
)

Set calendar time of the day.

void ML10N::MCalendar::setYear ( int  year  ) 

Set the year of the date to year.

QStringList ML10N::MCalendar::supportedTimeZones (  )  [static]
QStringList ML10N::MCalendar::supportedTimeZones ( const QString country  )  [static]
QString ML10N::MCalendar::systemTimeZone (  )  [static]
MLocale::CalendarType ML10N::MCalendar::type (  )  const

returns the used calendar system

int ML10N::MCalendar::weekNumber (  )  const

Returns the current week number.

int ML10N::MCalendar::weekOfYear (  )  const

Returns week number in the year.

int ML10N::MCalendar::year (  )  const

Returns year number.

int ML10N::MCalendar::yearOfWeek (  )  const

returns the year the current week "belongs to".


Copyright © 2010 Nokia Corporation
MeeGo Touch