From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/plugins/webpresence/webpresenceplugin.h | 123 +++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 kopete/plugins/webpresence/webpresenceplugin.h (limited to 'kopete/plugins/webpresence/webpresenceplugin.h') diff --git a/kopete/plugins/webpresence/webpresenceplugin.h b/kopete/plugins/webpresence/webpresenceplugin.h new file mode 100644 index 00000000..3aea9af0 --- /dev/null +++ b/kopete/plugins/webpresence/webpresenceplugin.h @@ -0,0 +1,123 @@ +/* + webpresenceplugin.h + + Kopete Web Presence plugin + + Copyright (c) 2002,2003 by Will Stephenson + + Kopete (c) 2002,2003 by the Kopete developers + + ************************************************************************* + * * + * 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 WEBPRESENCEPLUGIN_H +#define WEBPRESENCEPLUGIN_H + +#include + +#include + +#include "kopetecontact.h" +#include "kopeteonlinestatus.h" + +class QTimer; +class KTempFile; +namespace Kopete { class MetaContact; } +class KToggleAction; +class KActionCollection; + +typedef QValueList ProtocolList; + +class WebPresencePlugin : public Kopete::Plugin +{ + Q_OBJECT + +private: + int frequency; + bool showAddresses; + bool useImName; + QString userName; + QString userStyleSheet; + bool useImagesInHTML; + + // Is set to true when Kopete has notified us + // that we're about to be unloaded. + bool shuttingDown; + + enum { + WEB_HTML, + WEB_XHTML, + WEB_XML, + WEB_CUSTOM, + WEB_UNDEFINED + } resultFormatting; + + QString resultURL; + +public: + WebPresencePlugin( QObject *parent, const char *name, const QStringList &args ); + virtual ~WebPresencePlugin(); + + virtual void aboutToUnload(); + +protected slots: + void loadSettings(); + + /** + * Write a file to the specified location, + */ + void slotWriteFile(); + /** + * Called when an upload finished, displays error if needed + */ + void slotUploadJobResult( KIO::Job * ); + /** + * Called to schedule a write, after waiting to see if more changes + * occur (accounts tend to change status together) + */ + void slotWaitMoreStatusChanges(); + /** + * Sets us up to respond to account status changes + */ + void listenToAllAccounts(); + /** + * Sets us up to respond to a new account + */ + void listenToAccount( Kopete::Account* account ); + +protected: + /** + * Generate the file (HTML, text) to be uploaded + */ + KTempFile* generateFile(); + /** + * Apply named stylesheet to get content and presentation + */ + bool transform( KTempFile* src, KTempFile* dest ); + /** + * Helper method, generates list of all IM protocols + */ + ProtocolList allProtocols(); + /** + * Converts numeric status to a string + */ + QString statusAsString( const Kopete::OnlineStatus &newStatus ); + /** + * Schedules writes + */ + QTimer* m_writeScheduler; + + // The file to be uploaded to the WWW + KTempFile *m_output; +}; + +#endif + +// vim: set noet ts=4 sts=4 sw=4: -- cgit v1.2.1