KCal Library
duration.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the kcal library. 00003 00004 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org> 00005 Copyright (c) 2007 David Jarvie <djarvie@kde.org> 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public License 00018 along with this library; see the file COPYING.LIB. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 00021 */ 00031 #ifndef KCAL_DURATION_H 00032 #define KCAL_DURATION_H 00033 00034 #include "kcal_export.h" 00035 00036 class KDateTime; 00037 00038 namespace KCal { 00039 00052 class KCAL_EXPORT_DEPRECATED Duration 00053 { 00054 public: 00058 enum Type { 00059 Seconds, 00060 Days 00061 }; 00062 00066 Duration(); 00067 00079 Duration( const KDateTime &start, const KDateTime &end ); 00080 00092 Duration( const KDateTime &start, const KDateTime &end, Type type ); 00093 00100 Duration( int duration, Type type = Seconds ); //krazy:exclude=explicit 00101 00107 Duration( const Duration &duration ); 00108 00112 ~Duration(); 00113 00119 Duration &operator=( const Duration &duration ); 00120 00124 operator bool() const; 00125 00129 bool operator!() const { return !operator bool(); } 00130 00135 bool operator<( const Duration &other ) const; 00136 00141 bool operator<=( const Duration &other ) const 00142 { return !other.operator<( *this ); } 00143 00148 bool operator>( const Duration &other ) const 00149 { return other.operator<( *this ); } 00150 00155 bool operator>=( const Duration &other ) const 00156 { return !operator<( other ); } 00157 00165 bool operator==( const Duration &other ) const; 00166 00174 bool operator!=( const Duration &other ) const 00175 { return !operator==( other ); } 00176 00183 Duration &operator+=( const Duration &other ); 00184 00193 Duration operator+( const Duration &other ) const 00194 { return Duration( *this ) += other; } 00195 00199 Duration operator-() const; 00200 00208 Duration &operator-=( const Duration &other ); 00209 00218 Duration operator-( const Duration &other ) const 00219 { return Duration( *this ) += other; } 00220 00225 Duration &operator*=( int value ); 00226 00233 Duration operator*( int value ) const 00234 { return Duration( *this ) *= value; } 00235 00240 Duration &operator/=( int value ); 00241 00248 Duration operator/( int value ) const 00249 { return Duration( *this ) /= value; } 00250 00258 KDateTime end( const KDateTime &start ) const; 00259 00263 Type type() const; 00264 00269 bool isDaily() const; 00270 00274 int asSeconds() const; 00275 00281 int asDays() const; 00282 00288 int value() const; 00289 00290 private: 00291 //@cond PRIVATE 00292 class Private; 00293 Private *const d; 00294 //@endcond 00295 }; 00296 00297 } 00298 00299 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 22:19:46 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 22:19:46 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.