libkcal Library API Documentation

attendee.cpp

00001 /* 00002 This file is part of libkcal. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #include <qstringlist.h> 00022 00023 #include <kdebug.h> 00024 #include <klocale.h> 00025 00026 #include "attendee.h" 00027 00028 using namespace KCal; 00029 00030 Attendee::Attendee(const QString &name, const QString &email, bool _rsvp, Attendee::PartStat s, 00031 Attendee::Role r,const QString &u) : 00032 Person(name,email) 00033 { 00034 mFlag = TRUE; 00035 mRSVP = _rsvp; 00036 mStatus = s; 00037 mRole = r; 00038 mUid = u; 00039 } 00040 00041 Attendee::~Attendee() 00042 { 00043 } 00044 00045 00046 bool KCal::operator==( const Attendee& a1, const Attendee& a2 ) 00047 { 00048 return ( operator==( (const Person&)a1, (const Person&) a2 ) && 00049 a1.RSVP() == a2.RSVP() && 00050 a1.role() == a2.role() && 00051 a1.status() == a2.status() && 00052 a1.uid() == a2.uid() ); 00053 } 00054 00055 00056 00057 void Attendee::setStatus(Attendee::PartStat s) 00058 { 00059 mStatus = s; 00060 } 00061 00062 Attendee::PartStat Attendee::status() const 00063 { 00064 return mStatus; 00065 } 00066 00067 QString Attendee::statusStr() const 00068 { 00069 return statusName(mStatus); 00070 } 00071 00072 QString Attendee::statusName( Attendee::PartStat s ) 00073 { 00074 switch (s) { 00075 default: 00076 case NeedsAction: 00077 return i18n("Needs Action"); 00078 break; 00079 case Accepted: 00080 return i18n("Accepted"); 00081 break; 00082 case Declined: 00083 return i18n("Declined"); 00084 break; 00085 case Tentative: 00086 return i18n("Tentative"); 00087 break; 00088 case Delegated: 00089 return i18n("Delegated"); 00090 break; 00091 case Completed: 00092 return i18n("Completed"); 00093 break; 00094 case InProcess: 00095 return i18n("In Process"); 00096 break; 00097 } 00098 } 00099 00100 QStringList Attendee::statusList() 00101 { 00102 QStringList list; 00103 list << statusName(NeedsAction); 00104 list << statusName(Accepted); 00105 list << statusName(Declined); 00106 list << statusName(Tentative); 00107 list << statusName(Delegated); 00108 list << statusName(Completed); 00109 list << statusName(InProcess); 00110 00111 return list; 00112 } 00113 00114 00115 void Attendee::setRole(Attendee::Role r) 00116 { 00117 mRole = r; 00118 } 00119 00120 Attendee::Role Attendee::role() const 00121 { 00122 return mRole; 00123 } 00124 00125 QString Attendee::roleStr() const 00126 { 00127 return roleName(mRole); 00128 } 00129 00130 void Attendee::setUid(QString uid) 00131 { 00132 mUid = uid; 00133 } 00134 00135 QString Attendee::uid() const 00136 { 00137 return mUid; 00138 } 00139 00140 QString Attendee::roleName( Attendee::Role r ) 00141 { 00142 switch (r) { 00143 case Chair: 00144 return i18n("Chair"); 00145 break; 00146 default: 00147 case ReqParticipant: 00148 return i18n("Participant"); 00149 break; 00150 case OptParticipant: 00151 return i18n("Optional Participant"); 00152 break; 00153 case NonParticipant: 00154 return i18n("Observer"); 00155 break; 00156 } 00157 } 00158 00159 QStringList Attendee::roleList() 00160 { 00161 QStringList list; 00162 list << roleName(ReqParticipant); 00163 list << roleName(OptParticipant); 00164 list << roleName(NonParticipant); 00165 list << roleName(Chair); 00166 00167 return list; 00168 }
KDE Logo
This file is part of the documentation for libkcal Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:43 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003