1
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2010 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Andrea Azzarone <aazzarone@hotmail.it>
3
* Copyright (C) 2010 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Andrea Azzarone <aazzarone@hotmail.it>
20
20
#ifndef DEVICES_SETTINGS_H
21
21
#define DEVICES_SETTINGS_H
23
26
#include <gio/gio.h>
27
class DevicesSettings : public nux::Object
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
41
static DevicesSettings* GetDefault();
43
DevicesOption GetDevicesOption();
45
sigc::signal<void, DevicesSettings*> changed;
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);
60
sigc::signal<void> changed;
49
static void Changed(GSettings* settings, gchar* key, DevicesSettings* self);
64
void SaveFavorites(DeviceList const& favorites);
53
int _raw_devices_option;
54
DevicesOption _devices_option;
66
glib::Object<GSettings> settings_;
67
DeviceList favorites_;
69
DevicesOption devices_option_;
57
74
#endif // DEVICES_SETTINGS_H