Merging upstream version 0.7.0 (Closes: #493243, #510888, #567617, #699414, #709777...
[debian/lxpanel.git] / plugins / netstatus / netstatus-iface.h
1 /*
2 * Copyright (C) 2003 Sun Microsystems, Inc.
3 * Copyright (C) 2004 Red Hat Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 * 02111-1307, USA.
19 *
20 * Authors:
21 * Erwann Chenede <erwann.chenede@sun.com>
22 * Mark McLoughlin <mark@skynet.ie>
23 */
24
25 #ifndef __NETSTATUS_IFACE_H__
26 #define __NETSTATUS_IFACE_H__
27
28 #include <glib.h>
29 #include <glib-object.h>
30
31 #include "netstatus-util.h"
32
33 G_BEGIN_DECLS
34
35 #define NETSTATUS_TYPE_IFACE (netstatus_iface_get_type ())
36 #define NETSTATUS_IFACE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NETSTATUS_TYPE_IFACE, NetstatusIface))
37 #define NETSTATUS_IFACE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NETSTATUS_TYPE_IFACE, NetstatusIfaceClass))
38 #define NETSTATUS_IS_IFACE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NETSTATUS_TYPE_IFACE))
39 #define NETSTATUS_IS_IFACE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NETSTATUS_TYPE_IFACE))
40 #define NETSTATUS_IFACE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NETSTATUS_TYPE_IFACE, NetstatusIfaceClass))
41
42 typedef struct _NetstatusIface NetstatusIface;
43 typedef struct _NetstatusIfaceClass NetstatusIfaceClass;
44 typedef struct _NetstatusIfacePrivate NetstatusIfacePrivate;
45
46 struct _NetstatusIface
47 {
48 GObject parent_instance;
49
50 NetstatusIfacePrivate *priv;
51 };
52
53 struct _NetstatusIfaceClass
54 {
55 GObjectClass parent_class;
56 };
57
58 GList * netstatus_list_interface_names (GError **error);
59
60 GType netstatus_iface_get_type (void) G_GNUC_CONST;
61
62 NetstatusIface * netstatus_iface_new (const char *name);
63
64 const char * netstatus_iface_get_name (NetstatusIface *iface);
65 void netstatus_iface_set_name (NetstatusIface *iface,
66 const char *name);
67 NetstatusState netstatus_iface_get_state (NetstatusIface *iface);
68 void netstatus_iface_get_statistics (NetstatusIface *iface,
69 NetstatusStats *stats);
70 gboolean netstatus_iface_get_is_wireless (NetstatusIface *iface);
71 int netstatus_iface_get_signal_strength (NetstatusIface *iface);
72
73 void netstatus_iface_set_error (NetstatusIface *iface,
74 const GError *error);
75 const GError * netstatus_iface_get_error (NetstatusIface *iface);
76 void netstatus_iface_clear_error (NetstatusIface *iface,
77 NetstatusError code);
78
79 gboolean netstatus_iface_get_inet4_details (NetstatusIface *iface,
80 char **addr,
81 char **dest,
82 char **bcast,
83 char **mask);
84 gboolean netstatus_iface_get_device_details (NetstatusIface *iface,
85 const char **hw_name,
86 char **hw_addr);
87 gboolean netstatus_iface_get_is_loopback (NetstatusIface *iface);
88
89 G_END_DECLS
90
91 #endif /* __NETSTATUS_IFACE_H__ */