/* nm-client.h - * * Copyright 2007 OpenMoko, Inc. * Authored by Chia-I Wu * * Based on libnm-glib by: Dan Williams * Copyright 2005 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef NM_CLIENT_H #define NM_CLIENT_H 1 #include #include #include #include #include "nm-device.h" G_BEGIN_DECLS #define NM_TYPE_CLIENT (nm_client_get_type ()) #define NM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CLIENT, NMClient)) #define NM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CLIENT, NMClientClass)) #define NM_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CLIENT)) #define NM_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CLIENT)) #define NM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CLIENT, NMClientClass)) #define NM_CLIENT_WIRELESS_ENABLED "wireless_enabled" #define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless_hardware_enabled" typedef struct { GObject parent; } NMClient; typedef struct { GObjectClass parent; /* Signals */ void (*manager_running) (NMClient *client, gboolean running); void (*device_added) (NMClient *client, NMDevice *device); void (*device_removed) (NMClient *client, NMDevice *device); void (*state_change) (NMClient *client, NMState state); } NMClientClass; GType nm_client_get_type (void); NMClient *nm_client_new (void); gboolean nm_client_manager_is_running (NMClient *client); GSList *nm_client_get_devices (NMClient *client); NMDevice *nm_client_get_device_by_path (NMClient *client, const char *object_path); void nm_client_activate_device(NMClient *client, NMDevice *dev, DiversityAp *ap); gboolean nm_client_wireless_get_enabled (NMClient *client); void nm_client_wireless_set_enabled (NMClient *client, gboolean enabled); NMState nm_client_get_state (NMClient *client); void nm_client_sleep (NMClient *client, gboolean sleep); G_END_DECLS #endif /* NM_CLIENT_H */