2
* Copyright (C) 2016 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as published
6
* by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef W11TNG_URFKILL_MANAGER_H_
19
#define W11TNG_URFKILL_MANAGER_H_
21
#include "w11tng/rfkillmanager.h"
22
#include "ac/scoped_gobject.h"
27
class URfkillManager : public RfkillManager,
28
public std::enable_shared_from_this<URfkillManager> {
32
static constexpr const char* kBusName{"org.freedesktop.URfkill"};
33
static constexpr const char* kObjectPath{"/org/freedesktop/URfkill/WLAN"};
37
bool IsBlocked(const Type &type) override;
41
Ptr FinalizeConstruction();
43
void ParseProperties(GVariant *properties);
44
void SyncProperties();
46
static void OnPropertiesChanged(GDBusConnection *connection, const gchar *sender_name,
47
const gchar *object_path, const gchar *interface_name,
48
const gchar *signal_name, GVariant *parameters,
51
ac::ScopedGObject<GDBusConnection> connection_;
52
std::map<Type,bool> block_status_;