KPlato::CalendarWeekdays Class Reference

#include <kptcalendar.h>

List of all members.

Public Member Functions

 CalendarWeekdays ()
 CalendarWeekdays (CalendarWeekdays *weekdays)
 ~CalendarWeekdays ()
bool load (QDomElement &element)
void save (QDomElement &element) const
void addWeekday (CalendarDay *day)
const QList< CalendarDay * > & weekdays () const
CalendarDayweekday (int day) const
CalendarDayweekday (const QDate &date) const
CalendarDayreplace (int weekday, CalendarDay *day)
IntMap map ()
void setWeekday (IntMap::iterator it, int state)
int state (const QDate &date) const
int state (int weekday) const
void setState (int weekday, int state)
const QList< TimeInterval * > & intervals (int weekday) const
void setIntervals (int weekday, QList< TimeInterval * >intervals)
void clearIntervals (int weekday)
bool operator== (const CalendarWeekdays *weekdays) const
bool operator!= (const CalendarWeekdays *weekdays) const
Duration effort (const QDate &date, const QTime &start, const QTime &end)
TimeInterval interval (const QDate date, const QTime &start, const QTime &end) const
bool hasInterval (const QDate date, const QTime &start, const QTime &end) const
bool hasInterval () const
Duration duration () const
Duration duration (int weekday) const
QTime startOfDay (int weekday) const
 Returns the time when the weekday starts.
QTime endOfDay (int weekday) const
 Returns the time when the weekday ends.
const CalendarWeekdayscopy (const CalendarWeekdays &weekdays)
void printDebug (QString indent="")

Private Attributes

QList< CalendarDay * > m_weekdays
double m_workHours


Detailed Description

Definition at line 115 of file kptcalendar.h.


Constructor & Destructor Documentation

KPlato::CalendarWeekdays::CalendarWeekdays (  ) 

Definition at line 283 of file kptcalendar.cc.

References m_weekdays.

KPlato::CalendarWeekdays::CalendarWeekdays ( CalendarWeekdays weekdays  ) 

Definition at line 294 of file kptcalendar.cc.

References copy(), and weekdays().

KPlato::CalendarWeekdays::~CalendarWeekdays (  ) 

Definition at line 301 of file kptcalendar.cc.

References m_weekdays.


Member Function Documentation

bool KPlato::CalendarWeekdays::load ( QDomElement &  element  ) 

Definition at line 318 of file kptcalendar.cc.

References KPlato::CalendarDay::load(), m_weekdays, KPlato::Map::None, and KPlato::CalendarDay::setState().

Referenced by KPlato::Calendar::load().

void KPlato::CalendarWeekdays::save ( QDomElement &  element  )  const

Definition at line 334 of file kptcalendar.cc.

References m_weekdays, and KPlato::CalendarDay::save().

Referenced by KPlato::Calendar::save().

void KPlato::CalendarWeekdays::addWeekday ( CalendarDay day  )  [inline]

Definition at line 125 of file kptcalendar.h.

References m_weekdays.

const QList<CalendarDay*>& KPlato::CalendarWeekdays::weekdays (  )  const [inline]

Definition at line 126 of file kptcalendar.h.

References m_weekdays.

Referenced by CalendarWeekdays(), copy(), operator!=(), and operator==().

CalendarDay * KPlato::CalendarWeekdays::weekday ( int  day  )  const

Returns the pointer to CalendarDay for day or 0 if not defined. day is 0..6.

Parameters:
day todo : add a comment

Definition at line 448 of file kptcalendar.cc.

References m_weekdays.

Referenced by KPlato::CalendarListViewItem::buildCommand(), duration(), effort(), endOfDay(), hasInterval(), interval(), startOfDay(), KPlato::Calendar::weekday(), and weekday().

CalendarDay* KPlato::CalendarWeekdays::weekday ( const QDate &  date  )  const [inline]

Definition at line 133 of file kptcalendar.h.

References weekday().

CalendarDay* KPlato::CalendarWeekdays::replace ( int  weekday,
CalendarDay day 
) [inline]

Definition at line 134 of file kptcalendar.h.

References m_weekdays.

Referenced by KPlato::CalendarModifyWeekdayCmd::execute(), and KPlato::CalendarModifyWeekdayCmd::unexecute().

IntMap KPlato::CalendarWeekdays::map (  ) 

Definition at line 345 of file kptcalendar.cc.

References KPlato::IntMap::insert(), and m_weekdays.

Referenced by KPlato::Calendar::weekdaysMap().

void KPlato::CalendarWeekdays::setWeekday ( IntMap::iterator  it,
int  state 
) [inline]

Definition at line 141 of file kptcalendar.h.

References m_weekdays, and setState().

Referenced by KPlato::Calendar::setWeekday().

int KPlato::CalendarWeekdays::state ( const QDate &  date  )  const

Definition at line 354 of file kptcalendar.cc.

Referenced by KPlato::Calendar::effort(), KPlato::Calendar::firstInterval(), and KPlato::Calendar::hasInterval().

int KPlato::CalendarWeekdays::state ( int  weekday  )  const

