21 #ifndef KCAL_DURATION_H
22 #define KCAL_DURATION_H
24 #include <tqdatetime.h>
26 #include "libkcal_export.h"
60 Duration(
const TQDateTime &start,
const TQDateTime &end );
73 Duration(
const TQDateTime &start,
const TQDateTime &end, Type type );
81 Duration(
int duration, Type type = Seconds );
100 operator bool()
const;
111 bool operator<(
const Duration &other )
const;
118 {
return !other.operator<( *this ); }
126 {
return other.operator<( *this ); }
133 {
return !operator<( other ); }
142 bool operator==(
const Duration &other )
const;
152 {
return !operator==( other ); }
171 {
return Duration( *
this ) += other; }
196 {
return Duration( *
this ) += other; }
211 {
return Duration( *
this ) *= value; }
226 {
return Duration( *
this ) /= value; }
235 TQDateTime end(
const TQDateTime &start )
const;
246 bool isDaily()
const;
251 int asSeconds()
const;
268 int seconds()
const {
return mDaily ? mDuration * 86400 : mDuration; }
Duration operator/(int value) const
Divides a duration by a value.
Duration operator+(const Duration &other) const
Adds two durations.
Duration operator-(const Duration &other) const
Returns the difference between another duration and this.
Duration operator*(int value) const
Multiplies a duration by a value.
duration is a number of seconds
bool operator>(const Duration &other) const
Returns true if this duration is greater than the other.
bool operator!() const
Returns true if this duration is zero.
Type
The unit of time used to define the duration.
bool operator>=(const Duration &other) const
Returns true if this duration is greater than or equal to the other.
This class represents a duration.
bool operator<=(const Duration &other) const
Returns true if this duration is smaller than or equal to the other.
bool operator!=(const Duration &other) const
Returns true if this duration is not equal to the other.