KLDAPCore::LdapClientSearch Class

Header: #include <KLDAPCore/LdapClientSearch>
CMake: find_package(KPim6LdapCore REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::LdapCore)
Inherits: QObject

Public Functions

LdapClientSearch(QObject *parent = nullptr)
LdapClientSearch(const QStringList &attr, QObject *parent = nullptr)
virtual ~LdapClientSearch() override
QStringList attributes() const
void cancelSearch()
QList<KLDAPCore::LdapClient *> clients() const
QString filter() const
bool isAvailable() const
void setAttributes(const QStringList &attributes)
void setFilter(const QString &filter)
void startSearch(const QString &query)
void updateCompletionWeights()

Signals

void searchData(const KLDAPCore::LdapResult::List &results)
void searchData(const KLDAPCore::LdapResultObject::List &results)
void searchData(const QStringList &results)
void searchDone()

Detailed Description

Member Function Documentation

[explicit] LdapClientSearch::LdapClientSearch(QObject *parent = nullptr)

Creates a new LDAP client search object. parent the parent object

[explicit] LdapClientSearch::LdapClientSearch(const QStringList &attr, QObject *parent = nullptr)

Creates a new LDAP client search object with specified attributes. attr the list of attributes to search for parent the parent object

[override virtual noexcept] LdapClientSearch::~LdapClientSearch()

Destroys the LDAP client search object.

QStringList LdapClientSearch::attributes() const

Returns the attributes that are queried from the LDAP server. Returns the list of attribute names

See also setAttributes().

void LdapClientSearch::cancelSearch()

Cancels the currently running search query.

QList<KLDAPCore::LdapClient *> LdapClientSearch::clients() const

Returns the list of configured LDAP clients.

QString LdapClientSearch::filter() const

Returns the filter for the search query. Returns the LDAP filter string

See also setFilter().

bool LdapClientSearch::isAvailable() const

Returns whether LDAP search is possible at all.

Note: This method can return false if either no LDAP is configured or the system does not support the KIO LDAP protocol. Returns true if LDAP search is available, false otherwise

[signal] void LdapClientSearch::searchData(const KLDAPCore::LdapResult::List &results)

This signal is emitted whenever new contacts have been found during the lookup.

results The list of found contacts.

Note: This signal is overloaded. To connect to this signal:

// Connect using qOverload:
connect(ldapClientSearch, qOverload(&LdapClientSearch::searchData),
        receiver, &ReceiverClass::slot);

// Or using a lambda:
connect(ldapClientSearch, qOverload(&LdapClientSearch::searchData),
        this, [](const KLDAPCore::LdapResult::List &results) { /* handle searchData */ });
For more examples and approaches, see connecting to overloaded signals.

[signal] void LdapClientSearch::searchData(const KLDAPCore::LdapResultObject::List &results)

This signal is emitted whenever new contacts have been found during the lookup.

results The list of found contacts.

Note: This signal is overloaded. To connect to this signal:

// Connect using qOverload:
connect(ldapClientSearch, qOverload(&LdapClientSearch::searchData),
        receiver, &ReceiverClass::slot);

// Or using a lambda:
connect(ldapClientSearch, qOverload(&LdapClientSearch::searchData),
        this, [](const KLDAPCore::LdapResultObject::List &results) { /* handle searchData */ });
For more examples and approaches, see connecting to overloaded signals.

[signal] void LdapClientSearch::searchData(const QStringList &results)

This signal is emitted whenever new contacts have been found during the lookup.

results The contacts in the form "Full Name <email>"

Note: This signal is overloaded. To connect to this signal:

// Connect using qOverload:
connect(ldapClientSearch, qOverload(&LdapClientSearch::searchData),
        receiver, &ReceiverClass::slot);

// Or using a lambda:
connect(ldapClientSearch, qOverload(&LdapClientSearch::searchData),
        this, [](const QStringList &results) { /* handle searchData */ });
For more examples and approaches, see connecting to overloaded signals.

[signal] void LdapClientSearch::searchDone()

This signal is emitted whenever the lookup is complete or the user has canceled the query.

void LdapClientSearch::setAttributes(const QStringList &attributes)

Sets the attributes that are queried from the LDAP server. attributes the list of attribute names to query

See also attributes().

void LdapClientSearch::setFilter(const QString &filter)

Sets the filter for the search query. filter the LDAP filter string to set

See also filter().

void LdapClientSearch::startSearch(const QString &query)

Starts the LDAP search on all configured LDAP clients with the given search query.

void LdapClientSearch::updateCompletionWeights()

Updates the completion weights for the configured LDAP clients from the configuration file.