KCalCore Library
freebusyperiod.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00033 #include "freebusyperiod.h"
00034
00035 using namespace KCalCore;
00036
00037
00038 class KCalCore::FreeBusyPeriod::Private
00039 {
00040 public:
00041 Private() {}
00042
00043 QString mSummary;
00044 QString mLocation;
00045 };
00046
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
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