Changeset View
Changeset View
Standalone View
Standalone View
src/noinputnooutputagent.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * BluezQt - Asynchronous BlueZ wrapper library | ||||
3 | * | ||||
4 | * Copyright (C) 2018 Manuel Weichselbaumer <mincequi@web.de> | ||||
5 | * | ||||
6 | * This library is free software; you can redistribute it and/or | ||||
7 | * modify it under the terms of the GNU Lesser General Public | ||||
8 | * License as published by the Free Software Foundation; either | ||||
9 | * version 2.1 of the License, or (at your option) version 3, or any | ||||
10 | * later version accepted by the membership of KDE e.V. (or its | ||||
11 | * successor approved by the membership of KDE e.V.), which shall | ||||
12 | * act as a proxy defined in Section 6 of version 3 of the license. | ||||
13 | * | ||||
14 | * This library is distributed in the hope that it will be useful, | ||||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
17 | * Lesser General Public License for more details. | ||||
18 | * | ||||
19 | * You should have received a copy of the GNU Lesser General Public | ||||
20 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
21 | */ | ||||
22 | | ||||
23 | #ifndef BLUEZQT_NOINPUTNOOUTPUTAGENT_H | ||||
24 | #define BLUEZQT_NOINPUTNOOUTPUTAGENT_H | ||||
25 | | ||||
26 | #include "agent.h" | ||||
27 | | ||||
28 | namespace BluezQt | ||||
29 | { | ||||
30 | | ||||
31 | /** | ||||
32 | * @class BluezQt::NoInputNoOutputAgent noinputnooutputagent.h <BluezQt/NoInputNoOutputAgent> | ||||
33 | * | ||||
34 | * Bluetooth no input, no output agent. | ||||
35 | * | ||||
36 | * This agent will auto accept any authorization request from any device with the provided service UUIDs. | ||||
37 | */ | ||||
38 | class BLUEZQT_EXPORT NoInputNoOutputAgent : public Agent | ||||
39 | { | ||||
40 | Q_OBJECT | ||||
41 | | ||||
42 | public: | ||||
43 | /** | ||||
44 | * Creates a new NoInputNoOutputAgent object. | ||||
45 | * | ||||
46 | * @param parent | ||||
47 | */ | ||||
48 | explicit NoInputNoOutputAgent(const QStringList &uuids, QObject *parent = nullptr); | ||||
49 | | ||||
50 | /** | ||||
51 | * Destroys a NoInputNoOutputAgent object. | ||||
52 | */ | ||||
53 | ~NoInputNoOutputAgent() override; | ||||
54 | | ||||
55 | Q_SIGNALS: | ||||
56 | /** | ||||
57 | * Indicates that a service was authorized. | ||||
58 | */ | ||||
59 | void serviceAuthorized(DevicePtr device, const QString &uuid, bool allowed); | ||||
60 | | ||||
61 | private: | ||||
62 | QDBusObjectPath objectPath() const override; | ||||
63 | Capability capability() const override; | ||||
64 | void authorizeService(DevicePtr device, const QString &uuid, const Request<> &request) override; | ||||
65 | | ||||
66 | class NoInputNoOutputAgentPrivate *const d; | ||||
67 | }; | ||||
68 | | ||||
69 | } // namespace BluezQt | ||||
70 | | ||||
71 | #endif // BLUEZQT_NOINPUTNOOUTPUTAGENT_H |