1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License along
13 * with this program; if not, write to the Free Software Foundation, Inc.,
14 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 * (C) Copyright 2008 - 2010 Red Hat, Inc.
17 * Author: David Zeuthen <davidz@redhat.com>
18 * Author: Dan Williams <dcbw@redhat.com>
21 #ifndef __NETWORKMANAGER_SESSION_MONITOR_H__
22 #define __NETWORKMANAGER_SESSION_MONITOR_H__
25 #include "nm-default.h"
29 #define NM_TYPE_SESSION_MONITOR (nm_session_monitor_get_type ())
30 #define NM_SESSION_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_SESSION_MONITOR, NMSessionMonitor))
31 #define NM_SESSION_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), NM_TYPE_SESSION_MONITOR, NMSessionMonitorClass))
32 #define NM_SESSION_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_SESSION_MONITOR, NMSessionMonitorClass))
33 #define NM_IS_SESSION_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NM_TYPE_SESSION_MONITOR))
34 #define NM_IS_SESSION_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NM_TYPE_SESSION_MONITOR))
36 #define NM_SESSION_MONITOR_CHANGED "changed"
38 typedef struct _NMSessionMonitorClass NMSessionMonitorClass;
40 typedef void (*NMSessionCallback) (NMSessionMonitor *monitor, gpointer user_data);
42 GType nm_session_monitor_get_type (void) G_GNUC_CONST;
44 NMSessionMonitor *nm_session_monitor_get (void);
46 gulong nm_session_monitor_connect (NMSessionMonitor *self,
47 NMSessionCallback callback,
49 void nm_session_monitor_disconnect (NMSessionMonitor *self,
52 gboolean nm_session_monitor_uid_to_user (uid_t uid, const char **out_user);
53 gboolean nm_session_monitor_user_to_uid (const char *user, uid_t *out_uid);
54 gboolean nm_session_monitor_session_exists (NMSessionMonitor *self,
60 #endif /* __NETWORKMANAGER_SESSION_MONITOR_H__ */