1
/*
2
 *  The Mana World
3
 *  Copyright (C) 2004  The Mana World Development Team
4
 *
5
 *  This file is part of The Mana World.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program; if not, write to the Free Software
19
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 */
21
22
#ifndef CHANNEL_H
23
#define CHANNEL_H
24
25
#include <string>
26
27
class ChannelTab;
28
29
class Channel
30
{
31
    public:
32
        /**
33
         * Constructor.
34
         *
35
         * @param id           the id associated with the channel.
36
         * @param name         the name of the channel.
37
         * @param announcement a welcome message.
38
         */
39
        Channel(short id,
40
                const std::string &name,
41
                const std::string &announcement = std::string());
42
43
        ~Channel();
44
45
        /**
46
         * Get the id associated witht his channel.
47
         */
48
        int getId() const { return mId; }
49
50
         /**
51
         * Get this channel's name.
52
         */
53
        const std::string &getName() const
54
        { return mName; }
55
56
        /**
57
         * Get the announcement message for this channel.
58
         */
59
        const std::string &getAnnouncement() const
60
        { return mAnnouncement; }
61
62
        /**
63
         * Sets the name of the channel.
64
         */
65
        void setName(const std::string &channelName)
66
        { mName = channelName; }
67
68
        /**
69
         * Sets the announcement string of the channel.
70
         */
71
        void setAnnouncement(const std::string &channelAnnouncement)
72
        { mAnnouncement = channelAnnouncement; }
73
74
        ChannelTab *getTab() { return mTab; }
75
76
    protected:
77
        friend class ChannelTab;
78
        void setTab(ChannelTab *tab) { mTab = tab; }
79
80
    private:
81
        unsigned short mId;
82
        std::string mName;
83
        std::string mAnnouncement;
84
        ChannelTab *mTab;
85
};
86
87
#endif // CHANNEL_H