summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-remote-settings.h
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-glib/nm-remote-settings.h')
-rw-r--r--libnm-glib/nm-remote-settings.h82
1 files changed, 74 insertions, 8 deletions
diff --git a/libnm-glib/nm-remote-settings.h b/libnm-glib/nm-remote-settings.h
index d3085566e..e882e4fa1 100644
--- a/libnm-glib/nm-remote-settings.h
+++ b/libnm-glib/nm-remote-settings.h
@@ -18,7 +18,7 @@
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2008 Novell, Inc.
- * Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2009 - 2011 Red Hat, Inc.
*/
#ifndef NM_REMOTE_SETTINGS_H
@@ -38,17 +38,65 @@ G_BEGIN_DECLS
#define NM_IS_REMOTE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_REMOTE_SETTINGS))
#define NM_REMOTE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettingsClass))
-#define NM_REMOTE_SETTINGS_BUS "bus"
-#define NM_REMOTE_SETTINGS_SCOPE "scope"
+/**
+ * NMRemoteSettingsError:
+ * @NM_REMOTE_SETTINGS_ERROR_UNKNOWN: unknown or unclassified error
+ * @NM_REMOTE_SETTINGS_ERROR_CONNECTION_REMOVED: the #NMRemoteConnection object
+ * was removed before it was completely initialized
+ * @NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE: the #NMRemoteConnection object
+ * is not visible or otherwise unreadable
+ *
+ * Describes errors that may result from operations involving a #NMRemoteSettings.
+ *
+ **/
+typedef enum {
+ NM_REMOTE_SETTINGS_ERROR_UNKNOWN = 0,
+ NM_REMOTE_SETTINGS_ERROR_CONNECTION_REMOVED,
+ NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE,
+} NMRemoteSettingsError;
+
+#define NM_TYPE_REMOTE_SETTINGS_ERROR (nm_remote_settings_error_get_type ())
+GType nm_remote_settings_error_get_type (void);
+
+#define NM_REMOTE_SETTINGS_ERROR nm_remote_settings_error_quark ()
+GQuark nm_remote_settings_error_quark (void);
+
+
+#define NM_REMOTE_SETTINGS_BUS "bus"
#define NM_REMOTE_SETTINGS_SERVICE_RUNNING "service-running"
+#define NM_REMOTE_SETTINGS_HOSTNAME "hostname"
+#define NM_REMOTE_SETTINGS_CAN_MODIFY "can-modify"
+
+#define NM_REMOTE_SETTINGS_NEW_CONNECTION "new-connection"
+#define NM_REMOTE_SETTINGS_CONNECTIONS_READ "connections-read"
+
+typedef struct _NMRemoteSettings NMRemoteSettings;
+typedef struct _NMRemoteSettingsClass NMRemoteSettingsClass;
+
+
+typedef void (*NMRemoteSettingsAddConnectionFunc) (NMRemoteSettings *settings,
+ NMRemoteConnection *connection,
+ GError *error,
+ gpointer user_data);
-typedef struct {
+typedef void (*NMRemoteSettingsSaveHostnameFunc) (NMRemoteSettings *settings,
+ GError *error,
+ gpointer user_data);
+
+
+struct _NMRemoteSettings {
GObject parent;
-} NMRemoteSettings;
+};
-typedef struct {
+struct _NMRemoteSettingsClass {
GObjectClass parent;
+ /* Signals */
+ void (*new_connection) (NMRemoteSettings *settings,
+ NMRemoteConnection *connection);
+
+ void (*connections_read) (NMRemoteSettings *settings);
+
/* Padding for future expansion */
void (*_reserved1) (void);
void (*_reserved2) (void);
@@ -56,11 +104,29 @@ typedef struct {
void (*_reserved4) (void);
void (*_reserved5) (void);
void (*_reserved6) (void);
-} NMRemoteSettingsClass;
+};
GType nm_remote_settings_get_type (void);
-NMRemoteSettings *nm_remote_settings_new (DBusGConnection *bus, NMConnectionScope scope);
+NMRemoteSettings *nm_remote_settings_new (DBusGConnection *bus);
+
+GSList *nm_remote_settings_list_connections (NMRemoteSettings *settings);
+
+NMRemoteConnection * nm_remote_settings_get_connection_by_path (NMRemoteSettings *settings,
+ const char *path);
+
+NMRemoteConnection *nm_remote_settings_get_connection_by_uuid (NMRemoteSettings *settings,
+ const char *uuid);
+
+gboolean nm_remote_settings_add_connection (NMRemoteSettings *settings,
+ NMConnection *connection,
+ NMRemoteSettingsAddConnectionFunc callback,
+ gpointer user_data);
+
+gboolean nm_remote_settings_save_hostname (NMRemoteSettings *settings,
+ const char *hostname,
+ NMRemoteSettingsSaveHostnameFunc callback,
+ gpointer user_data);
G_END_DECLS