home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcal / attendee.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-02-13  |  3.9 KB  |  163 lines

  1. /*
  2.     This file is part of libkcal.
  3.  
  4.     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
  5.  
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.  
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU Library General Public License
  17.     along with this library; see the file COPYING.LIB.  If not, write to
  18.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19.     Boston, MA 02110-1301, USA.
  20. */
  21.  
  22. #ifndef KCAL_ATTENDEE_H
  23. #define KCAL_ATTENDEE_H
  24.  
  25. #include <qstring.h>
  26. #include <qstringlist.h>
  27.  
  28. #include "listbase.h"
  29. #include "person.h"
  30.  
  31. namespace KCal {
  32.  
  33. /**
  34.   This class represents information related to an attendee of an event.
  35. */
  36. class LIBKCAL_EXPORT Attendee : public Person
  37. {
  38.   public:
  39.     enum PartStat { NeedsAction, Accepted, Declined, Tentative,
  40.                     Delegated, Completed, InProcess };
  41.     enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair };
  42.  
  43.     typedef ListBase<Attendee> List;
  44.  
  45.     /**
  46.       Create Attendee.
  47.  
  48.       @param name Name
  49.       @param email Email address
  50.       @param rsvp Request for reply
  51.       @param status Status (see enum for list)
  52.       @param role Role
  53.       @param u the uid for the attendee
  54.     */
  55.     Attendee( const QString &name, const QString &email,
  56.               bool rsvp = false, PartStat status = NeedsAction,
  57.               Role role = ReqParticipant, const QString &u = QString::null );
  58.     /**
  59.       Destruct Attendee.
  60.     */
  61.     virtual ~Attendee();
  62.  
  63.     /**
  64.       Set role of Attendee.
  65.     */
  66.     // FIXME: List of roles still has to be documented.
  67.     void setRole( Role );
  68.  
  69.     /**
  70.       Return role of Attendee.
  71.     */
  72.     Role role() const;
  73.  
  74.     /**
  75.       Return role as clear text string.
  76.     */
  77.     QString roleStr() const;
  78.     /**
  79.       Return string represenation of role.
  80.     */
  81.     static QString roleName( Role );
  82.     /**
  83.       Return string representations of all available roles.
  84.     */
  85.     static QStringList roleList();
  86.  
  87.     /**
  88.       Return unique id of the attendee.
  89.     */
  90.     QString uid() const;
  91.     /**
  92.       Set unique id of attendee.
  93.     */
  94.     void setUid ( const QString & );
  95.  
  96.     /**
  97.       Set status. See enum for definitions of possible values.
  98.     */
  99.     void setStatus( PartStat s );
  100.  
  101.     /**
  102.       Return status.
  103.     */
  104.     PartStat status() const;
  105.  
  106.     /**
  107.       Return status as human-readable string.
  108.     */
  109.     QString statusStr() const;
  110.     /**
  111.       Return string representation of attendee status.
  112.     */
  113.     static QString statusName( PartStat );
  114.     /**
  115.       Return string representations of all available attendee status values.
  116.     */
  117.     static QStringList statusList();
  118.  
  119.     /**
  120.       Set if Attendee is asked to reply.
  121.     */
  122.     void setRSVP( bool r ) { mRSVP = r; }
  123.     /**
  124.       Return, if Attendee is asked to reply.
  125.     */
  126.     bool RSVP() const { return mRSVP; }
  127.  
  128.     /**
  129.       Sets the delegate.
  130.     */
  131.     void setDelegate( const QString &delegate ) { mDelegate = delegate; }
  132.     /**
  133.       Returns the delegate.
  134.     */
  135.     QString delegate() const { return mDelegate; }
  136.  
  137.     /**
  138.       Sets the delegator.
  139.     */
  140.     void setDelegator( const QString &delegator ) { mDelegator = delegator; }
  141.     /**
  142.       Returns the delegator.
  143.     */
  144.     QString delegator() const { return mDelegator; }
  145.  
  146.   private:
  147.     bool mRSVP;
  148.     Role mRole;
  149.     PartStat mStatus;
  150.     QString mUid;
  151.     QString mDelegate;
  152.     QString mDelegator;
  153.  
  154.     class Private;
  155.     Private *d;
  156. };
  157.  
  158. bool operator==( const Attendee& a1, const Attendee& a2 );
  159.  
  160. }
  161.  
  162. #endif
  163.