File indexing completed on 2024-04-14 05:19:47

0001 /*
0002  * This file is part of the KDE project
0003  *
0004  * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.0-or-later
0007  */
0008 
0009 #pragma once
0010 
0011 #include "ui_pairing.h"
0012 
0013 #include <QWizardPage>
0014 
0015 #include <BluezQt/Device>
0016 #include <BluezQt/Request>
0017 
0018 class BlueWizard;
0019 
0020 class PairingPage : public QWizardPage, Ui::Pairing
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit PairingPage(BlueWizard *parent = nullptr);
0026 
0027     int nextId() const override;
0028     void initializePage() override;
0029 
0030 public Q_SLOTS:
0031     void pairingFinished(BluezQt::PendingCall *call);
0032     void pinRequested(const QString &pin);
0033     void confirmationRequested(const QString &passkey, const BluezQt::Request<> &req);
0034     void matchesClicked();
0035     void notMatchClicked();
0036     void cancelClicked();
0037 
0038 private:
0039     QList<QWizard::WizardButton> wizardButtonsLayout() const;
0040 
0041     BlueWizard *const m_wizard;
0042     BluezQt::DevicePtr m_device;
0043     BluezQt::Request<> m_req;
0044     bool m_success = false;
0045 };