File indexing completed on 2024-12-01 11:05:52

0001 /*
0002  *   SPDX-FileCopyrightText: 2010 Alex Fiestas <alex@eyeos.org>
0003  *   SPDX-FileCopyrightText: 2010 UFO Coders <info@ufocoders.com>
0004  *
0005  *   SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef WIZARDAGENT_H
0009 #define WIZARDAGENT_H
0010 
0011 #include <BluezQt/Agent>
0012 
0013 class WizardAgent : public BluezQt::Agent
0014 {
0015     Q_OBJECT
0016 
0017 public:
0018     explicit WizardAgent(QObject *parent = nullptr);
0019 
0020     QString pin() const;
0021     void setPin(const QString &pin);
0022 
0023     bool isFromDatabase();
0024     QString getPin(BluezQt::DevicePtr device);
0025 
0026     QDBusObjectPath objectPath() const override;
0027 
0028     void requestPinCode(BluezQt::DevicePtr device, const BluezQt::Request<QString> &req) override;
0029     void displayPinCode(BluezQt::DevicePtr device, const QString &pinCode) override;
0030     void requestPasskey(BluezQt::DevicePtr device, const BluezQt::Request<quint32> &req) override;
0031     void displayPasskey(BluezQt::DevicePtr device, const QString &passkey, const QString &entered) override;
0032     void requestConfirmation(BluezQt::DevicePtr device, const QString &passkey, const BluezQt::Request<> &req) override;
0033 
0034 Q_SIGNALS:
0035     void pinRequested(const QString &pin);
0036     void confirmationRequested(const QString &passkey, const BluezQt::Request<> &req);
0037 
0038 private:
0039     bool m_fromDatabase = false;
0040     QString m_pin;
0041 };
0042 
0043 #endif // WIZARDAGENT_H