NetworkManager/libnm-glib/nm-client.h
Dan Williams e3d15a5f73 2007-08-14 Dan Williams <dcbw@redhat.com>
* include/NetworkManagerVPN.h
	  src/vpn-manager/nm-dbus-vpn.c
	  src/vpn-manager/nm-dbus-vpn.h
	  src/vpn-manager/nm-vpn-act-request.c
	  src/vpn-manager/nm-vpn-act-request.h
	  src/vpn-manager/nm-vpn-service.c
	  src/vpn-manager/nm-vpn-service.h
	  libnm-glib/nm-vpn-connection.c
	  libnm-glib/nm-vpn-connection.h
	  libnm-glib/nm-client.h
		- Rename NM_VPN_STATE_* -> NM_VPN_SERVICE_STATE_* and NMVPNState -> 
			NMVPNServiceState to clarify what they apply to
		- Rename NM_VPN_ACT_STAGE_* -> NM_VPN_CONNECTION_STATE_* and
			NMVPNActStage -> NMVPNConnectionState for the same reason

	* libnm-glib/nm-client.c
		- Constant + type renames from above
		- Properly handle NameOwnerChanged/manager_running signals
			for NM service; only emit when state really changes
		- Use hash tables correctly so that the key (which was previously owned
			by the D-Bus message) now has the same lifetime as the value, since
			the key is now taken from the the NMVPNConnection itself.  This
			really fixes the double-VPN names in the applet



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2677 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-14 14:09:57 +00:00

69 lines
2.3 KiB
C

#ifndef NM_CLIENT_H
#define NM_CLIENT_H 1
#include <glib/gtypes.h>
#include <glib-object.h>
#include <dbus/dbus-glib.h>
#include <NetworkManager.h>
#include <NetworkManagerVPN.h>
#include "nm-object.h"
#include "nm-device.h"
#include "nm-vpn-connection.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))
typedef struct {
NMObject parent;
} NMClient;
typedef struct {
NMObjectClass 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);
void (*vpn_connection_added) (NMClient *client, NMVPNConnection *connection);
void (*vpn_connection_removed) (NMClient *client, NMVPNConnection *connection);
void (*vpn_state_change) (NMClient *client, NMVPNConnectionState 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);
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);
/* VPN */
GSList *nm_client_get_vpn_connections (NMClient *client);
NMVPNConnection *nm_client_get_vpn_connection_by_name (NMClient *client,
const char *name);
void nm_client_remove_vpn_connection (NMClient *client,
NMVPNConnection *connection);
NMVPNConnectionState nm_client_get_vpn_state (NMClient *client);
G_END_DECLS
#endif /* NM_CLIENT_H */