From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/irc/ircusercontact.h | 146 ++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 kopete/protocols/irc/ircusercontact.h (limited to 'kopete/protocols/irc/ircusercontact.h') diff --git a/kopete/protocols/irc/ircusercontact.h b/kopete/protocols/irc/ircusercontact.h new file mode 100644 index 00000000..3373fa9c --- /dev/null +++ b/kopete/protocols/irc/ircusercontact.h @@ -0,0 +1,146 @@ +/* + ircusercontact.h - IRC User Contact + + Copyright (c) 2002 by Nick Betcher + Copyright (c) 2003 by Jason Keirstead + + ************************************************************************* + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ************************************************************************* +*/ + +#ifndef IRCUSERCONTACT_H +#define IRCUSERCONTACT_H + +#include "kopetechatsessionmanager.h" +#include "irccontact.h" +#include "kopeteonlinestatus.h" + +class QTimer; + +class KActionCollection; +class KAction; +class KActionMenu; +class KCodecAction; + +class IRCContactManager; +class IRCChannelContact; + +struct IRCUserInfo +{ + QString userName; + QString hostName; + QString realName; + QString serverName; + QString serverInfo; + QString flags; + QStringList channels; + unsigned long idle; + bool isOperator; + bool isIdentified; + bool away; + bool online; + uint hops; + QDateTime lastOnline; + QTime lastUpdate; +}; + +/** + * @author Jason Keirstead *customContextMenuActions( Kopete::ChatSession *manager ); + virtual const QString caption() const; + + void setAway(bool isAway); + + QString formattedName() const; + + //Methods handled by the signal mapper + void incomingUserIsAway(const QString &message ); + void userOnline(); + void newAction( const QString &from, const QString &action ); + void newWhoIsUser(const QString &username, const QString &hostname, const QString &realname); + void newWhoIsServer(const QString &server, const QString &serverInfo); + void newWhoIsOperator(); + void newWhoIsIdentified(); + void newWhoIsIdle(unsigned long seconds); + void newWhoIsChannels(const QString &channel); + void whoIsComplete(); + void whoWasComplete(); + void newWhoReply( const QString &channel, const QString &user, const QString &host, + const QString &server, bool away, const QString &flags, uint hops, + const QString &realName ); + +public slots: + /** \brief Updates online status for channels based on current internal status. + */ + virtual void updateStatus(); + + virtual void sendFile(const KURL &sourceURL, const QString&, unsigned int); + +protected slots: + virtual void privateMessage(IRCContact *from, IRCContact *to, const QString &message); + +private slots: + void slotOp(); + void slotDeop(); + void slotVoice(); + void slotDevoice(); + void slotCtcpPing(); + void slotCtcpVersion(); + void slotBanHost(); + void slotBanUserHost(); + void slotBanDomain(); + void slotBanUserDomain(); + void slotKick(); + void slotUserOffline(); + + void slotBanHostOnce(); + void slotBanUserHostOnce(); + void slotBanDomainOnce(); + void slotBanUserDomainOnce(); + + virtual void slotUserInfo(); + + //This can't be handled by the contact manager since + void slotIncomingModeChange(const QString &nick, const QString &channel, const QString &mode); + +private: + enum bitAdjustment { RemoveBits, AddBits }; + void adjustInternalOnlineStatusBits(IRCChannelContact *channel, unsigned statusAdjustment, bitAdjustment adj); + + void contactMode(const QString &mode); + void updateInfo(); + + KActionMenu *actionModeMenu; + KActionMenu *actionCtcpMenu; + KAction *actionKick; + KActionMenu *actionBanMenu; + KCodecAction *codecAction; + Kopete::ChatSession *mActiveManager; + QTimer *mOnlineTimer; + IRCUserInfo mInfo; +}; + +#endif + +// vim: set noet ts=4 sts=4 tw=4: -- cgit v1.2.3