Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / winpopup / wpprotocol.h
blob499ebde146d869cc65b3d1774101e1f8074e839e
1 /***************************************************************************
2 wpprotocol.h - Base class for the Kopete WP protocol
3 -------------------
4 begin : Fri Apr 26 2002
5 copyright : (C) 2002 by Gav Wood
6 email : gav@kde.org
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 WPPROTOCOL_H
22 #define WPPROTOCOL_H
24 // QT Includes
25 #include <qpixmap.h>
26 #include <qdatetime.h>
28 // Kopete Includes
29 #include "kopetemetacontact.h"
30 #include "kopeteprotocol.h"
31 #include "kopeteonlinestatus.h"
33 // Local Includes
34 #include "libwinpopup.h"
35 #include "wpaddcontact.h"
37 namespace Kopete { class Account; }
39 /**
40 * The actual Protocol class used by Kopete.
42 class WPProtocol : public Kopete::Protocol
44 Q_OBJECT
46 // Kopete::Protocol overloading
47 public:
48 WPProtocol( QObject *parent, const QVariantList & );
49 ~WPProtocol();
51 virtual AddContactPage *createAddContactWidget(QWidget *parent, Kopete::Account *theAccount);
52 virtual KopeteEditAccountWidget *createEditAccountWidget(Kopete::Account *account, QWidget *parent);
53 virtual Kopete::Account *createNewAccount(const QString &accountId);
55 const QStringList getGroups() {return popupClient->getGroups(); }
56 const QStringList getHosts(const QString &Group) { return popupClient->getHosts(Group); }
57 bool checkHost(const QString &Name) { return popupClient->checkHost(Name); }
59 // Kopete::Plugin overloading
60 public:
61 virtual Kopete::Contact *deserializeContact(Kopete::MetaContact *metaContact, const QMap<QString, QString> &serializedData, const QMap<QString, QString> &addressBookData);
63 // Stuff used internally & by colleague classes
64 public:
65 static WPProtocol *protocol() { return sProtocol; }
67 const Kopete::OnlineStatus WPOnline;
68 const Kopete::OnlineStatus WPAway;
69 const Kopete::OnlineStatus WPOffline;
70 void sendMessage(const QString &Body, const QString &Destination);
71 void settingsChanged(void); // Callback when settings changed
73 public slots:
74 void installSamba(); // Modify smb.conf to use winpopup-send.sh script
75 void slotReceivedMessage(const QString &Body, const QDateTime &Time, const QString &From);
77 private:
78 QString smbClientBin;
79 int groupCheckFreq;
80 void readConfig();
81 WinPopupLib *popupClient;
82 static WPProtocol *sProtocol; // Singleton
85 #endif
87 // vim: set noet ts=4 sts=4 sw=4:
88 // kate: tab-width 4; indent-width 4; replace-trailing-space-save on;