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 KLDAPWidgets
19{
20class LdapClient;
21}
22namespace KLDAPCore
23{
24class LdapObject;
25}
26namespace PimCommon
27{
28/**
29 * @short A dialog to search contacts in a LDAP directory.
30 *
31 * This dialog allows the user to search for contacts inside
32 * a LDAP directory.
33 *
34 * @author Steffen Hansen <hansen@kde.org>
35 * @since 4.5
36 */
37class PIMCOMMONAKONADI_EXPORT LdapSearchDialog : public QDialog
38{
39 Q_OBJECT
40
41public:
42 enum FilterType {
43 Name = 0,
44 Email,
45 HomeNumber,
46 WorkNumber,
47 };
48
49 /**
50 * Creates a new ldap search dialog.
51 *
52 * @param parent The parent widget.
53 */
54 explicit LdapSearchDialog(QWidget *parent = nullptr);
55
56 /**
57 * Destroys the ldap search dialog.
58 */
59 ~LdapSearchDialog() override;
60
61 /**
62 * Sets the @p text in the search line edit.
63 */
64 void setSearchText(const QString &text);
65
66 /**
67 * Returns a list of contacts that have been selected
68 * in the LDAP search.
69 */
70 KContacts::Addressee::List selectedContacts() const;
71
72Q_SIGNALS:
73 /**
74 * This signal is emitted whenever the user clicked the
75 * 'Add Selected' button.
76 */
78
79protected Q_SLOTS:
80 void slotUser1();
81 void slotUser2();
82 void slotCustomContextMenuRequested(const QPoint &);
83 void slotCancelClicked();
84
85protected:
86 void closeEvent(QCloseEvent *) override;
87
88private:
89 //@cond PRIVATE
90 class LdapSearchDialogPrivate;
91 std::unique_ptr<LdapSearchDialogPrivate> const d;
92
93 Q_PRIVATE_SLOT(d, void slotAddResult(const KLDAPWidgets::LdapClient &, const KLDAPCore::LdapObject &))
94 Q_PRIVATE_SLOT(d, void slotStartSearch())
95 Q_PRIVATE_SLOT(d, void slotStopSearch())
96 Q_PRIVATE_SLOT(d, void slotSearchDone())
97 //@endcond
98};
99}
100Q_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 Tue Mar 26 2024 11:17:23 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.