#include <kptcalendar.h>
Public Member Functions | |
CalendarDay () | |
CalendarDay (int state) | |
CalendarDay (QDate date, int state=0) | |
CalendarDay (CalendarDay *day) | |
~CalendarDay () | |
bool | load (QDomElement &element) |
void | save (QDomElement &element) const |
const QList< TimeInterval * > & | workingIntervals () const |
void | addInterval (TimeInterval *interval) |
void | addInterval (TimeInterval interval) |
void | clearIntervals () |
void | setIntervals (QList< TimeInterval * > intervals) |
QTime | startOfDay () const |
QTime | endOfDay () const |
QDate | date () const |
void | setDate (QDate date) |
int | state () const |
void | setState (int state) |
bool | operator== (const CalendarDay *day) const |
bool | operator== (const CalendarDay &day) const |
bool | operator!= (const CalendarDay *day) const |
bool | operator!= (const CalendarDay &day) const |
Duration | effort (const QTime &start, const QTime &end) |
TimeInterval | interval (const QTime &start, const QTime &end) const |
bool | hasInterval () const |
bool | hasInterval (const QTime &start, const QTime &end) const |
Duration | duration () const |
const CalendarDay & | copy (const CalendarDay &day) |
void | printDebug (QString indent="") |
Private Attributes | |
QDate | m_date |
int | m_state |
QList< TimeInterval * > | m_workingIntervals |
Definition at line 45 of file kptcalendar.h.
KPlato::CalendarDay::CalendarDay | ( | ) |
Definition at line 35 of file kptcalendar.cc.
KPlato::CalendarDay::CalendarDay | ( | int | state | ) |
Definition at line 43 of file kptcalendar.cc.
KPlato::CalendarDay::CalendarDay | ( | QDate | date, | |
int | state = 0 | |||
) |
Definition at line 51 of file kptcalendar.cc.
KPlato::CalendarDay::CalendarDay | ( | CalendarDay * | day | ) |
KPlato::CalendarDay::~CalendarDay | ( | ) |
bool KPlato::CalendarDay::load | ( | QDomElement & | element | ) |
Definition at line 83 of file kptcalendar.cc.
References addInterval(), clearIntervals(), m_date, and m_state.
Referenced by KPlato::CalendarWeekdays::load().
void KPlato::CalendarDay::save | ( | QDomElement & | element | ) | const |
Definition at line 116 of file kptcalendar.cc.
References m_date, m_state, m_workingIntervals, and KPlato::Map::None.
Referenced by KPlato::Calendar::save(), and KPlato::CalendarWeekdays::save().
const QList<TimeInterval*>& KPlato::CalendarDay::workingIntervals | ( | ) | const [inline] |
Definition at line 57 of file kptcalendar.h.
References m_workingIntervals.
Referenced by copy(), KPlato::CalendarWeekdays::intervals(), operator==(), KPlato::CalendarEdit::slotDateSelected(), KPlato::StandardWorktimeDialogImpl::slotWeekdaySelected(), and KPlato::CalendarEdit::slotWeekdaySelected().
void KPlato::CalendarDay::addInterval | ( | TimeInterval * | interval | ) |
Definition at line 135 of file kptcalendar.cc.
References m_workingIntervals.
Referenced by addInterval(), KPlato::StandardWorktime::init(), load(), KPlato::CalendarEdit::slotApplyClicked(), CalendarTester::testCalendarWithParent(), CalendarTester::testSingleDay(), and CalendarTester::testWeekdays().
void KPlato::CalendarDay::addInterval | ( | TimeInterval | interval | ) | [inline] |
void KPlato::CalendarDay::clearIntervals | ( | ) | [inline] |
Definition at line 60 of file kptcalendar.h.
References m_workingIntervals.
Referenced by KPlato::CalendarWeekdays::clearIntervals(), load(), KPlato::WeekdayListItem::setHours(), and KPlato::CalendarEdit::slotApplyClicked().
void KPlato::CalendarDay::setIntervals | ( | QList< TimeInterval * > | intervals | ) | [inline] |
Definition at line 61 of file kptcalendar.h.
References m_workingIntervals.
Referenced by KPlato::WeekdayListItem::setIntervals(), and KPlato::CalendarWeekdays::setIntervals().
QTime KPlato::CalendarDay::startOfDay | ( | ) | const |
Definition at line 139 of file kptcalendar.cc.
References m_workingIntervals.
Referenced by KPlato::CalendarWeekdays::startOfDay().
QTime KPlato::CalendarDay::endOfDay | ( | ) | const |
Definition at line 153 of file kptcalendar.cc.
References m_workingIntervals.
Referenced by KPlato::CalendarWeekdays::endOfDay().
QDate KPlato::CalendarDay::date | ( | ) | const [inline] |
Definition at line 69 of file kptcalendar.h.
References m_date.
Referenced by KPlato::CalendarListViewItem::buildCommand(), KPlato::CalendarModifyDayCmd::CalendarModifyDayCmd(), copy(), KPlato::Calendar::findDay(), and operator==().
void KPlato::CalendarDay::setDate | ( | QDate | date | ) | [inline] |
int KPlato::CalendarDay::state | ( | ) | const [inline] |
Definition at line 71 of file kptcalendar.h.
References m_state.
Referenced by copy(), KPlato::Calendar::effort(), KPlato::CalendarWeekdays::effort(), KPlato::Calendar::findDay(), KPlato::CalendarWeekdays::interval(), operator==(), KPlato::CalendarEdit::slotApplyClicked(), KPlato::CalendarEdit::slotDateSelected(), KPlato::StandardWorktimeDialogImpl::slotWeekdaySelected(), KPlato::CalendarEdit::slotWeekdaySelected(), KPlato::CalendarWeekdays::state(), and KPlato::WeekdayListItem::WeekdayListItem().
void KPlato::CalendarDay::setState | ( | int | state | ) | [inline] |
Definition at line 72 of file kptcalendar.h.
References m_state.
Referenced by KPlato::StandardWorktime::init(), KPlato::CalendarWeekdays::load(), KPlato::WeekdayListItem::setState(), KPlato::CalendarWeekdays::setState(), KPlato::CalendarEdit::slotApplyClicked(), and CalendarTester::testWeekdays().
bool KPlato::CalendarDay::operator== | ( | const CalendarDay * | day | ) | const |
bool KPlato::CalendarDay::operator== | ( | const CalendarDay & | day | ) | const |
Definition at line 170 of file kptcalendar.cc.
References date(), m_date, m_state, m_workingIntervals, state(), and workingIntervals().
bool KPlato::CalendarDay::operator!= | ( | const CalendarDay * | day | ) | const |
Definition at line 204 of file kptcalendar.cc.
bool KPlato::CalendarDay::operator!= | ( | const CalendarDay & | day | ) | const |
Duration KPlato::CalendarDay::effort | ( | const QTime & | start, | |
const QTime & | end | |||
) |
Returns the amount of 'worktime' that can be done on this day between the times start and end.
Definition at line 211 of file kptcalendar.cc.
References m_state, m_workingIntervals, and KPlato::Map::Working.
Referenced by KPlato::Calendar::effort(), and KPlato::CalendarWeekdays::effort().
TimeInterval KPlato::CalendarDay::interval | ( | const QTime & | start, | |
const QTime & | end | |||
) | const |
Returns the actual 'work interval' for the interval start to end. If no 'work interval' exists, returns the interval start, end. Use hasInterval() to check if a 'work interval' exists.
Definition at line 237 of file kptcalendar.cc.
References m_state, m_workingIntervals, and KPlato::Map::Working.
Referenced by KPlato::Calendar::firstInterval(), and KPlato::CalendarWeekdays::interval().
bool KPlato::CalendarDay::hasInterval | ( | ) | const |
Definition at line 254 of file kptcalendar.cc.
References m_state, m_workingIntervals, and KPlato::Map::Working.
Referenced by KPlato::Calendar::hasInterval(), KPlato::CalendarWeekdays::hasInterval(), and KPlato::CalendarWeekdays::interval().
bool KPlato::CalendarDay::hasInterval | ( | const QTime & | start, | |
const QTime & | end | |||
) | const |
Returns true if at least a part of a 'work interval' exists for the interval start to end.
Definition at line 258 of file kptcalendar.cc.
References m_state, m_workingIntervals, and KPlato::Map::Working.
Duration KPlato::CalendarDay::duration | ( | ) | const |
Definition at line 272 of file kptcalendar.cc.
References m_workingIntervals.
Referenced by KPlato::CalendarWeekdays::duration(), KPlato::WeekdayListItem::setIntervals(), and KPlato::WeekdayListItem::WeekdayListItem().
const CalendarDay & KPlato::CalendarDay::copy | ( | const CalendarDay & | day | ) |
Definition at line 72 of file kptcalendar.cc.
References date(), m_date, m_state, m_workingIntervals, state(), and workingIntervals().
Referenced by CalendarDay().
void KPlato::CalendarDay::printDebug | ( | QString | indent = "" |
) |
Definition at line 979 of file kptcalendar.cc.
References m_date, m_state, m_workingIntervals, and KPlato::Map::Working.
Referenced by KPlato::Calendar::printDebug(), and KPlato::CalendarWeekdays::printDebug().
QDate KPlato::CalendarDay::m_date [private] |
Definition at line 105 of file kptcalendar.h.
Referenced by copy(), date(), load(), operator==(), printDebug(), save(), and setDate().
int KPlato::CalendarDay::m_state [private] |
Definition at line 106 of file kptcalendar.h.
Referenced by copy(), effort(), hasInterval(), interval(), load(), operator==(), printDebug(), save(), setState(), and state().
QList<TimeInterval*> KPlato::CalendarDay::m_workingIntervals [private] |
Definition at line 107 of file kptcalendar.h.
Referenced by addInterval(), clearIntervals(), copy(), duration(), effort(), endOfDay(), hasInterval(), interval(), operator==(), printDebug(), save(), setIntervals(), startOfDay(), workingIntervals(), and ~CalendarDay().