summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-07 11:45:56 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-07 11:45:56 (GMT)
commit3c858520876eee4735a7d35aecb8ad675c5f66ab (patch)
treec87a782537ca3f514176bd2aa9bb6e4a1918735d
parent9577ae8c08fa085b7c9a81f189b7a542b292388e (diff)
Add KAddressBookImportExportContactList
-rw-r--r--CMakeLists.txt2
-rw-r--r--kaddressbookimportexport/src/CMakeLists.txt6
-rw-r--r--kaddressbookimportexport/src/kaddressbookimportexportcontactlist.cpp75
-rw-r--r--kaddressbookimportexport/src/kaddressbookimportexportcontactlist.h52
4 files changed, 131 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63ba8bb..118eb97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
-set(PIM_VERSION "5.3.43")
+set(PIM_VERSION "5.3.44")
set(KDEPIM_APPS_LIB_VERSION ${PIM_VERSION})
set(QT_REQUIRED_VERSION "5.6.0")
diff --git a/kaddressbookimportexport/src/CMakeLists.txt b/kaddressbookimportexport/src/CMakeLists.txt
index abfd056..dd6b39e 100644
--- a/kaddressbookimportexport/src/CMakeLists.txt
+++ b/kaddressbookimportexport/src/CMakeLists.txt
@@ -6,6 +6,7 @@ set(kaddressbook_importexport_LIB_SRCS
kaddressbookimportexportplugin.cpp
kaddressbookimportexportplugininterface.cpp
kaddressbookimportexportpluginmanager.cpp
+ kaddressbookimportexportcontactlist.cpp
)
ecm_qt_declare_logging_category(kaddressbook_importexport_LIB_SRCS HEADER libkaddressbookexportimport_debug.h IDENTIFIER LIBKADDRESSBOOKIMPORTEXPORT_LOG CATEGORY_NAME org.kde.pim.kaddressbookimportexport)
@@ -22,10 +23,8 @@ target_include_directories(KF5KaddressbookImportExport PUBLIC "$<BUILD_INTERFACE
target_link_libraries(KF5KaddressbookImportExport
PRIVATE
- KF5::ConfigWidgets
+ KF5::Contacts
KF5::Service
- KF5::IconThemes
- KF5::I18n
KF5::PimCommon
)
@@ -47,6 +46,7 @@ ecm_generate_headers(KaddressbookImportExport_CamelCase_HEADERS
KAddressBookImportExportPluginInterface
KAddressBookImportExportPlugin
KAddressBookImportExportPluginManager
+ KAddressBookImportExportContactList
REQUIRED_HEADERS KaddressbookImportExport_HEADERS
PREFIX KAddressBookImportExport
)
diff --git a/kaddressbookimportexport/src/kaddressbookimportexportcontactlist.cpp b/kaddressbookimportexport/src/kaddressbookimportexportcontactlist.cpp
new file mode 100644
index 0000000..e570bf7
--- /dev/null
+++ b/kaddressbookimportexport/src/kaddressbookimportexportcontactlist.cpp
@@ -0,0 +1,75 @@
+/*
+ This file is part of KAddressBook.
+
+ Copyright (c) 2015-2016 Laurent Montel <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; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "kaddressbookimportexportcontactlist.h"
+
+using namespace KAddressBookImportExport;
+
+KAddressBookImportExportContactList::KAddressBookImportExportContactList()
+{
+
+}
+
+bool KAddressBookImportExportContactList::isEmpty() const
+{
+ return (mAddressList.isEmpty() && mContactGroupList.isEmpty());
+}
+
+int KAddressBookImportExportContactList::count() const
+{
+ return (mAddressList.count() + mContactGroupList.count());
+}
+
+void KAddressBookImportExportContactList::clear()
+{
+ mAddressList.clear();
+ mContactGroupList.clear();
+}
+
+void KAddressBookImportExportContactList::append(const KContacts::Addressee &addr)
+{
+ mAddressList.append(addr);
+}
+
+void KAddressBookImportExportContactList::append(const KContacts::ContactGroup &group)
+{
+ mContactGroupList.append(group);
+}
+
+KContacts::ContactGroup::List KAddressBookImportExportContactList::contactGroupList() const
+{
+ return mContactGroupList;
+}
+
+void KAddressBookImportExportContactList::setContactGroupList(const KContacts::ContactGroup::List &value)
+{
+ mContactGroupList = value;
+}
+
+KContacts::Addressee::List KAddressBookImportExportContactList::addressList() const
+{
+ return mAddressList;
+}
+
+void KAddressBookImportExportContactList::setAddressList(const KContacts::Addressee::List &value)
+{
+ mAddressList = value;
+}
+
diff --git a/kaddressbookimportexport/src/kaddressbookimportexportcontactlist.h b/kaddressbookimportexport/src/kaddressbookimportexportcontactlist.h
new file mode 100644
index 0000000..83a5fcf
--- /dev/null
+++ b/kaddressbookimportexport/src/kaddressbookimportexportcontactlist.h
@@ -0,0 +1,52 @@
+/*
+ This file is part of KAddressBook.
+
+ Copyright (c) 2015-2016 Laurent Montel <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; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KAddressBookImportExportCONTACTLIST_H
+#define KAddressBookImportExportCONTACTLIST_H
+#include <KContacts/Addressee>
+#include <KContacts/ContactGroup>
+#include "kaddressbook_importexport_export.h"
+
+namespace KAddressBookImportExport
+{
+class KADDRESSBOOK_IMPORTEXPORT_EXPORT KAddressBookImportExportContactList
+{
+public:
+ KAddressBookImportExportContactList();
+
+ bool isEmpty() const;
+ int count() const;
+ void clear();
+
+ void append(const KContacts::Addressee &addr);
+ void append(const KContacts::ContactGroup &group);
+
+ KContacts::Addressee::List addressList() const;
+ void setAddressList(const KContacts::Addressee::List &value);
+ KContacts::ContactGroup::List contactGroupList() const;
+ void setContactGroupList(const KContacts::ContactGroup::List &value);
+
+private:
+ KContacts::Addressee::List mAddressList;
+ KContacts::ContactGroup::List mContactGroupList;
+};
+}
+
+#endif // KAddressBookImportExportCONTACTLIST_H