summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-07 11:37:52 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-07 11:37:52 (GMT)
commit01fb3e4b6616f134f0277b99aded472628ebfdd1 (patch)
tree9227d1f2967b952bf846982e35e7a2f0bbc258d4
parenta35b45a5e43e062b352b8715f717fb92e2cc2d12 (diff)
Start to implement as plugin
-rw-r--r--CMakeLists.txt3
-rw-r--r--kaddressbook/importexportplugins/vcards/CMakeLists.txt12
-rw-r--r--kaddressbook/importexportplugins/vcards/kaddressbook_importexportvcardplugin.json12
-rw-r--r--kaddressbook/importexportplugins/vcards/vcardimportexportplugin.cpp46
-rw-r--r--kaddressbook/importexportplugins/vcards/vcardimportexportplugin.h36
-rw-r--r--kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp46
-rw-r--r--kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.h36
7 files changed, 190 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c218f8b..67c3605 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,7 +63,7 @@ set(GRANTLEETHEME_LIB_VERSION "5.3.40")
set(CALENDARSUPPORT_LIB_VERSION "5.3.40")
set(EVENTVIEW_LIB_VERSION "5.3.40")
set(LIBKDEPIM_LIB_VERSION "5.3.40")
-set(KDEPIM_APPS_LIB_VERSION "5.3.41")
+set(KDEPIM_APPS_LIB_VERSION "5.3.42")
set(LIBKLEO_LIB_VERSION "5.3.40")
set(AKONADI_LIB_VERSION "5.3.45")
set(INCIDENCEEDITOR_LIB_VERSION "5.3.40")
@@ -79,6 +79,7 @@ find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KaddressbookGrantlee ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
+find_package(KF5KaddressbookImportExport ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
diff --git a/kaddressbook/importexportplugins/vcards/CMakeLists.txt b/kaddressbook/importexportplugins/vcards/CMakeLists.txt
index e69de29..39c1e3b 100644
--- a/kaddressbook/importexportplugins/vcards/CMakeLists.txt
+++ b/kaddressbook/importexportplugins/vcards/CMakeLists.txt
@@ -0,0 +1,12 @@
+set(kaddressbook_importexport_vcard_SRCS
+ vcardimportexportplugin.cpp
+ vcardimportexportplugininterface.cpp
+ )
+
+
+kcoreaddons_add_plugin(kaddressbook_importexportvcardplugin JSON kaddressbook_importexportvcardplugin.json SOURCES
+ ${kaddressbook_importexport_vcard_SRCS} INSTALL_NAMESPACE kaddressbook)
+
+target_link_libraries(kaddressbook_importexportvcardplugin KF5::KaddressbookImportExport
+ KF5::PimCommon KF5::I18n KF5::XmlGui
+ )
diff --git a/kaddressbook/importexportplugins/vcards/kaddressbook_importexportvcardplugin.json b/kaddressbook/importexportplugins/vcards/kaddressbook_importexportvcardplugin.json
new file mode 100644
index 0000000..20b323a
--- /dev/null
+++ b/kaddressbook/importexportplugins/vcards/kaddressbook_importexportvcardplugin.json
@@ -0,0 +1,12 @@
+{
+ "KPlugin": {
+ "Description": "This plugin allows you to import export vcards.",
+ "EnabledByDefault": "true",
+ "Id": "kaddressbookimportexportvcard",
+ "Name": "Import Export VCard",
+ "ServiceTypes": [
+ "KAddressBook/ImportExportPlugin"
+ ],
+ "Version": "1.0"
+ }
+}
diff --git a/kaddressbook/importexportplugins/vcards/vcardimportexportplugin.cpp b/kaddressbook/importexportplugins/vcards/vcardimportexportplugin.cpp
new file mode 100644
index 0000000..c6dc554
--- /dev/null
+++ b/kaddressbook/importexportplugins/vcards/vcardimportexportplugin.cpp
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ 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.
+
+ This program 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+#include "vcardimportexportplugin.h"
+#include "vcardimportexportplugininterface.h"
+
+VCardImportExportPlugin::VCardImportExportPlugin(QObject *parent)
+ : KAddressBookImportExport::KAddressBookImportExportPlugin(parent)
+{
+
+}
+
+VCardImportExportPlugin::~VCardImportExportPlugin()
+{
+
+}
+
+
+PimCommon::AbstractGenericPluginInterface *VCardImportExportPlugin::createInterface(KActionCollection *ac, QObject *parent)
+{
+ VCardImportExportPluginInterface *interface = new VCardImportExportPluginInterface(parent);
+ interface->createAction(ac);
+ return interface;
+}
+
+bool VCardImportExportPlugin::hasPopupMenuSupport() const
+{
+ return true;
+}
diff --git a/kaddressbook/importexportplugins/vcards/vcardimportexportplugin.h b/kaddressbook/importexportplugins/vcards/vcardimportexportplugin.h
new file mode 100644
index 0000000..ece4ae9
--- /dev/null
+++ b/kaddressbook/importexportplugins/vcards/vcardimportexportplugin.h
@@ -0,0 +1,36 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ 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.
+
+ This program 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef VCARDIMPORTEXPORTPLUGIN_H
+#define VCARDIMPORTEXPORTPLUGIN_H
+#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
+
+class VCardImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
+{
+ Q_OBJECT
+public:
+ explicit VCardImportExportPlugin(QObject *parent = Q_NULLPTR);
+ ~VCardImportExportPlugin();
+
+ PimCommon::AbstractGenericPluginInterface *createInterface(KActionCollection *ac, QObject *parent) Q_DECL_OVERRIDE;
+ bool hasPopupMenuSupport() const Q_DECL_OVERRIDE;
+};
+
+#endif // VCARDIMPORTEXPORTPLUGIN_H
diff --git a/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
new file mode 100644
index 0000000..9696fc1
--- /dev/null
+++ b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ 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.
+
+ This program 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "vcardimportexportplugininterface.h"
+#include <KLocalizedString>
+#include <KActionCollection>
+#include <QAction>
+
+VCardImportExportPluginInterface::VCardImportExportPluginInterface(QObject *parent)
+ : KAddressBookImportExport::KAddressBookImportExportPluginInterface(parent)
+{
+
+}
+
+VCardImportExportPluginInterface::~VCardImportExportPluginInterface()
+{
+
+}
+
+
+void VCardImportExportPluginInterface::createAction(KActionCollection *ac)
+{
+ QAction *action = ac->addAction(QStringLiteral("import_action_vcard"));
+ action->setText(i18n("Merge Contacts..."));
+ //TODO
+}
+
+void VCardImportExportPluginInterface::exec()
+{
+}
diff --git a/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.h b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.h
new file mode 100644
index 0000000..5295251
--- /dev/null
+++ b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.h
@@ -0,0 +1,36 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ 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.
+
+ This program 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef VCARDIMPORTEXPORTPLUGININTERFACE_H
+#define VCARDIMPORTEXPORTPLUGININTERFACE_H
+
+#include <KAddressBookImportExport/KAddressBookImportExportPluginInterface>
+
+class VCardImportExportPluginInterface : public KAddressBookImportExport::KAddressBookImportExportPluginInterface
+{
+ Q_OBJECT
+public:
+ explicit VCardImportExportPluginInterface(QObject *parent = Q_NULLPTR);
+ ~VCardImportExportPluginInterface();
+
+ void createAction(KActionCollection *ac) Q_DECL_OVERRIDE;
+ void exec() Q_DECL_OVERRIDE;
+};
+
+#endif // VCARDIMPORTEXPORTPLUGININTERFACE_H