Commit 572aa93e authored by Laurent Montel's avatar Laurent Montel 😁

Move ldap element from libkdepim

parent ac46295d
Pipeline #23360 passed with stage
in 32 minutes and 40 seconds
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.14.43")
set(PIM_VERSION "5.14.44")
project(pimcommon VERSION ${PIM_VERSION})
......@@ -24,7 +24,8 @@ include(ECMAddTests)
include(ECMInstallIcons)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
set(AKONADICONTACT_LIB_VERSION "5.14.40")
......@@ -34,6 +35,8 @@ set(KMIME_LIB_VERSION "5.14.40")
set(KIMAP_LIB_VERSION "5.14.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.40")
set(AKONADI_VERSION "5.14.40")
set(KLDAP_LIB_VERSION "5.14.41")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Network Test Xml PrintSupport)
......@@ -50,6 +53,7 @@ find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
......@@ -57,6 +61,7 @@ find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Purpose ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -61,6 +61,10 @@ set(libpimcommonakonadi_widgets_SRCS
widgets/annotationdialog.cpp
)
set(libpimcommonakonadi_ldap_SRCS
ldap/ldapsearchdialog.cpp
)
set(libpimcommonakonadi_util_SRCS
util/createresource.cpp
util/imapresourcecapabilitiesmanager.cpp
......@@ -77,6 +81,7 @@ set(libpimcommonakonadi_collection_SRCS
set(libpimcommonakonadi_SRCS
${libpimcommonakonadi_ldap_SRCS}
${libpimcommonakonadi_collection_SRCS}
${libpimcommonakonadi_acl_SRCS}
${libpimcommonakonadi_folderdialog_SRCS}
......@@ -117,6 +122,8 @@ target_link_libraries(KF5PimCommonAkonadi
KF5::XmlGui
KF5::PimTextEdit
KF5::KIOWidgets
KF5::KCMUtils
KF5::Ldap
)
target_include_directories(KF5PimCommonAkonadi INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommonAkonadi/;${KDE_INSTALL_INCLUDEDIR_KF5}/pimcommonakonadi>")
......@@ -139,6 +146,7 @@ if (BUILD_TESTING)
add_subdirectory(acl/autotests)
add_subdirectory(folderdialog/tests/)
add_subdirectory(collectionpage/autotests/)
add_subdirectory(ldap/tests)
endif()
ecm_generate_headers(PimCommonAkonadi_Camelcasecollectionpage_HEADERS
......@@ -179,6 +187,14 @@ ecm_generate_headers(PimCommonAkonadi_Camelcasewidgets_HEADERS
RELATIVE widgets
)
ecm_generate_headers(PimCommonAkonadi_Camelcaseldap_HEADERS
HEADER_NAMES
LdapSearchDialog
REQUIRED_HEADERS PimCommonAkonadi_ldap_HEADERS
PREFIX PimCommonAkonadi
RELATIVE ldap
)
ecm_generate_headers(PimCommon_Camelcasemanagerserversidesubscription_HEADERS
HEADER_NAMES
ManageServerSideSubscriptionJob
......@@ -224,6 +240,7 @@ install(FILES
${PimCommonAkonadi_Camelcasecollectionpage_HEADERS}
${PimCommonAkonadi_Camelcasecollectionpageattributes_HEADERS}
${PimCommon_Camelcaseacl_HEADERS}
${PimCommonAkonadi_Camelcaseldap_HEADERS}
${PimCommon_Camelcasefolderdialog_HEADERS}
${PimCommonAkonadi_CamelCasegenericplugins_HEADERS}
${PimCommon_Camelcasemanagerserversidesubscription_HEADERS}
......@@ -236,6 +253,7 @@ install(FILES
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/pimcommonakonadi_export.h
${PimCommon_acl_HEADERS}
${PimCommonAkonadi_ldap_HEADERS}
${PimCommonAkonadi_collectionpage_HEADERS}
${PimCommonAkonadi_collectionpageattributes_HEADERS}
${PimCommon_folderdialog_HEADERS}
......
This diff is collapsed.
/*
* This file is part of libkldap.
*
* Copyright (C) 2002 Klarälvdalens Datakonsult AB
*
* Author: Steffen Hansen <hansen@kde.org>
*
* 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 KLDAP_LDAPSEARCHDIALOG_H
#define KLDAP_LDAPSEARCHDIALOG_H
#include "pimcommonakonadi_export.h"
#include <kcontacts/addressee.h>
#include <QDialog>
class QCloseEvent;
namespace KLDAP {
class LdapClient;
class LdapObject;
}
namespace PimCommon {
/**
* @short A dialog to search contacts in a LDAP directory.
*
* This dialog allows the user to search for contacts inside
* a LDAP directory.
*
* @author Steffen Hansen <hansen@kde.org>
* @since 4.5
*/
class PIMCOMMONAKONADI_EXPORT LdapSearchDialog : public QDialog
{
Q_OBJECT
public:
enum FilterType {
Name = 0,
Email,
HomeNumber,
WorkNumber
};
/**
* Creates a new ldap search dialog.
*
* @param parent The parent widget.
*/
explicit LdapSearchDialog(QWidget *parent = nullptr);
/**
* Destroys the ldap search dialog.
*/
~LdapSearchDialog() override;
/**
* Sets the @p text in the search line edit.
*/
void setSearchText(const QString &text);
/**
* Returns a list of contacts that have been selected
* in the LDAP search.
*/
KContacts::Addressee::List selectedContacts() const;
Q_SIGNALS:
/**
* This signal is emitted whenever the user clicked the
* 'Add Selected' button.
*/
void contactsAdded();
protected Q_SLOTS:
void slotUser1();
void slotUser2();
void slotCustomContextMenuRequested(const QPoint &);
void slotCancelClicked();
protected:
void closeEvent(QCloseEvent *) override;
private:
//@cond PRIVATE
class Private;
Private *const d;
Q_PRIVATE_SLOT(d, void slotAddResult(const KLDAP::LdapClient &, const KLDAP::LdapObject &))
Q_PRIVATE_SLOT(d, void slotStartSearch())
Q_PRIVATE_SLOT(d, void slotStopSearch())
Q_PRIVATE_SLOT(d, void slotSearchDone())
//@endcond
};
}
Q_DECLARE_METATYPE(PimCommon::LdapSearchDialog::FilterType)
#endif
########### next target ###############
set(testldapsearchdialog_SRCS ldapsearchdialog_gui.cpp)
add_executable(ldapsearchdialog_gui ${testldapsearchdialog_SRCS})
target_link_libraries(ldapsearchdialog_gui KF5::PimCommonAkonadi KF5::I18n KF5::CoreAddons Qt5::Widgets KF5::Contacts)
/*
Copyright (c) 2015-2020 Laurent Montel <montel@kde.org>
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 <QApplication>
#include <QCommandLineParser>
#include <QStandardPaths>
#include "ldap/ldapsearchdialog.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCommandLineParser parser;
//We can't use it otherwise we need to call kbuilsyscoca in test mode too.
//QStandardPaths::setTestModeEnabled(true);
parser.addVersionOption();
parser.addHelpOption();
parser.process(app);
PimCommon::LdapSearchDialog dlg;
dlg.exec();
return app.exec();
}
Markdown is supported
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