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
|
/*
ircusercontact.h - IRC User Contact
Copyright (c) 2002 by Nick Betcher <[email protected]>
Copyright (c) 2003 by Jason Keirstead <[email protected]
Kopete (c) 2002 by the Kopete developers <[email protected]>
*************************************************************************
* *
* 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 TQTimer;
class TDEActionCollection;
class TDEAction;
class TDEActionMenu;
class KCodecAction;
class IRCContactManager;
class IRCChannelContact;
struct IRCUserInfo
{
TQString userName;
TQString hostName;
TQString realName;
TQString serverName;
TQString serverInfo;
TQString flags;
TQStringList channels;
unsigned long idle;
bool isOperator;
bool isIdentified;
bool away;
bool online;
uint hops;
TQDateTime lastOnline;
TQTime lastUpdate;
};
/**
* @author Jason Keirstead <[email protected]
*
* This class is the @ref Kopete::Contact object representing IRC Users, not channels.
* It is derrived from IRCContact where much of its functionality is shared with @ref IRCChannelContact.
*/
class IRCUserContact : public IRCContact
{
TQ_OBJECT
public:
// This class provides a Kopete::Contact for each user on the channel.
IRCUserContact(IRCContactManager *, const TQString &nickname, Kopete::MetaContact *mc);
// Kopete::Contact stuff
virtual TQPtrList<TDEAction> *customContextMenuActions( Kopete::ChatSession *manager );
virtual const TQString caption() const;
void setAway(bool isAway);
TQString formattedName() const;
//Methods handled by the signal mapper
void incomingUserIsAway(const TQString &message );
void userOnline();
void newAction( const TQString &from, const TQString &action );
void newWhoIsUser(const TQString &username, const TQString &hostname, const TQString &realname);
void newWhoIsServer(const TQString &server, const TQString &serverInfo);
void newWhoIsOperator();
void newWhoIsIdentified();
void newWhoIsIdle(unsigned long seconds);
void newWhoIsChannels(const TQString &channel);
void whoIsComplete();
void whoWasComplete();
void newWhoReply( const TQString &channel, const TQString &user, const TQString &host,
const TQString &server, bool away, const TQString &flags, uint hops,
const TQString &realName );
public slots:
/** \brief Updates online status for channels based on current internal status.
*/
virtual void updateStatus();
virtual void sendFile(const KURL &sourceURL, const TQString&, unsigned int);
protected slots:
virtual void privateMessage(IRCContact *from, IRCContact *to, const TQString &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 TQString &nick, const TQString &channel, const TQString &mode);
private:
enum bitAdjustment { RemoveBits, AddBits };
void adjustInternalOnlineStatusBits(IRCChannelContact *channel, unsigned statusAdjustment, bitAdjustment adj);
void contactMode(const TQString &mode);
void updateInfo();
TDEActionMenu *actionModeMenu;
TDEActionMenu *actionCtcpMenu;
TDEAction *actionKick;
TDEActionMenu *actionBanMenu;
KCodecAction *codecAction;
Kopete::ChatSession *mActiveManager;
TQTimer *mOnlineTimer;
IRCUserInfo mInfo;
};
#endif
|