KCalCore Library
freebusyperiod.cpp
Go to the documentation of this file.
00001 /* 00002 This file is part of the kcalcore library. 00003 00004 Copyright (c) 2001 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 */ 00033 #include "freebusyperiod.h" 00034 00035 using namespace KCalCore; 00036 00037 //@cond PRIVATE 00038 class KCalCore::FreeBusyPeriod::Private 00039 { 00040 public: 00041 Private() {} 00042 00043 QString mSummary; 00044 QString mLocation; 00045 }; 00046 //@endcond 00047 00048 FreeBusyPeriod::FreeBusyPeriod() : Period(), d( new KCalCore::FreeBusyPeriod::Private() ) 00049 { 00050 } 00051 00052 FreeBusyPeriod::FreeBusyPeriod( const KDateTime &start, const KDateTime &end ) 00053 : Period( start, end ), d( new KCalCore::FreeBusyPeriod::Private() ) 00054 { 00055 } 00056 00057 FreeBusyPeriod::FreeBusyPeriod( const KDateTime &start, const Duration &duration ) 00058 : Period( start, duration ), d( new KCalCore::FreeBusyPeriod::Private() ) 00059 { 00060 } 00061 00062 FreeBusyPeriod::FreeBusyPeriod( const FreeBusyPeriod &period ) 00063 : Period( period ), d( new KCalCore::FreeBusyPeriod::Private( *period.d ) ) 00064 { 00065 } 00066 00067 FreeBusyPeriod::FreeBusyPeriod( const Period &period ) 00068 : Period( period ), d( new KCalCore::FreeBusyPeriod::Private() ) 00069 { 00070 } 00071 00072 FreeBusyPeriod::~FreeBusyPeriod() 00073 { 00074 delete d; 00075 } 00076 00077 FreeBusyPeriod &FreeBusyPeriod::operator=( const FreeBusyPeriod &other ) 00078 { 00079 // check for self assignment 00080 if ( &other == this ) { 00081 return *this; 00082 } 00083 00084 Period::operator=(other); 00085 *d = *other.d; 00086 return *this; 00087 } 00088 00089 QString FreeBusyPeriod::summary() const 00090 { 00091 return d->mSummary; 00092 } 00093 00094 void FreeBusyPeriod::setSummary( const QString &summary ) 00095 { 00096 d->mSummary = summary; 00097 } 00098 00099 QString FreeBusyPeriod::location() const 00100 { 00101 return d->mLocation; 00102 } 00103 00104 void FreeBusyPeriod::setLocation( const QString &location ) 00105 { 00106 d->mLocation = location; 00107 } 00108 00109 QDataStream &KCalCore::operator<<( QDataStream &stream, const KCalCore::FreeBusyPeriod &period ) 00110 { 00111 KCalCore::Period periodParent = static_cast<KCalCore::Period>( period ); 00112 stream << periodParent; 00113 stream << period.summary() << period.location(); 00114 return stream; 00115 } 00116 00117 QDataStream &KCalCore::operator>>( QDataStream &stream, FreeBusyPeriod &period ) 00118 { 00119 KCalCore::Period periodParent; 00120 QString summary, location; 00121 00122 stream >> periodParent >> summary >> location; 00123 00124 period = periodParent; 00125 period.setLocation( location ); 00126 period.setSummary( summary ); 00127 return stream; 00128 } 00129
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:35:39 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:35:39 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.