device: renew dhcp leases on awake for software devices
[NetworkManager.git] / src / nm-rfkill-manager.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager -- Network link manager
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Copyright (C) 2007 - 2008 Novell, Inc.
19  * Copyright (C) 2007 - 2013 Red Hat, Inc.
20  */
21
22
23 #include "nm-default.h"
24
25 #ifndef __NETWORKMANAGER_RFKILL_MANAGER_H__
26 #define __NETWORKMANAGER_RFKILL_MANAGER_H__
27
28 typedef enum { /*< skip >*/
29         RFKILL_UNBLOCKED = 0,
30         RFKILL_SOFT_BLOCKED = 1,
31         RFKILL_HARD_BLOCKED = 2
32 } RfKillState;
33
34 typedef enum { /*< skip >*/
35         RFKILL_TYPE_WLAN = 0,
36         RFKILL_TYPE_WWAN = 1,
37
38         /* UNKNOWN and MAX should always be 1 more than
39          * the last rfkill type since RFKILL_TYPE_MAX is
40          * used as an array size.
41          */
42         RFKILL_TYPE_UNKNOWN, /* KEEP LAST */
43         RFKILL_TYPE_MAX = RFKILL_TYPE_UNKNOWN
44 } RfKillType;
45
46
47 #define NM_TYPE_RFKILL_MANAGER            (nm_rfkill_manager_get_type ())
48 #define NM_RFKILL_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_RFKILL_MANAGER, NMRfkillManager))
49 #define NM_RFKILL_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_RFKILL_MANAGER, NMRfkillManagerClass))
50 #define NM_IS_RFKILL_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_RFKILL_MANAGER))
51 #define NM_IS_RFKILL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_RFKILL_MANAGER))
52 #define NM_RFKILL_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_RFKILL_MANAGER, NMRfkillManagerClass))
53
54 struct _NMRfkillManager {
55         GObject parent;
56 };
57
58 typedef struct {
59         GObjectClass parent;
60
61         /* signals */
62         void (*rfkill_changed) (NMRfkillManager *manager, RfKillType rtype, RfKillState state);
63 } NMRfkillManagerClass;
64
65 GType nm_rfkill_manager_get_type (void);
66
67 NMRfkillManager *nm_rfkill_manager_new (void);
68
69 RfKillState nm_rfkill_manager_get_rfkill_state (NMRfkillManager *manager, RfKillType rtype);
70
71 #endif  /* NM_RFKILL_MANAGER_H */
72