• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KCalCore Library

freebusy.h
Go to the documentation of this file.
00001 /*
00002   This file is part of the kcalcore library.
00003 
00004   Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005   Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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 KCALCORE_FREEBUSY_H
00032 #define KCALCORE_FREEBUSY_H
00033 
00034 #include "kcalcore_export.h"
00035 #include "event.h"
00036 #include "freebusyperiod.h"
00037 #include "incidencebase.h"
00038 #include "period.h"
00039 
00040 #include <QtCore/QMetaType>
00041 
00042 namespace KCalCore {
00043 
00044 class FreeBusy;
00045 
00052 class KCALCORE_EXPORT FreeBusy : public IncidenceBase
00053 {
00054   friend KCALCORE_EXPORT QDataStream &operator<<( QDataStream &s,
00055                                                   const KCalCore::FreeBusy::Ptr &freebusy );
00056   friend KCALCORE_EXPORT QDataStream &operator>>( QDataStream &s,
00057                                                   KCalCore::FreeBusy::Ptr &freebusy );
00058 
00059   public:
00060 
00064     typedef QSharedPointer<FreeBusy> Ptr;
00065 
00069     typedef QVector<Ptr> List;
00070 
00074     FreeBusy();
00075 
00080     FreeBusy( const FreeBusy &other );
00081 
00086     explicit FreeBusy( const Period::List &busyPeriods );
00087 
00092     explicit FreeBusy( const FreeBusyPeriod::List &busyPeriods );
00093 
00100     FreeBusy( const KDateTime &start, const KDateTime &end );
00101 
00109     FreeBusy( const Event::List &events, const KDateTime &start, const KDateTime &end );
00110 
00114     ~FreeBusy();
00115 
00120     IncidenceType type() const;
00121 
00126     QByteArray typeStr() const;
00127 
00135     virtual void setDtStart( const KDateTime &start );
00136 
00144     void setDtEnd( const KDateTime &end );
00145 
00151     virtual KDateTime dtEnd() const;
00152 
00157     virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00158                              const KDateTime::Spec &newSpec );
00159 
00163     Period::List busyPeriods() const;
00164 
00168     FreeBusyPeriod::List fullBusyPeriods() const;
00169 
00176     void addPeriod( const KDateTime &start, const KDateTime &end );
00177 
00184     void addPeriod( const KDateTime &start, const Duration &duration );
00185 
00193     void addPeriods( const Period::List &list );
00194 
00202     void addPeriods( const FreeBusyPeriod::List &list );
00203 
00207     void sortList();
00208 
00214     void merge( FreeBusy::Ptr freebusy );
00215 
00220     KDateTime dateTime( DateTimeRole role ) const;
00221 
00226     void setDateTime( const KDateTime &dateTime, DateTimeRole role );
00227 
00232     QLatin1String mimeType() const;
00233 
00237     static QLatin1String freeBusyMimeType();
00238 
00239   protected:
00244     virtual bool equals( const IncidenceBase &freebusy ) const;
00245 
00250     virtual IncidenceBase &assign( const IncidenceBase &other );
00251 
00256     virtual void virtual_hook( int id, void *data );
00257 
00258   private:
00263     bool accept( Visitor &v, IncidenceBase::Ptr incidence );
00264 
00271     FreeBusy &operator=( const FreeBusy &other );
00272 
00273     //@cond PRIVATE
00274     class Private;
00275     Private *const d;
00276     //@endcond
00277 };
00278 
00282 KCALCORE_EXPORT QDataStream &operator<<( QDataStream &stream,
00283                                          const KCalCore::FreeBusy::Ptr &freebusy );
00287 KCALCORE_EXPORT QDataStream &operator>>( QDataStream &stream,
00288                                          KCalCore::FreeBusy::Ptr &freebusy );
00289 }
00290 
00291 //@cond PRIVATE
00292 Q_DECLARE_TYPEINFO( KCalCore::FreeBusy::Ptr, Q_MOVABLE_TYPE );
00293 Q_DECLARE_METATYPE( KCalCore::FreeBusy::Ptr )
00294 //@endcond
00295 
00296 #endif

KCalCore Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.6.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