summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/winpopup/wpcontact.h
blob: 8acd723532fb87e10ca8a1d1b939ad36112c46f8 (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
/***************************************************************************
                          wpcontact.h  -  description
                             -------------------
    begin                : Fri Apr 12 2002
    copyright            : (C) 2002 by Gav Wood
    email                : gav@indigoarchive.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 WPCONTACT_H
#define WPCONTACT_H

// KDE Includes
#include <kaction.h>

// TQt Includes
//#include <tqvaluestack.h>
#include <tqdatetime.h>
#include <tqptrlist.h>
#include <tqtimer.h>
#include <tqstringlist.h>

// Kopete Includes
#include "kopetecontact.h"
#include "kopetecontactlist.h"
#include "kopetechatsessionmanager.h"
#include "kopetechatsession.h"
#include "kopetemessage.h"

// Local Includes
#include "wpprotocol.h"
#include "wpuserinfo.h"

class TQTimer;
class TQListView;
class TQListViewItem;
class KPopupMenu;
class KAction;
namespace Kopete { class MetaContact; }

class WPContact: public Kopete::Contact
{
	Q_OBJECT
  TQ_OBJECT

public:
	WPContact(Kopete::Account *account, const TQString &userId, const TQString &fullName, Kopete::MetaContact *metaContact);

//	virtual bool isOnline() const;
	virtual bool isReachable();
	virtual TQPtrList<KAction> *customContextMenuActions();
	virtual Kopete::ChatSession *manager(Kopete::Contact::CanCreateFlags = Kopete::Contact::CannotCreate);
	virtual void serialize(TQMap<TQString, TQString> &serializedData, TQMap<TQString, TQString> &addressBookData);

public slots:
	virtual void slotUserInfo();
	void slotCheckStatus();	// the call back for the checkStatus timer
	void slotNewMessage(const TQString &Body, const TQDateTime &Arrival);

private slots:
	void slotChatSessionDestroyed();
	void slotSendMessage(Kopete::Message &message);
	void slotCloseUserInfoDialog(); // Called when the userinfo dialog is getting closed

private:
	bool myWasConnected;	// true if protocol connected at last check

	TQTimer checkStatus;		// checks the status of this contact every second or so
//	KActionCollection *myActionCollection;
							// holds all the protocol specific actions (not many!)
	Kopete::ChatSession *m_manager;
							// holds the two message managers - one for email and one for chat
	WPUserInfo *m_infoDialog;
};

#endif

// vim: set noet ts=4 sts=4 sw=4:
// kate: tab-width 4; indent-width 4; replace-trailing-space-save on;