1 /***************************************************************************
2 wpprotocol.h - Base class for the Kopete WP protocol
4 begin : Fri Apr 26 2002
5 copyright : (C) 2002 by Gav Wood
8 Based on code from : (C) 2002 by Duncan Mac-Vicar Prett
10 ***************************************************************************/
12 /***************************************************************************
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. *
19 ***************************************************************************/
26 #include <qdatetime.h>
29 #include "kopetemetacontact.h"
30 #include "kopeteprotocol.h"
31 #include "kopeteonlinestatus.h"
34 #include "libwinpopup.h"
35 #include "wpaddcontact.h"
37 namespace Kopete
{ class Account
; }
40 * The actual Protocol class used by Kopete.
42 class WPProtocol
: public Kopete::Protocol
46 // Kopete::Protocol overloading
48 WPProtocol( QObject
*parent
, const QVariantList
& );
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
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
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
74 void installSamba(); // Modify smb.conf to use winpopup-send.sh script
75 void slotReceivedMessage(const QString
&Body
, const QDateTime
&Time
, const QString
&From
);
81 WinPopupLib
*popupClient
;
82 static WPProtocol
*sProtocol
; // Singleton
87 // vim: set noet ts=4 sts=4 sw=4:
88 // kate: tab-width 4; indent-width 4; replace-trailing-space-save on;