File indexing completed on 2025-01-26 04:52:16

0001 /*
0002  * SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #pragma once
0008 
0009 #include <KConfigGroup>
0010 #include <QObject>
0011 namespace KLDAPCore
0012 {
0013 class LdapServer;
0014 }
0015 namespace KLDAPWidgets
0016 {
0017 class LdapWidgetItem;
0018 class LdapWidgetItemReadConfigServerJob : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit LdapWidgetItemReadConfigServerJob(QObject *parent = nullptr);
0023     ~LdapWidgetItemReadConfigServerJob() override;
0024 
0025     void start();
0026 
0027     LdapWidgetItem *ldapWidgetItem() const;
0028     void setLdapWidgetItem(LdapWidgetItem *ldapWidgetItem);
0029 
0030     [[nodiscard]] int currentIndex() const;
0031     void setCurrentIndex(int currentIndex);
0032 
0033     [[nodiscard]] bool active() const;
0034     void setActive(bool active);
0035 
0036     [[nodiscard]] KConfigGroup config() const;
0037     void setConfig(const KConfigGroup &config);
0038 
0039 private:
0040     void slotConfigLoaded(const KLDAPCore::LdapServer &server);
0041     LdapWidgetItem *mLdapWidgetItem = nullptr;
0042     KConfigGroup mConfig;
0043     int mCurrentIndex = -1;
0044     bool mActive = false;
0045 };
0046 }