summaryrefslogtreecommitdiffstats
path: root/src/otrplugin.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-19 18:38:42 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-19 18:38:42 +0000
commit498ff4e365566b987d2c7a1e54065e0e126556f7 (patch)
treec283921daac735696d642ba121c9e14152e00215 /src/otrplugin.h
downloadkopete-otr-498ff4e365566b987d2c7a1e54065e0e126556f7.tar.gz
kopete-otr-498ff4e365566b987d2c7a1e54065e0e126556f7.zip
Added abandoned KDE3 version of kopete-otr
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kopete-otr@1092925 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/otrplugin.h')
-rw-r--r--src/otrplugin.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/src/otrplugin.h b/src/otrplugin.h
new file mode 100644
index 0000000..2ce051d
--- /dev/null
+++ b/src/otrplugin.h
@@ -0,0 +1,118 @@
+/***************************************************************************
+ otrplugin.h - description
+ -------------------
+ begin : 11 03 2007
+ copyright : (C) 2007-2007 by Michael Zanetti
+ email : michael_zanetti@gmx.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 OTRPLUGIN_H
+#define OTRPLUGIN_H
+
+
+#include "kdebug.h"
+
+#include <kopeteplugin.h>
+#include <kopetemessagehandler.h>
+
+#include "otrlchatinterface.h"
+
+
+/**
+ * @author Michael Zanetti
+ */
+
+class OTRPlugin;
+class KSelectAction;
+
+class OtrMessageHandler : public Kopete::MessageHandler
+{
+private:
+ OTRPlugin *plugin;
+public:
+ OtrMessageHandler( OTRPlugin *plugin ) : plugin(plugin) {
+ kdDebug() << "MessageHandler created" << endl;
+ }
+ ~OtrMessageHandler(){
+ kdDebug() << "MessageHandler destroyed" << endl;
+ }
+ void handleMessage( Kopete::MessageEvent *event );
+};
+
+class OtrMessageHandlerFactory : public Kopete::MessageHandlerFactory
+{
+private:
+ OTRPlugin *plugin;
+ OtrMessageHandler *messageHandler;
+public:
+ OtrMessageHandlerFactory( OTRPlugin *plugin ) : plugin(plugin) {}
+ Kopete::MessageHandler *create( Kopete::ChatSession *, Kopete::Message::MessageDirection direction )
+ {
+ return new OtrMessageHandler(plugin);
+ }
+ int filterPosition( Kopete::ChatSession *, Kopete::Message::MessageDirection )
+ {
+ return Kopete::MessageHandlerFactory::InStageToSent+1;
+ }
+};
+
+class OTRPlugin : public Kopete::Plugin
+{
+ Q_OBJECT
+
+public:
+
+ static OTRPlugin *plugin();
+
+ OTRPlugin( QObject *parent, const char *name, const QStringList &args );
+ ~OTRPlugin();
+
+ void emitGoneSecure( Kopete::ChatSession *session, int status );
+ QMap<QString, QString> getMessageCache();
+
+public slots:
+
+ void slotOutgoingMessage( Kopete::Message& msg );
+ void slotEnableOtr( Kopete::ChatSession *session, bool enable );
+ void slotSettingsChanged();
+ void slotVerifyFingerprint( Kopete::ChatSession *session );
+
+private slots:
+ void slotNewChatSessionWindow(Kopete::ChatSession * );
+ void slotSelectionChanged( bool single );
+ void slotSetPolicy();
+ void accountReady( Kopete::Account *account );
+
+private:
+ static OTRPlugin* pluginStatic_;
+ OtrMessageHandlerFactory *m_inboundHandler;
+ OtrlChatInterface *otrlChatInterface;
+ QMap<QString, QString> messageCache;
+ KSelectAction* otrPolicyMenu;
+
+/* KActionMenu *otrPolicyMenuBar;
+ KActionMenu *otrPolicyPopup;
+ KAction *otrPolicyDefault;
+ KAction *otrPolicyAlways;
+ KAction *otrPolicyOpportunistic;
+ KAction *otrPolicyManual;
+ KAction *otrPolicyNever;
+// SessionManager manager
+*/
+
+signals:
+ void goneSecure( Kopete::ChatSession *session, int state );
+
+
+};
+
+#endif