File indexing completed on 2024-06-23 11:48:17

0001 /*
0002     SPDX-FileCopyrightText: 2010 UFO Coders <info@ufocoders.com>
0003 
0004     SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #ifndef BLUEWIZARD_H
0008 #define BLUEWIZARD_H
0009 
0010 #include <QObject>
0011 #include <QWizard>
0012 
0013 #include <BluezQt/Manager>
0014 
0015 class WizardAgent;
0016 
0017 class BlueWizard : public QWizard
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit BlueWizard();
0023 
0024     BluezQt::DevicePtr device() const;
0025     void setDevice(BluezQt::DevicePtr device);
0026 
0027     WizardAgent *agent() const;
0028     BluezQt::Manager *manager() const;
0029 
0030     enum {
0031         Discover,
0032         Pairing,
0033         Success,
0034         Fail,
0035         Connect,
0036     };
0037 
0038 private Q_SLOTS:
0039     void initJobResult(BluezQt::InitManagerJob *job);
0040     void operationalChanged(bool operational);
0041 
0042 private:
0043     void done(int result) override;
0044 
0045     BluezQt::Manager *m_manager = nullptr;
0046     WizardAgent *const m_agent;
0047 
0048     BluezQt::DevicePtr m_device;
0049 };
0050 
0051 #endif // BLUEWIZARD_H