diff options
author | Dan Williams <dcbw@redhat.com> | 2010-10-27 20:22:14 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-10-27 20:22:14 -0500 |
commit | 83ab4ec2ee62e75028a6025243c7f07485d4ca81 (patch) | |
tree | f777db6326361b55f1dd07a06a05676435a92d9a /src/settings/nm-settings.h | |
parent | 1ec6b67162ba18ad124150f6064268ff30cf87e7 (diff) | |
download | NetworkManager-83ab4ec2ee62e75028a6025243c7f07485d4ca81.tar.gz |
settings: system-settings -> settings
Diffstat (limited to 'src/settings/nm-settings.h')
-rw-r--r-- | src/settings/nm-settings.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/settings/nm-settings.h b/src/settings/nm-settings.h new file mode 100644 index 0000000000..51c454fd99 --- /dev/null +++ b/src/settings/nm-settings.h @@ -0,0 +1,103 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * Søren Sandmann <sandmann@daimi.au.dk> + * Dan Williams <dcbw@redhat.com> + * Tambet Ingo <tambet@gmail.com> + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2008 Novell, Inc. + */ + +#ifndef __NM_SETTINGS_H__ +#define __NM_SETTINGS_H__ + +#include <nm-connection.h> + +#include "nm-sysconfig-connection.h" +#include "nm-system-config-interface.h" +#include "nm-device.h" + +#define NM_TYPE_SETTINGS (nm_settings_get_type ()) +#define NM_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS, NMSettings)) +#define NM_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTINGS, NMSettingsClass)) +#define NM_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS)) +#define NM_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTINGS)) +#define NM_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS, NMSettingsClass)) + +#define NM_SETTINGS_UNMANAGED_SPECS "unmanaged-specs" +#define NM_SETTINGS_HOSTNAME "hostname" +#define NM_SETTINGS_CAN_MODIFY "can-modify" + +#define NM_SETTINGS_CONNECTION_ADDED "connection-added" +#define NM_SETTINGS_CONNECTION_UPDATED "connection-updated" +#define NM_SETTINGS_CONNECTION_REMOVED "connection-removed" +#define NM_SETTINGS_CONNECTION_VISIBILITY_CHANGED "connection-visibility-changed" +#define NM_SETTINGS_CONNECTIONS_LOADED "connections-loaded" + +typedef struct { + GObject parent_instance; +} NMSettings; + +typedef struct { + GObjectClass parent_class; + + /* Signals */ + void (*properties_changed) (NMSettings *self, GHashTable *properties); + + void (*connection_added) (NMSettings *self, NMConnection *connection); + + void (*connection_updated) (NMSettings *self, NMConnection *connection); + + void (*connection_removed) (NMSettings *self, NMConnection *connection); + + void (*connection_visibility_changed) (NMSettings *self, NMConnection *connection); + + void (*connections_loaded) (NMSettings *self); +} NMSettingsClass; + +GType nm_settings_get_type (void); + +NMSettings *nm_settings_new (const char *config_file, + const char *plugins, + GError **error); + +typedef void (*NMSettingsForEachFunc) (NMSettings *settings, + NMSysconfigConnection *connection, + gpointer user_data); + +void nm_settings_for_each_connection (NMSettings *settings, + NMSettingsForEachFunc for_each_func, + gpointer user_data); + +/* Returns a list of NMSysconfigConnections. Caller must free the list with + * g_slist_free(). + */ +GSList *nm_settings_get_connections (NMSettings *settings); + +NMSysconfigConnection *nm_settings_get_connection_by_path (NMSettings *settings, + const char *path); + +const GSList *nm_settings_get_unmanaged_specs (NMSettings *self); + +char *nm_settings_get_hostname (NMSettings *self); + +void nm_settings_device_added (NMSettings *self, NMDevice *device); + +void nm_settings_device_removed (NMSettings *self, NMDevice *device); + +#endif /* __NM_SETTINGS_H__ */ |