summaryrefslogtreecommitdiffstats
path: root/libkcal/attendee.h
blob: f460665b6f6e3aef638e44e00cfb3c3108dae03c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
    This file is part of libkcal.

    Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#ifndef KCAL_ATTENDEE_H
#define KCAL_ATTENDEE_H

#include <tqstring.h>
#include <tqstringlist.h>

#include "listbase.h"
#include "person.h"

namespace KCal {

/**
  This class represents information related to an attendee of an event.
*/
class LIBKCAL_EXPORT Attendee : public Person
{
  public:
    enum PartStat { NeedsAction, Accepted, Declined, Tentative,
                    Delegated, Completed, InProcess };
    enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair };

    typedef ListBase<Attendee> List;

    /**
      Create Attendee.

      @param name Name
      @param email Email address
      @param rsvp Request for reply
      @param status Status (see enum for list)
      @param role Role
      @param u the uid for the attendee
    */
    Attendee( const TQString &name, const TQString &email,
              bool rsvp = false, PartStat status = NeedsAction,
              Role role = ReqParticipant, const TQString &u = TQString::null );
    /**
      Destruct Attendee.
    */
    virtual ~Attendee();

    /**
      Set role of Attendee.
    */
    // FIXME: List of roles still has to be documented.
    void setRole( Role );

    /**
      Return role of Attendee.
    */
    Role role() const;

    /**
      Return role as clear text string.
    */
    TQString roleStr() const;
    /**
      Return string represenation of role.
    */
    static TQString roleName( Role );
    /**
      Return string representations of all available roles.
    */
    static TQStringList roleList();

    /**
      Return unique id of the attendee.
    */
    TQString uid() const;
    /**
      Set unique id of attendee.
    */
    void setUid ( const TQString & );

    /**
      Set status. See enum for definitions of possible values.
    */
    void setStatus( PartStat s );

    /**
      Return status.
    */
    PartStat status() const;

    /**
      Return status as human-readable string.
    */
    TQString statusStr() const;
    /**
      Return string representation of attendee status.
    */
    static TQString statusName( PartStat );
    /**
      Return string representations of all available attendee status values.
    */
    static TQStringList statusList();

    /**
      Set if Attendee is asked to reply.
    */
    void setRSVP( bool r ) { mRSVP = r; }
    /**
      Return, if Attendee is asked to reply.
    */
    bool RSVP() const { return mRSVP; }

    /**
      Sets the delegate.
    */
    void setDelegate( const TQString &delegate ) { mDelegate = delegate; }
    /**
      Returns the delegate.
    */
    TQString delegate() const { return mDelegate; }

    /**
      Sets the delegator.
    */
    void setDelegator( const TQString &delegator ) { mDelegator = delegator; }
    /**
      Returns the delegator.
    */
    TQString delegator() const { return mDelegator; }

  private:
    bool mRSVP;
    Role mRole;
    PartStat mStatus;
    TQString mUid;
    TQString mDelegate;
    TQString mDelegator;

    class Private;
    Private *d;
};

bool operator==( const Attendee& a1, const Attendee& a2 );

}

#endif