• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

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 <software@astrojar.org.uk>
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 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 
00163     bool operator==( const Duration &other ) const;
00164 
00169     bool operator!=( const Duration &other ) const
00170     { return !operator==( other ); }
00171 
00178     Duration &operator+=( const Duration &other );
00179 
00188     Duration operator+( const Duration &other ) const
00189     { return Duration( *this ) += other; }
00190 
00194     Duration operator-() const;
00195 
00203     Duration &operator-=( const Duration &other );
00204 
00213     Duration operator-( const Duration &other ) const
00214     { return Duration( *this ) += other; }
00215 
00220     Duration &operator*=( int value );
00221 
00228     Duration operator*( int value ) const
00229     { return Duration( *this ) *= value; }
00230 
00235     Duration &operator/=( int value );
00236 
00243     Duration operator/( int value ) const
00244     { return Duration( *this ) /= value; }
00245 
00253     KDateTime end( const KDateTime &start ) const;
00254 
00258     Type type() const;
00259 
00264     bool isDaily() const;
00265 
00269     int asSeconds() const;
00270 
00276     int asDays() const;
00277 
00283     int value() const;
00284 
00285   private:
00286     //@cond PRIVATE
00287     class Private;
00288     Private *const d;
00289     //@endcond
00290 };
00291 
00292 }
00293 
00294 #endif

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal