home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcal / period.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-02-13  |  1.9 KB  |  71 lines

  1. /*
  2.     This file is part of libkcal.
  3.  
  4.     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
  5.  
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.  
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU Library General Public License
  17.     along with this library; see the file COPYING.LIB.  If not, write to
  18.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.     Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KCAL_PERIOD_H
  22. #define KCAL_PERIOD_H
  23.  
  24. #include <qdatetime.h>
  25. #include "libkcal_export.h"
  26.  
  27. #include "duration.h"
  28.  
  29. namespace KCal {
  30.  
  31. /**
  32.   This class represents a period of time. The period can be defined by either a
  33.   start time and an end time or by a start time and a duration.
  34. */
  35. class KDE_EXPORT Period
  36. {
  37.   public:
  38.     Period();
  39.     Period( const QDateTime &start, const QDateTime &end );
  40.     Period( const QDateTime &start, const Duration &duration );
  41.  
  42.     /** Returns true if this element is smaller than the @param other one */
  43.     bool operator<( const Period& other );
  44.  
  45.     QDateTime start() const;
  46.     QDateTime end() const;
  47.     Duration duration();
  48.  
  49.     bool hasDuration()const;
  50.  
  51.     QString summary() const;
  52.     void setSummary( const QString &summary );
  53.     QString location() const;
  54.     void setLocation( const QString &location );
  55.  
  56.   private:
  57.     QDateTime mStart;
  58.     QDateTime mEnd;
  59.  
  60.     bool mHasDuration;
  61.     QString mSummary;
  62.     QString mLocation;
  63.  
  64.     class Private;
  65.     Private *d;
  66. };
  67.  
  68. }
  69.  
  70. #endif
  71.