Definition at line 358 of file kptcalendar.cc.

References m_weekdays, KPlato::Map::None, and KPlato::CalendarDay::state().

void KPlato::CalendarWeekdays::setState ( int  weekday,
int  state 
)

Definition at line 363 of file kptcalendar.cc.

References m_weekdays, and KPlato::CalendarDay::setState().

Referenced by setWeekday().

const QList< TimeInterval * > & KPlato::CalendarWeekdays::intervals ( int  weekday  )  const

Definition at line 370 of file kptcalendar.cc.

References m_weekdays, and KPlato::CalendarDay::workingIntervals().

void KPlato::CalendarWeekdays::setIntervals ( int  weekday,
QList< TimeInterval * >  intervals 
)

Definition at line 376 of file kptcalendar.cc.

References m_weekdays, and KPlato::CalendarDay::setIntervals().

void KPlato::CalendarWeekdays::clearIntervals ( int  weekday  ) 

Definition at line 382 of file kptcalendar.cc.

References KPlato::CalendarDay::clearIntervals(), and m_weekdays.

bool KPlato::CalendarWeekdays::operator== ( const CalendarWeekdays weekdays  )  const

Definition at line 388 of file kptcalendar.cc.

References m_weekdays, and weekdays().

bool KPlato::CalendarWeekdays::operator!= ( const CalendarWeekdays weekdays  )  const

Definition at line 400 of file kptcalendar.cc.

References m_weekdays, and weekdays().

Duration KPlato::CalendarWeekdays::effort ( const QDate &  date,
const QTime &  start,
const QTime &  end 
)

Definition at line 413 of file kptcalendar.cc.

References KPlato::CalendarDay::effort(), KPlato::CalendarDay::state(), weekday(), KPlato::Map::Working, and KPlato::Duration::zeroDuration.

Referenced by KPlato::Calendar::effort().

TimeInterval KPlato::CalendarWeekdays::interval ( const QDate  date,
const QTime &  start,
const QTime &  end 
) const

Returns the actual 'work interval' on the weekday defined by date 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 422 of file kptcalendar.cc.

References KPlato::CalendarDay::hasInterval(), KPlato::CalendarDay::interval(), KPlato::CalendarDay::state(), weekday(), and KPlato::Map::Working.

Referenced by KPlato::Calendar::firstInterval().

bool KPlato::CalendarWeekdays::hasInterval ( const QDate  date,
const QTime &  start,
const QTime &  end 
) const

Returns true if at least a part of a 'work interval' exists on the weekday defined by date for the interval start to end.

Definition at line 433 of file kptcalendar.cc.

References KPlato::CalendarDay::hasInterval(), and weekday().

Referenced by KPlato::Calendar::hasInterval().

bool KPlato::CalendarWeekdays::hasInterval (  )  const

Definition at line 439 of file kptcalendar.cc.

References KPlato::CalendarDay::hasInterval(), and m_weekdays.

Duration KPlato::CalendarWeekdays::duration (  )  const

Definition at line 457 of file kptcalendar.cc.

References KPlato::CalendarDay::duration(), and m_weekdays.

Duration KPlato::CalendarWeekdays::duration ( int  weekday  )  const

Definition at line 465 of file kptcalendar.cc.

References KPlato::CalendarDay::duration(), and weekday().

QTime KPlato::CalendarWeekdays::startOfDay ( int  weekday  )  const

Returns the time when the weekday starts.

Definition at line 472 of file kptcalendar.cc.

References KPlato::CalendarDay::startOfDay(), and weekday().

QTime KPlato::CalendarWeekdays::endOfDay ( int  weekday  )  const

Returns the time when the weekday ends.

Definition at line 479 of file kptcalendar.cc.

References KPlato::CalendarDay::endOfDay(), and weekday().

const CalendarWeekdays & KPlato::CalendarWeekdays::copy ( const CalendarWeekdays weekdays  ) 

Definition at line 307 of file kptcalendar.cc.

References m_weekdays, and weekdays().

Referenced by CalendarWeekdays().

void KPlato::CalendarWeekdays::printDebug ( QString  indent = ""  ) 

Definition at line 990 of file kptcalendar.cc.

References m_weekdays, and KPlato::CalendarDay::printDebug().

Referenced by KPlato::Calendar::printDebug().


Member Data Documentation

QList<CalendarDay*> KPlato::CalendarWeekdays::m_weekdays [private]

Definition at line 181 of file kptcalendar.h.

Referenced by addWeekday(), CalendarWeekdays(), clearIntervals(), copy(), duration(), hasInterval(), intervals(), load(), map(), operator!=(), operator==(), printDebug(), replace(), save(), setIntervals(), setState(), setWeekday(), state(), weekday(), weekdays(), and ~CalendarWeekdays().

double KPlato::CalendarWeekdays::m_workHours [private]

Definition at line 182 of file kptcalendar.h.


The documentation for this class was generated from the following files:
Generated on Wed Nov 22 23:21:44 2006 for KPlato by  doxygen 1.5.1-p1