00001 #ifndef DURATION_H 00002 #define DURATION_H 00003 00004 #include <tools/global.h> 00005 00006 class QDateTime; 00007 00008 namespace domain 00009 { 00010 00011 struct DurationPrivate; 00012 00019 class DOMAIN_EXPORT Duration 00020 { 00021 public: 00022 00028 Duration(int seconds = 1); 00029 00030 00040 Duration(int weeks, int days, int hours = 0, 00041 int minutes = 0, int seconds = 0); 00042 00046 int weeks() const; 00047 00051 int days() const; 00052 00056 int hours() const; 00057 00061 int minutes() const; 00062 00066 int seconds() const; 00067 00071 int totalSeconds() const; 00072 00076 QString toString() const; 00077 00081 bool operator==(const Duration& other) const; 00082 00086 bool operator<(const Duration& other) const; 00087 00091 bool operator>(const Duration& other) const; 00092 00093 private: 00094 00095 int secs; 00096 }; 00097 00098 } 00099 00105 QDateTime operator+(const QDateTime& left, const domain::Duration& right); 00106 00107 #endif