KOpeningHours::Interval
#include <interval.h>
Public Types | |
enum | State { Invalid , Open , Closed , Unknown } |
Properties | |
QDateTime | begin |
QString | comment |
int | dstOffset |
QDateTime | end |
QDateTime | estimatedEnd |
bool | hasOpenBegin |
bool | hasOpenEnd |
bool | hasOpenEndTime |
State | state |
Public Member Functions | |
Interval (const Interval &) | |
Interval (Interval &&) | |
QDateTime | begin () const |
QString | comment () const |
bool | contains (const QDateTime &dt) const |
int | dstOffset () const |
QDateTime | end () const |
QDateTime | estimatedEnd () const |
bool | hasOpenBegin () const |
bool | hasOpenEnd () const |
bool | hasOpenEndTime () const |
bool | intersects (const Interval &other) const |
bool | isValid () const |
bool | operator< (const Interval &other) const |
Interval & | operator= (const Interval &) |
Interval & | operator= (Interval &&) |
void | setBegin (const QDateTime &begin) |
void | setComment (const QString &comment) |
void | setEnd (const QDateTime &end) |
void | setEstimatedEnd (const QDateTime &estimatedEnd) |
void | setOpenEndTime (bool openEndTime) |
void | setState (State state) |
State | state () const |
Detailed Description
A time interval for which an opening hours expression has been evaluated.
Definition at line 24 of file interval.h.
Member Enumeration Documentation
◆ State
Opening state during a time interval.
Definition at line 97 of file interval.h.
Property Documentation
◆ begin
|
read |
Definition at line 28 of file interval.h.
◆ comment
|
read |
Definition at line 33 of file interval.h.
◆ dstOffset
|
read |
Definition at line 35 of file interval.h.
◆ end
|
read |
Definition at line 30 of file interval.h.
◆ estimatedEnd
|
read |
Definition at line 34 of file interval.h.
◆ hasOpenBegin
|
read |
Definition at line 29 of file interval.h.
◆ hasOpenEnd
|
read |
Definition at line 31 of file interval.h.
◆ hasOpenEndTime
|
read |
Definition at line 32 of file interval.h.
◆ state
|
read |
Definition at line 27 of file interval.h.
Constructor & Destructor Documentation
◆ Interval()
Interval::Interval | ( | ) |
Definition at line 23 of file interval.cpp.
Member Function Documentation
◆ begin()
QDateTime Interval::begin | ( | ) | const |
Begin of the interval.
This is the first point in time included in the interval, or invalid if this is an interval with an open begin.
Definition at line 65 of file interval.cpp.
◆ comment()
QString Interval::comment | ( | ) | const |
Comment.
Definition at line 127 of file interval.cpp.
◆ contains()
bool Interval::contains | ( | const QDateTime & | dt | ) | const |
Check if this interval contains dt
.
Definition at line 108 of file interval.cpp.
◆ dstOffset()
int Interval::dstOffset | ( | ) | const |
Returns the UTC offset change between estimatedEnd() and begin().
This is 0, unless there is a DST transition happening in that interval.
- Since
- 23.04.0
Definition at line 152 of file interval.cpp.
◆ end()
QDateTime Interval::end | ( | ) | const |
End of the interval.
This is the first point in time not included in the interval anymore, or invalid for open-ended intervals. That is, the end of an interval describing the year 2020 would be Jan 1st 2021 at midnight (00:00).
Definition at line 81 of file interval.cpp.
◆ estimatedEnd()
QDateTime Interval::estimatedEnd | ( | ) | const |
Returns an estimated end time for intervals with an open end time.
By default this is the same as end() would return, unless higher-level logic with a view on multiple intervals and/or other context actually sets this.
Definition at line 138 of file interval.cpp.
◆ hasOpenBegin()
bool Interval::hasOpenBegin | ( | ) | const |
Returns true
if this is an interval with an open begin, ie.
starting at the beginning of time.
Definition at line 76 of file interval.cpp.
◆ hasOpenEnd()
bool Interval::hasOpenEnd | ( | ) | const |
Returns true
if this is an interval with an open end date, ie.
continuing for all eternity.
- Note
- This is different from an interval with an open end time.
Definition at line 92 of file interval.cpp.
◆ hasOpenEndTime()
bool Interval::hasOpenEndTime | ( | ) | const |
Returns true
if this is an interval with an open end time, ie.
an interval generated by a selector like "20:00+".
- Note
- This is different from an interval with an open end.
Definition at line 97 of file interval.cpp.
◆ intersects()
bool Interval::intersects | ( | const Interval & | other | ) | const |
Checks whether this interval overlaps with other
.
Definition at line 49 of file interval.cpp.
◆ isValid()
bool Interval::isValid | ( | ) | const |
Default constructed empty/invalid interval.
Definition at line 60 of file interval.cpp.
◆ operator<()
bool Interval::operator< | ( | const Interval & | other | ) | const |
Check whether this interval starts before other
.
Definition at line 34 of file interval.cpp.
◆ setBegin()
void Interval::setBegin | ( | const QDateTime & | begin | ) |
Definition at line 70 of file interval.cpp.
◆ setComment()
void Interval::setComment | ( | const QString & | comment | ) |
Definition at line 132 of file interval.cpp.
◆ setEnd()
void Interval::setEnd | ( | const QDateTime & | end | ) |
Definition at line 86 of file interval.cpp.
◆ setEstimatedEnd()
void Interval::setEstimatedEnd | ( | const QDateTime & | estimatedEnd | ) |
Definition at line 146 of file interval.cpp.
◆ setOpenEndTime()
void Interval::setOpenEndTime | ( | bool | openEndTime | ) |
Definition at line 102 of file interval.cpp.
◆ setState()
void Interval::setState | ( | State | state | ) |
Definition at line 121 of file interval.cpp.
◆ state()
Interval::State Interval::state | ( | ) | const |
The opening state for this time interval.
Definition at line 116 of file interval.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.