Pimcommon

ldapsearchdialog.h
1/*
2 * This file is part of libkldap.
3 *
4 * SPDX-FileCopyrightText: 2002 Klarälvdalens Datakonsult AB
5 * SPDX-FileContributor: Steffen Hansen <hansen@kde.org>
6 *
7 * SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9#pragma once
10
11#include "pimcommonakonadi_export.h"
12
13#include <KContacts/Addressee>
14#include <QDialog>
15
16class QCloseEvent;
17
18namespace KLDAPCore
19{
20class LdapClient;
21class LdapObject;
22}
23namespace PimCommon
24{
25/**
26 * @short A dialog to search contacts in a LDAP directory.
27 *
28 * This dialog allows the user to search for contacts inside
29 * a LDAP directory.
30 *
31 * @author Steffen Hansen <hansen@kde.org>
32 * @since 4.5
33 */
34class PIMCOMMONAKONADI_EXPORT LdapSearchDialog : public QDialog
35{
36 Q_OBJECT
37
38public:
39 enum FilterType {
40 Name = 0,
41 Email,
42 HomeNumber,
43 WorkNumber,
44 };
45
46 /**
47 * Creates a new ldap search dialog.
48 *
49 * @param parent The parent widget.
50 */
51 explicit LdapSearchDialog(QWidget *parent = nullptr);
52
53 /**
54 * Destroys the ldap search dialog.
55 */
56 ~LdapSearchDialog() override;
57
58 /**
59 * Sets the @p text in the search line edit.
60 */
61 void setSearchText(const QString &text);
62
63 /**
64 * Returns a list of contacts that have been selected
65 * in the LDAP search.
66 */
67 KContacts::Addressee::List selectedContacts() const;
68
69Q_SIGNALS:
70 /**
71 * This signal is emitted whenever the user clicked the
72 * 'Add Selected' button.
73 */
75
76protected Q_SLOTS:
77 void slotUser1();
78 void slotUser2();
79 void slotCustomContextMenuRequested(const QPoint &);
80 void slotCancelClicked();
81
82protected:
83 void closeEvent(QCloseEvent *) override;
84
85private:
86 //@cond PRIVATE
87 class LdapSearchDialogPrivate;
88 std::unique_ptr<LdapSearchDialogPrivate> const d;
89
90 Q_PRIVATE_SLOT(d, void slotAddResult(const KLDAPCore::LdapClient &, const KLDAPCore::LdapObject &))
91 Q_PRIVATE_SLOT(d, void slotStartSearch())
92 Q_PRIVATE_SLOT(d, void slotStopSearch())
93 Q_PRIVATE_SLOT(d, void slotSearchDone())
94 //@endcond
95};
96}
97Q_DECLARE_METATYPE(PimCommon::LdapSearchDialog::FilterType)
AddresseeList List
A dialog to search contacts in a LDAP directory.
void contactsAdded()
This signal is emitted whenever the user clicked the 'Add Selected' button.
folderdialogacltab.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 12:07:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.