summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-06-27 07:59:08 +0200
committerMontel Laurent <[email protected]>2017-06-27 07:59:08 +0200
commit483afbec29f9fda742644bd95a51ffd5ab3407e2 (patch)
tree796030c5062271d4e35f16b4ebb1ae0871c50928
parent7a7ca197d65b2b64727c269c9b5dd40cf99a050e (diff)
Start to create akonadi plugin
-rw-r--r--src/kmailtransportakonadi/CMakeLists.txt1
-rw-r--r--src/kmailtransportakonadi/plugins/CMakeLists.txt10
-rw-r--r--src/kmailtransportakonadi/plugins/akonadimailtransport.json10
-rw-r--r--src/kmailtransportakonadi/plugins/akonadimailtransportplugin.cpp55
-rw-r--r--src/kmailtransportakonadi/plugins/akonadimailtransportplugin.h38
5 files changed, 114 insertions, 0 deletions
diff --git a/src/kmailtransportakonadi/CMakeLists.txt b/src/kmailtransportakonadi/CMakeLists.txt
index 0a31f0b..4ae0bd8 100644
--- a/src/kmailtransportakonadi/CMakeLists.txt
+++ b/src/kmailtransportakonadi/CMakeLists.txt
@@ -111,3 +111,4 @@ if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
+add_subdirectory(plugins)
diff --git a/src/kmailtransportakonadi/plugins/CMakeLists.txt b/src/kmailtransportakonadi/plugins/CMakeLists.txt
index e69de29..6eb52ae 100644
--- a/src/kmailtransportakonadi/plugins/CMakeLists.txt
+++ b/src/kmailtransportakonadi/plugins/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(mailtransport_akonadiplugin_SRCS
+ akonadimailtransportplugin.cpp
+)
+
+kcoreaddons_add_plugin(mailtransport_akonadiplugin JSON akonadimailtransport.json SOURCES
+ ${mailtransport_akonadiplugin_SRCS} INSTALL_NAMESPACE mailtransport)
+
+target_link_libraries(mailtransport_akonadiplugin
+ KF5::MailTransport KF5::CoreAddons
+)
diff --git a/src/kmailtransportakonadi/plugins/akonadimailtransport.json b/src/kmailtransportakonadi/plugins/akonadimailtransport.json
new file mode 100644
index 0000000..095c2ce
--- /dev/null
+++ b/src/kmailtransportakonadi/plugins/akonadimailtransport.json
@@ -0,0 +1,10 @@
+{
+ "KPlugin": {
+ "Id": "akonadimailtransport",
+ "Name": "Akonadi Mail Transport",
+ "ServiceTypes": [
+ "MailTransport/Plugin"
+ ],
+ "Version": "1.0"
+ }
+}
diff --git a/src/kmailtransportakonadi/plugins/akonadimailtransportplugin.cpp b/src/kmailtransportakonadi/plugins/akonadimailtransportplugin.cpp
new file mode 100644
index 0000000..4087640
--- /dev/null
+++ b/src/kmailtransportakonadi/plugins/akonadimailtransportplugin.cpp
@@ -0,0 +1,55 @@
+/*
+ Copyright (c) 2017 Laurent Montel <[email protected]>
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ This library is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+ License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+#include "akonadimailtransportplugin.h"
+#include <kpluginfactory.h>
+
+K_PLUGIN_FACTORY_WITH_JSON(AkonadiMailTransportPluginFactory, "akonadimailtransport.json", registerPlugin<AkonadiMailTransportPlugin>();
+ )
+
+AkonadiMailTransportPlugin::AkonadiMailTransportPlugin(QObject *parent, const QList<QVariant> &)
+ : MailTransport::TransportAbstractPlugin(parent)
+{
+
+}
+
+AkonadiMailTransportPlugin::~AkonadiMailTransportPlugin()
+{
+
+}
+
+QString AkonadiMailTransportPlugin::name() const
+{
+ //TODO FIXME
+ return {};
+}
+
+bool AkonadiMailTransportPlugin::configureTransport(MailTransport::Transport *transport, QWidget *parent)
+{
+ //TODO FIXME
+ return false;
+}
+
+void AkonadiMailTransportPlugin::cleanUp(const QString &identifier)
+{
+ Q_UNUSED(identifier);
+ //TODO FIXME
+}
+
+#include "akonadimailtransportplugin.moc"
diff --git a/src/kmailtransportakonadi/plugins/akonadimailtransportplugin.h b/src/kmailtransportakonadi/plugins/akonadimailtransportplugin.h
new file mode 100644
index 0000000..2d2fb3a
--- /dev/null
+++ b/src/kmailtransportakonadi/plugins/akonadimailtransportplugin.h
@@ -0,0 +1,38 @@
+/*
+ Copyright (c) 2017 Laurent Montel <[email protected]>
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ This library is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+ License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+*/
+
+#ifndef AkonadiMAILTRANSPORTPLUGIN_H
+#define AkonadiMAILTRANSPORTPLUGIN_H
+
+#include <MailTransport/TransportAbstractPlugin>
+#include <QVariant>
+
+class AkonadiMailTransportPlugin : public MailTransport::TransportAbstractPlugin
+{
+ Q_OBJECT
+public:
+ explicit AkonadiMailTransportPlugin(QObject *parent = nullptr, const QList<QVariant> & = {});
+ ~AkonadiMailTransportPlugin();
+
+ QString name() const override;
+ bool configureTransport(MailTransport::Transport *transport, QWidget *parent) override;
+ void cleanUp(const QString &identifier) override;
+};
+
+#endif // AkonadiMAILTRANSPORTPLUGIN_H