summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/winpopup/wpaccount.h
blob: ae3744def2856984a902467e0620e0e05b5ad978 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/***************************************************************************
     wpaccount.h  -  Base class for the Kopete WP account
                             -------------------
    begin                : Fri Apr 26 2002
    copyright            : (C) 2002 by Gav Wood
    email                : gav@indigoarchive.net

    Based on code from   : (C) 2002 by Duncan Mac-Vicar Prett
    email                : duncan@kde.org
 ***************************************************************************/

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


// QT Includes
#include <tqpixmap.h>

// KDE Includes

// Kopete Includes
#include "kopetemetacontact.h"
#include "kopeteaccount.h"
#include "kopeteonlinestatus.h"

// Local Includes
#include "wpcontact.h"
#include "wpaddcontact.h"

class KPopupMenu;
class KActionMenu;
class KAction;
class WPProtocol;
class KopeteWinPopup;

/**
 * The actual Account class used by Kopete.
 */
class WPAccount : public Kopete::Account
{
	Q_OBJECT

// Kopete::Account overloading
public:
	WPAccount(WPProtocol *parent, const TQString& accountID, const char *name = 0);
	~WPAccount();

	virtual KActionMenu* actionMenu();			// Per-protocol actions for the systray and the status bar
	virtual void setAway(bool status, const TQString &);	// Set user away

public slots:
	virtual void connect(const Kopete::OnlineStatus &);						// Connect to server
	virtual void disconnect();					// Disconnect from server

	void goAvailable() { setAway(false, TQString::null); }		// Two convenience slots
	void goAway() { setAway(true, TQString::null); }			// for available and away

// Stuff used internally & by colleague classes
public:
	const TQStringList getGroups();
	const TQStringList getHosts(const TQString &Group);

// Stuff used by WPContact
public:
	/**
	 * Returns whether or not the named host is online.
	 */
	bool checkHost(const TQString &Name);

public slots:
	/**
	 * Dispatches said message to the destination.
	 */
	void slotSendMessage(const TQString &Body, const TQString &Destination);

	/**
	 * Called when a new message arrives with the message's data.
	 */
	void slotGotNewMessage(const TQString &Body, const TQDateTime &Arrival, const TQString &From);

	/* Reimplemented from Kopete::Account */
	void setOnlineStatus( const Kopete::OnlineStatus &status , const TQString &reason = TQString::null);

protected:
	virtual bool createContact(const TQString &contactId, Kopete::MetaContact *parentContact);

private slots:
//	void updateAccountId();

private:
	WPProtocol *mProtocol;
	TQString theAwayMessage;			// The message to give when the user is away
};

#endif

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