summary refs log tree commit diff
path: root/src/settings/nm-settings-plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/nm-settings-plugin.h')
-rw-r--r--src/settings/nm-settings-plugin.h81
1 files changed, 40 insertions, 41 deletions
diff --git a/src/settings/nm-settings-plugin.h b/src/settings/nm-settings-plugin.h
index fdd48f2b..6fba25e7 100644
--- a/src/settings/nm-settings-plugin.h
+++ b/src/settings/nm-settings-plugin.h
@@ -15,52 +15,53 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Copyright (C) 2007 - 2018 Red Hat, Inc.
+ * Copyright (C) 2007 - 2011 Red Hat, Inc.
  * Copyright (C) 2008 Novell, Inc.
  */
 
-#ifndef __NM_SETTINGS_PLUGIN_H__
-#define __NM_SETTINGS_PLUGIN_H__
+#ifndef __NETWORKMANAGER_SETTINGS_PLUGIN_H__
+#define __NETWORKMANAGER_SETTINGS_PLUGIN_H__
 
 #include "nm-connection.h"
 
+/* Plugin's factory function that returns a GObject that implements
+ * NMSettingsPlugin.
+ */
+GObject * nm_settings_plugin_factory (void);
+
 #define NM_TYPE_SETTINGS_PLUGIN               (nm_settings_plugin_get_type ())
 #define NM_SETTINGS_PLUGIN(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_PLUGIN, NMSettingsPlugin))
-#define NM_SETTINGS_PLUGIN_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTINGS_PLUGIN, NMSettingsPluginClass))
 #define NM_IS_SETTINGS_PLUGIN(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_PLUGIN))
-#define NM_IS_SETTINGS_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTINGS_PLUGIN))
-#define NM_SETTINGS_PLUGIN_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS_PLUGIN, NMSettingsPluginClass))
+#define NM_SETTINGS_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_PLUGIN, NMSettingsPluginInterface))
 
-#define NM_SETTINGS_PLUGIN_UNMANAGED_SPECS_CHANGED    "unmanaged-specs-changed"
+#define NM_SETTINGS_PLUGIN_UNMANAGED_SPECS_CHANGED "unmanaged-specs-changed"
 #define NM_SETTINGS_PLUGIN_UNRECOGNIZED_SPECS_CHANGED "unrecognized-specs-changed"
-#define NM_SETTINGS_PLUGIN_CONNECTION_ADDED           "connection-added"
+#define NM_SETTINGS_PLUGIN_CONNECTION_ADDED "connection-added"
 
