Commit 01fb3e4b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement as plugin

parent a35b45a5
......@@ -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)
......
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
)
{
"KPlugin": {
"Description": "This plugin allows you to import export vcards.",
"EnabledByDefault": "true",
"Id": "kaddressbookimportexportvcard",
"Name": "Import Export VCard",
"ServiceTypes": [
"KAddressBook/ImportExportPlugin"
],
"Version": "1.0"
}
}
/*
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;
}
/*
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
/*
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()
{
}
/*
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment