libkcal

attendee.h

Go to the documentation of this file.
00001 /*
00002     This file is part of libkcal.
00003 
00004     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KCAL_ATTENDEE_H
00023 #define KCAL_ATTENDEE_H
00024 
00025 #include <qstring.h>
00026 #include <qstringlist.h>
00027 
00028 #include "listbase.h"
00029 #include "person.h"
00030 
00031 namespace KCal {
00032 
00036 class LIBKCAL_EXPORT Attendee : public Person
00037 {
00038   public:
00039     enum PartStat { NeedsAction, Accepted, Declined, Tentative,
00040                     Delegated, Completed, InProcess };
00041     enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair };
00042 
00043     typedef ListBase<Attendee> List;
00044 
00055     Attendee( const QString &name, const QString &email,
00056               bool rsvp = false, PartStat status = NeedsAction,
00057               Role role = ReqParticipant, const QString &u = QString::null );
00061     virtual ~Attendee();
00062 
00066     // FIXME: List of roles still has to be documented.
00067     void setRole( Role );
00068 
00072     Role role() const;
00073 
00077     QString roleStr() const;
00081     static QString roleName( Role );
00085     static QStringList roleList();
00086 
00090     QString uid() const;
00094     void setUid ( const QString & );
00095 
00099     void setStatus( PartStat s );
00100 
00104     PartStat status() const;
00105 
00109     QString statusStr() const;
00113     static QString statusName( PartStat );
00117     static QStringList statusList();
00118 
00122     void setRSVP( bool r ) { mRSVP = r; }
00126     bool RSVP() const { return mRSVP; }
00127 
00131     void setDelegate( const QString &delegate ) { mDelegate = delegate; }
00135     QString delegate() const { return mDelegate; }
00136 
00140     void setDelegator( const QString &delegator ) { mDelegator = delegator; }
00144     QString delegator() const { return mDelegator; }
00145 
00146   private:
00147     bool mRSVP;
00148     Role mRole;
00149     PartStat mStatus;
00150     QString mUid;
00151     QString mDelegate;
00152     QString mDelegator;
00153 
00154     class Private;
00155     Private *d;
00156 };
00157 
00158 bool operator==( const Attendee& a1, const Attendee& a2 );
00159 
00160 }
00161 
00162 #endif