-typedef struct {
-	GObject parent;
-} NMSettingsPlugin;
+typedef struct _NMSettingsPlugin NMSettingsPlugin;
 
 typedef struct {
-	GObjectClass parent;
+	GTypeInterface g_iface;
 
 	/* Called when the plugin is loaded to initialize it */
-	void (*initialize) (NMSettingsPlugin *plugin);
+	void     (*init) (NMSettingsPlugin *config);
 
 	/* Returns a GSList of NMSettingsConnection objects that represent
 	 * connections the plugin knows about.  The returned list is freed by the
 	 * system settings service.
 	 */
-	GSList * (*get_connections) (NMSettingsPlugin *plugin);
+	GSList * (*get_connections) (NMSettingsPlugin *config);
 
 	/* Requests that the plugin load/reload a single connection, if it
 	 * recognizes the filename. Returns success or failure.
 	 */
-	gboolean (*load_connection) (NMSettingsPlugin *plugin,
+	gboolean (*load_connection) (NMSettingsPlugin *config,
 	                             const char *filename);
 
 	/* Requests that the plugin reload all connection files from disk,
 	 * and emit signals reflecting new, changed, and removed connections.
 	 */
-	void (*reload_connections) (NMSettingsPlugin *plugin);
+	void (*reload_connections) (NMSettingsPlugin *config);
 
 	/*
 	 * Return a string list of specifications of devices which NetworkManager
@@ -71,7 +72,7 @@ typedef struct {
 	 * Each string in the list must be in one of the formats recognized by
 	 * nm_device_spec_match_list().
 	 */
-	GSList * (*get_unmanaged_specs) (NMSettingsPlugin *plugin);
+	GSList * (*get_unmanaged_specs) (NMSettingsPlugin *config);
 
 	/*
 	 * Return a string list of specifications of devices for which at least
@@ -83,7 +84,7 @@ typedef struct {
 	 * Each string in the list must be in one of the formats recognized by
 	 * nm_device_spec_match_list().
 	 */
-	GSList * (*get_unrecognized_specs) (NMSettingsPlugin *plugin);
+	GSList * (*get_unrecognized_specs) (NMSettingsPlugin *config);
 
 	/*
 	 * Initialize the plugin-specific connection and return a new
@@ -92,42 +93,40 @@ typedef struct {
 	 * storage if @save_to_disk is TRUE.  The returned object is owned by the
 	 * plugin and must be referenced by the owner if necessary.
 	 */
-	NMSettingsConnection * (*add_connection) (NMSettingsPlugin *plugin,
+	NMSettingsConnection * (*add_connection) (NMSettingsPlugin *config,
 	                                          NMConnection *connection,
 	                                          gboolean save_to_disk,
 	                                          GError **error);
-} NMSettingsPluginClass;
 
-GType nm_settings_plugin_get_type (void);
+	/* Signals */
+
+	/* Emitted when a new connection has been found by the plugin */
+	void (*connection_added)   (NMSettingsPlugin *config,
+	                            NMSettingsConnection *connection);
 
-typedef NMSettingsPlugin *(*NMSettingsPluginFactoryFunc) (void);
+	/* Emitted when the list of unmanaged device specifications changes */
+	void (*unmanaged_specs_changed) (NMSettingsPlugin *config);
 
-/* Plugin's factory function that returns a #NMSettingsPlugin */
-NMSettingsPlugin *nm_settings_plugin_factory (void);
+	/* Emitted when the list of devices with unrecognized connections changes */
+	void (*unrecognized_specs_changed) (NMSettingsPlugin *config);
+} NMSettingsPluginInterface;
 
-void nm_settings_plugin_initialize (NMSettingsPlugin *config);
+GType nm_settings_plugin_get_type (void);
 
-GSList *nm_settings_plugin_get_connections (NMSettingsPlugin *plugin);
+void nm_settings_plugin_init (NMSettingsPlugin *config);
 
-gboolean nm_settings_plugin_load_connection (NMSettingsPlugin *plugin,
+GSList *nm_settings_plugin_get_connections (NMSettingsPlugin *config);
+
+gboolean nm_settings_plugin_load_connection (NMSettingsPlugin *config,
                                              const char *filename);
-void nm_settings_plugin_reload_connections (NMSettingsPlugin *plugin);
+void nm_settings_plugin_reload_connections (NMSettingsPlugin *config);
 
-GSList *nm_settings_plugin_get_unmanaged_specs (NMSettingsPlugin *plugin);
-GSList *nm_settings_plugin_get_unrecognized_specs (NMSettingsPlugin *plugin);
+GSList *nm_settings_plugin_get_unmanaged_specs (NMSettingsPlugin *config);
+GSList *nm_settings_plugin_get_unrecognized_specs (NMSettingsPlugin *config);
 
-NMSettingsConnection *nm_settings_plugin_add_connection (NMSettingsPlugin *plugin,
+NMSettingsConnection *nm_settings_plugin_add_connection (NMSettingsPlugin *config,
                                                          NMConnection *connection,
                                                          gboolean save_to_disk,
                                                          GError **error);
 
-/* internal API */
-
-void _nm_settings_plugin_emit_signal_connection_added (NMSettingsPlugin *plugin,
-                                                       NMSettingsConnection *sett_conn);
-
-void _nm_settings_plugin_emit_signal_unmanaged_specs_changed (NMSettingsPlugin *plugin);
-
-void _nm_settings_plugin_emit_signal_unrecognized_specs_changed (NMSettingsPlugin *plugin);
-
-#endif /* __NM_SETTINGS_PLUGIN_H__ */
+#endif /* __NETWORKMANAGER_SETTINGS_PLUGIN_H__ */