BluezQt

rfkill.h
1 /*
2  * BluezQt - Asynchronous Bluez wrapper library
3  *
4  * SPDX-FileCopyrightText: 2015 David Rosca <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #ifndef BLUEZQT_RFKILL_H
10 #define BLUEZQT_RFKILL_H
11 
12 #include <QHash>
13 #include <QObject>
14 
15 #include "bluezqt_export.h"
16 
17 #include <memory>
18 
19 namespace BluezQt
20 {
21 struct RfkillPrivate;
22 
23 class BLUEZQT_EXPORT Rfkill : public QObject
24 {
25  Q_OBJECT
26  Q_PROPERTY(State state READ state NOTIFY stateChanged)
27 
28 public:
29  enum State {
30  Unblocked = 0,
31  SoftBlocked = 1,
32  HardBlocked = 2,
33  Unknown = 3,
34  };
35  Q_ENUM(State)
36 
37  explicit Rfkill(QObject *parent = nullptr);
38  ~Rfkill() override;
39 
40  State state() const;
41  bool block();
42  bool unblock();
43 
44 Q_SIGNALS:
45  void stateChanged(State state);
46 
47 private Q_SLOTS:
48  void devReadyRead();
49 
50 private:
51  void init();
52  bool openForWriting();
53  void updateRfkillDevices();
54  bool setSoftBlock(quint8 soft);
55  std::unique_ptr<RfkillPrivate> d;
56 };
57 
58 } // namespace BluezQt
59 
60 #endif // BLUEZQT_RFKILL_H
QCA_EXPORT void init()
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.