summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-08 13:55:58 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-08 13:56:19 (GMT)
commitc679a7b77c88cb5907d967536fd050f868ba1c18 (patch)
tree6c7a715b0dd27ac6838555ac5cef0267904f28f4
parent8f906e5926717d471ca12653d117681532c701d5 (diff)
Add ldap plugin
-rw-r--r--kaddressbook/importexportplugins/ldap/CMakeLists.txt15
-rw-r--r--kaddressbook/importexportplugins/ldap/kaddressbook_importexportldapplugin.json12
-rw-r--r--kaddressbook/importexportplugins/ldap/ldapimportexportplugin.cpp46
-rw-r--r--kaddressbook/importexportplugins/ldap/ldapimportexportplugin.h36
-rw-r--r--kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp72
-rw-r--r--kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h36
-rw-r--r--kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.h2
7 files changed, 218 insertions, 1 deletions
diff --git a/kaddressbook/importexportplugins/ldap/CMakeLists.txt b/kaddressbook/importexportplugins/ldap/CMakeLists.txt
index e69de29..1e9aa81 100644
--- a/kaddressbook/importexportplugins/ldap/CMakeLists.txt
+++ b/kaddressbook/importexportplugins/ldap/CMakeLists.txt
@@ -0,0 +1,15 @@
+set(kaddressbook_importexport_ldap_SRCS
+ ldapimportexportplugin.cpp
+ ldapimportexportplugininterface.cpp
+ )
+
+
+kcoreaddons_add_plugin(kaddressbook_importexportldapplugin JSON kaddressbook_importexportldapplugin.json SOURCES
+ ${kaddressbook_importexport_ldap_SRCS} INSTALL_NAMESPACE kaddressbook)
+
+target_link_libraries(kaddressbook_importexportldapplugin KF5::KaddressbookImportExport
+ KF5::PimCommon
+ KF5::I18n
+ KF5::XmlGui
+ KF5::Contacts
+ )
diff --git a/kaddressbook/importexportplugins/ldap/kaddressbook_importexportldapplugin.json b/kaddressbook/importexportplugins/ldap/kaddressbook_importexportldapplugin.json
new file mode 100644
index 0000000..09aaa7e
--- /dev/null
+++ b/kaddressbook/importexportplugins/ldap/kaddressbook_importexportldapplugin.json
@@ -0,0 +1,12 @@
+{
+ "KPlugin": {
+ "Description": "This plugin allows you to import export ldap contact.",
+ "EnabledByDefault": "true",
+ "Id": "kaddressbookimportexportldap",
+ "Name": "Import Export Ldap Contact",
+ "ServiceTypes": [
+ "KAddressBook/ImportExportPlugin"
+ ],
+ "Version": "1.0"
+ }
+}
diff --git a/kaddressbook/importexportplugins/ldap/ldapimportexportplugin.cpp b/kaddressbook/importexportplugins/ldap/ldapimportexportplugin.cpp
new file mode 100644
index 0000000..c55e518
--- /dev/null
+++ b/kaddressbook/importexportplugins/ldap/ldapimportexportplugin.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 "ldapimportexportplugin.h"
+#include "ldapimportexportplugininterface.h"
+
+LDapImportExportPlugin::LDapImportExportPlugin(QObject *parent)
+ : KAddressBookImportExport::KAddressBookImportExportPlugin(parent)
+{
+
+}
+
+LDapImportExportPlugin::~LDapImportExportPlugin()
+{
+
+}
+
+
+PimCommon::AbstractGenericPluginInterface *LDapImportExportPlugin::createInterface(KActionCollection *ac, QObject *parent)
+{
+ LDapImportExportPluginInterface *interface = new LDapImportExportPluginInterface(parent);
+ interface->createAction(ac);
+ return interface;
+}
+
+bool LDapImportExportPlugin::hasPopupMenuSupport() const
+{
+ return true;
+}
diff --git a/kaddressbook/importexportplugins/ldap/ldapimportexportplugin.h b/kaddressbook/importexportplugins/ldap/ldapimportexportplugin.h
new file mode 100644
index 0000000..e628069
--- /dev/null
+++ b/kaddressbook/importexportplugins/ldap/ldapimportexportplugin.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 LDAPIMPORTEXPORTPLUGIN_H
+#define LDAPIMPORTEXPORTPLUGIN_H
+#include <KAddressBookImportExport/KAddressBookImportExportPlugin>
+
+class LDapImportExportPlugin : public KAddressBookImportExport::KAddressBookImportExportPlugin
+{
+ Q_OBJECT
+public:
+ explicit LDapImportExportPlugin(QObject *parent = Q_NULLPTR);
+ ~LDapImportExportPlugin();
+
+ PimCommon::AbstractGenericPluginInterface *createInterface(KActionCollection *ac, QObject *parent) Q_DECL_OVERRIDE;
+ bool hasPopupMenuSupport() const Q_DECL_OVERRIDE;
+};
+
+#endif // LDAPIMPORTEXPORTPLUGIN_H
diff --git a/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp
new file mode 100644
index 0000000..d4bee8d
--- /dev/null
+++ b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp
@@ -0,0 +1,72 @@
+/*
+ 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 "ldapimportexportplugininterface.h"
+#include <KLocalizedString>
+#include <KActionCollection>
+#include <QAction>
+
+LDapImportExportPluginInterface::LDapImportExportPluginInterface(QObject *parent)
+ : KAddressBookImportExport::KAddressBookImportExportPluginInterface(parent)
+{
+
+}
+
+LDapImportExportPluginInterface::~LDapImportExportPluginInterface()
+{
+
+}
+
+
+void LDapImportExportPluginInterface::createAction(KActionCollection *ac)
+{
+#if 0
+ QAction *action = ac->addAction(QStringLiteral("file_import_ldap"));
+ action->setText(i18n("Import LDap..."));
+ action->setWhatsThis(i18n("Import contacts from a LDap file."));
+ setImportActions(QList<QAction *>() << action);
+
+ QList<QAction *> exportActionList;
+
+ action = ac->addAction(QStringLiteral("file_import_ldap"));
+ action->setText(i18n("Import LDap..."));
+ action->setWhatsThis(i18n("Import contacts from a LDap file."));
+ exportActionList << action;
+
+ action = ac->addAction(QStringLiteral("file_export_ldap40"));
+ action->setWhatsThis(i18n("Export contacts to a LDap 4.0 file."));
+ action->setText(i18n("Export LDap 4.0..."));
+ exportActionList << action;
+
+ action = ac->addAction(QStringLiteral("file_export_ldap30"));
+ action->setText(i18n("Export LDap 3.0..."));
+ action->setWhatsThis(i18n("Export contacts to a LDap 3.0 file."));
+ exportActionList << action;
+
+ action = ac->addAction(QStringLiteral("file_export_ldap21"));
+ action->setText(i18n("Export LDap 2.1..."));
+ action->setWhatsThis(i18n("Export contacts to a LDap 2.1 file."));
+ exportActionList << action;
+ setExportActions(exportActionList);
+#endif
+}
+
+void LDapImportExportPluginInterface::exec()
+{
+}
diff --git a/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h
new file mode 100644
index 0000000..57d6c9f
--- /dev/null
+++ b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.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 LDAPIMPORTEXPORTPLUGININTERFACE_H
+#define LDAPIMPORTEXPORTPLUGININTERFACE_H
+
+#include <KAddressBookImportExport/KAddressBookImportExportPluginInterface>
+
+class LDapImportExportPluginInterface : public KAddressBookImportExport::KAddressBookImportExportPluginInterface
+{
+ Q_OBJECT
+public:
+ explicit LDapImportExportPluginInterface(QObject *parent = Q_NULLPTR);
+ ~LDapImportExportPluginInterface();
+
+ void createAction(KActionCollection *ac) Q_DECL_OVERRIDE;
+ void exec() Q_DECL_OVERRIDE;
+};
+
+#endif // LDAPIMPORTEXPORTPLUGININTERFACE_H
diff --git a/kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.h b/kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.h
index 9c08dac..fb554c6 100644
--- a/kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.h
+++ b/kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.h
@@ -32,7 +32,7 @@ class VCardViewerDialog : public QDialog
Q_OBJECT
public:
VCardViewerDialog(const KContacts::Addressee::List &list,
- QWidget *parent);
+ QWidget *parent = Q_NULLPTR);
~VCardViewerDialog();
KContacts::Addressee::List contacts() const;