2 ircchannelcontact.h - IRC Channel Contact
4 Copyright (c) 2002 by Nick Betcher <nbetcher@kde.org>
5 Copyright (c) 2003 by Jason Keirstead <jason@keirstead.org>
7 Kopete (c) 2002 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 *************************************************************************
19 #ifndef IRCCONTACT_CHANNEL_H
20 #define IRCCONTACT_CHANNEL_H
22 #include "irccontact.h"
38 * @author Jason Keirstead <jason@keirstead.org>
40 * This class is the @ref Kopete::Contact object representing IRC Channels, not users.
41 * It is derrived from IRCContact where much of its functionality is shared with @ref IRCUserContact.
43 class IRCChannelContact
46 friend class IRCSignalMapper
;
49 IRCChannelContact(IRCAccount
*, KIRC::EntityPtr entity
, Kopete::MetaContact
*metac
);
53 * Returns the current topic for this channel.
55 const QString
&topic() const { return mTopic
; };
57 /* Set password for a channel */
58 void setPassword(const QString
&password
) { mPassword
= password
; }
59 /* Get password for a channel */
60 const QString
&password() const { return mPassword
; }
63 * Returns if a mode is enabled for this channel.
64 * @param mode The mode you want to check ( 't', 'n', etc. )
65 * @param value This is a pointer to a QString which is set to
66 * the value of the mode if it has one. Example, the mode 'l' or
67 * the mode 'k'. If the mode has no such value then the pointer
68 * is always returned null.
70 bool modeEnabled( QChar mode
, QString
*value
= 0 );
72 // Kopete::Contact stuff
73 virtual QList
<KAction
*> *customContextMenuActions();
74 virtual const QString
caption() const;
76 //Methods handled by the signal mapper
77 void userJoinedChannel(const QString
&user
);
78 void userPartedChannel(const QString
&user
, const QString
&reason
);
79 void userKicked(const QString
&nick
, const QString
&nickKicked
, const QString
&reason
);
80 void channelTopic(const QString
&topic
);
81 void channelHomePage(const QString
&url
);
82 void topicChanged(const QString
&nick
, const QString
&newtopic
);
83 void topicUser(const QString
&nick
, const QDateTime
&time
);
84 void namesList(const QStringList
&nicknames
);
86 void incomingModeChange(const QString
&nick
, const QString
&mode
);
87 void incomingChannelMode(const QString
&mode
, const QString
¶ms
);
89 void failedChanBanned();
90 void failedChanInvite();
91 void failedChanFull();
97 * Sets the topic of this channel
98 * @param topic The topic you want set
100 void setTopic( const QString
&topic
= QString() );
103 * Sets or unsets a mode on this channel
104 * @param mode The full text of the mode change you want performed
106 void setMode( const QString
&mode
= QString() );
113 void chatSessionDestroyed();
115 virtual void initConversation();
118 void slotIncomingUserIsAway( const QString
&nick
, const QString
&reason
);
119 void slotModeChanged();
120 void slotAddNicknames();
121 void slotConnectedToServer();
122 void slotUpdateInfo();
124 void slotChannelListed(const QString
&channel
, uint members
, const QString
&topic
);
130 KAction
*actionTopic
;
131 KAction
*actionHomePage
;
132 KActionMenu
*actionModeMenu
;
133 KCodecAction
*codecAction
;
135 KToggleAction
*actionModeT
;
136 KToggleAction
*actionModeN
;
137 KToggleAction
*actionModeS
;
138 KToggleAction
*actionModeI
;
139 KToggleAction
*actionModeP
;
140 KToggleAction
*actionModeM
;
141 KToggleAction
*actionModeB
;
145 QStringList mJoinedNicks
;
146 QMap
<QString
,bool> modeMap
;
149 void toggleMode( QChar mode
, bool enabled
, bool update
);
152 #endif // IRCCONTACT_CHANNEL_H