1
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2010 Canonical Ltd
3
* Copyright (C) 2010-12 Canonical Ltd
5
5
* This program is free software: you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License version 3 as
14
14
* You should have received a copy of the GNU General Public License
15
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Andrea Azzarone <aazzarone@hotmail.it>
17
* Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
20
#ifndef DEVICES_SETTINGS_H
21
#define DEVICES_SETTINGS_H
20
#ifndef UNITYSHELL_DEVICES_SETTINGS_H
21
#define UNITYSHELL_DEVICES_SETTINGS_H
23
#include <boost/noncopyable.hpp>
27
#include <boost/utility.hpp>
28
#include <sigc++/sigc++.h>
29
#include <UnityCore/GLibWrapper.h>
33
typedef std::list<std::string> DeviceList;
35
class DevicesSettings : boost::noncopyable
27
#include <sigc++/signal.h>
28
#include <sigc++/trackable.h>
35
class DevicesSettings : boost::noncopyable, public sigc::trackable
48
static DevicesSettings& GetDefault();
50
void SetDevicesOption(DevicesOption devices_option);
51
DevicesOption GetDevicesOption() { return devices_option_; };
53
DeviceList const& GetFavorites() { return favorites_; };
54
void AddFavorite(std::string const& uuid);
55
void RemoveFavorite(std::string const& uuid);
57
void Changed(std::string const& key);
38
typedef std::shared_ptr<DevicesSettings> Ptr;
40
virtual ~DevicesSettings() {};
42
virtual bool IsABlacklistedDevice(std::string const& uuid) const = 0;
43
virtual void TryToBlacklist(std::string const& uuid) = 0;
44
virtual void TryToUnblacklist(std::string const& uuid) = 0;
60
46
sigc::signal<void> changed;
64
void SaveFavorites(DeviceList const& favorites);
66
glib::Object<GSettings> settings_;
67
DeviceList favorites_;
69
DevicesOption devices_option_;
74
#endif // DEVICES_SETTINGS_H