File indexing completed on 2024-11-10 04:54:22
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 #pragma once 0009 0010 #include <BluezQt/Agent> 0011 0012 class WizardAgent : public BluezQt::Agent 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 explicit WizardAgent(QObject *parent = nullptr); 0018 0019 QString pin() const; 0020 void setPin(const QString &pin); 0021 0022 bool isFromDatabase(); 0023 QString getPin(BluezQt::DevicePtr device); 0024 0025 QDBusObjectPath objectPath() const override; 0026 0027 void requestPinCode(BluezQt::DevicePtr device, const BluezQt::Request<QString> &req) override; 0028 void displayPinCode(BluezQt::DevicePtr device, const QString &pinCode) override; 0029 void requestPasskey(BluezQt::DevicePtr device, const BluezQt::Request<quint32> &req) override; 0030 void displayPasskey(BluezQt::DevicePtr device, const QString &passkey, const QString &entered) override; 0031 void requestConfirmation(BluezQt::DevicePtr device, const QString &passkey, const BluezQt::Request<> &req) override; 0032 0033 Q_SIGNALS: 0034 void pinRequested(const QString &pin); 0035 void confirmationRequested(const QString &passkey, const BluezQt::Request<> &req); 0036 0037 private: 0038 bool m_fromDatabase = false; 0039 QString m_pin; 0040 };