Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / winpopup / wpaccount.h
blobe77c2718437855c1cf3339e03ce238868b9d670e
1 /***************************************************************************
2 wpaccount.h - Base class for the Kopete WP account
3 -------------------
4 begin : Fri Apr 26 2002
5 copyright : (C) 2002 by Gav Wood
6 email : gav@indigoarchive.net
8 Based on code from : (C) 2002 by Duncan Mac-Vicar Prett
9 email : duncan@kde.org
10 ***************************************************************************/
12 /***************************************************************************
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 ***************************************************************************/
21 #ifndef WPACCOUNT_H
22 #define WPACCOUNT_H
25 // QT Includes
26 #include <qpixmap.h>
28 // KDE Includes
30 // Kopete Includes
31 #include "kopetemetacontact.h"
32 #include "kopeteaccount.h"
33 #include "kopeteonlinestatus.h"
35 // Local Includes
36 #include "wpcontact.h"
37 #include "wpaddcontact.h"
39 class KActionMenu;
40 class KAction;
41 class WPProtocol;
43 namespace Kopete
45 class StatusMessage;
47 /**
48 * The actual Account class used by Kopete.
50 class WPAccount : public Kopete::Account
52 Q_OBJECT
54 // Kopete::Account overloading
55 public:
56 WPAccount(WPProtocol *parent, const QString& accountID);
57 ~WPAccount();
59 virtual void fillActionMenu( KActionMenu *actionMenu ); // Per-protocol actions for the systray and the status bar
60 virtual bool hasCustomStatusMenu() const; //Has custom status menu
61 virtual void setAway(bool status, const QString &); // Set user away
63 public slots:
64 virtual void connect(const Kopete::OnlineStatus &); // Connect to server
65 virtual void disconnect(); // Disconnect from server
67 void goAvailable() { setAway(false, QString()); } // Two convenience slots
68 void goAway() { setAway(true, QString()); } // for available and away
70 // Stuff used internally & by colleague classes
71 public:
72 const QStringList getGroups();
73 const QStringList getHosts(const QString &Group);
75 // Stuff used by WPContact
76 public:
77 /**
78 * Returns whether or not the named host is online.
80 bool checkHost(const QString &Name);
82 public slots:
83 /**
84 * Dispatches said message to the destination.
86 void slotSendMessage(const QString &Body, const QString &Destination);
88 /**
89 * Called when a new message arrives with the message's data.
91 void slotGotNewMessage(const QString &Body, const QDateTime &Arrival, const QString &From);
93 /* Reimplemented from Kopete::Account */
94 void setOnlineStatus( const Kopete::OnlineStatus &status , const Kopete::StatusMessage &reason = Kopete::StatusMessage());
95 void setStatusMessage(const Kopete::StatusMessage& statusMessage);
97 protected:
98 virtual bool createContact(const QString &contactId, Kopete::MetaContact *parentContact);
100 private slots:
101 // void updateAccountId();
103 private:
104 WPProtocol *mProtocol;
105 QString theAwayMessage; // The message to give when the user is away
108 #endif
110 // vim: set noet ts=4 sts=4 sw=4:
111 // kate: tab-width 4; indent-width 4; replace-trailing-space-save on;