2008-10-18 13:56:24 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
2007-08-03 16:10:04 +00:00
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
#ifndef __NM_SETTINGS_H__
|
|
|
|
|
#define __NM_SETTINGS_H__
|
2007-08-03 16:10:04 +00:00
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2007-09-12 16:23:53 +00:00
|
|
|
#include <dbus/dbus-glib.h>
|
2007-08-03 16:10:04 +00:00
|
|
|
|
2008-04-10 02:51:17 +00:00
|
|
|
#include <nm-connection.h>
|
|
|
|
|
|
2007-08-09 09:19:57 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2007-11-09 16:24:39 +00:00
|
|
|
#define NM_SETTINGS_ERROR nm_settings_error_quark ()
|
|
|
|
|
GQuark nm_settings_error_quark (void);
|
|
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
#define NM_TYPE_EXPORTED_CONNECTION (nm_exported_connection_get_type ())
|
|
|
|
|
#define NM_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnection))
|
|
|
|
|
#define NM_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnectionClass))
|
|
|
|
|
#define NM_IS_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_EXPORTED_CONNECTION))
|
|
|
|
|
#define NM_IS_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_EXPORTED_CONNECTION))
|
|
|
|
|
#define NM_EXPORTED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnectionClass))
|
|
|
|
|
|
|
|
|
|
#define NM_EXPORTED_CONNECTION_CONNECTION "connection"
|
2007-08-03 16:10:04 +00:00
|
|
|
|
2008-05-09 06:33:30 +00:00
|
|
|
#define NM_EXPORTED_CONNECTION_DBUS_METHOD_INVOCATION "nm-exported-connection-dbus-method-invocation"
|
|
|
|
|
|
2007-08-03 16:10:04 +00:00
|
|
|
typedef struct {
|
|
|
|
|
GObject parent;
|
2008-02-20 22:37:39 +00:00
|
|
|
} NMExportedConnection;
|
2007-08-03 16:10:04 +00:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
|
|
/* virtual methods */
|
2008-08-27 02:57:21 +00:00
|
|
|
GHashTable * (*get_settings) (NMExportedConnection *connection);
|
2008-10-18 13:56:24 +00:00
|
|
|
|
|
|
|
|
/* service_get_secrets is used in a D-Bus service (like the system settings
|
|
|
|
|
* service) to respond to GetSecrets requests from clients.
|
|
|
|
|
*/
|
|
|
|
|
void (*service_get_secrets) (NMExportedConnection *connection,
|
|
|
|
|
const gchar *setting_name,
|
|
|
|
|
const gchar **hints,
|
|
|
|
|
gboolean request_new,
|
|
|
|
|
DBusGMethodInvocation *context);
|
2007-08-03 16:10:04 +00:00
|
|
|
|
2008-05-09 06:33:30 +00:00
|
|
|
gboolean (*update) (NMExportedConnection *connection,
|
2008-10-18 13:56:24 +00:00
|
|
|
GHashTable *new_settings,
|
|
|
|
|
GError **err);
|
2008-04-22 14:48:02 +00:00
|
|
|
|
2008-05-09 06:33:30 +00:00
|
|
|
gboolean (*delete) (NMExportedConnection *connection,
|
2008-10-18 13:56:24 +00:00
|
|
|
GError **err);
|
2008-04-22 14:48:02 +00:00
|
|
|
|
2007-08-03 16:10:04 +00:00
|
|
|
/* signals */
|
2008-10-18 13:56:24 +00:00
|
|
|
void (*updated) (NMExportedConnection *connection, GHashTable *settings);
|
|
|
|
|
void (*removed) (NMExportedConnection *connection);
|
2008-02-20 22:37:39 +00:00
|
|
|
} NMExportedConnectionClass;
|
|
|
|
|
|
|
|
|
|
GType nm_exported_connection_get_type (void);
|
|
|
|
|
|
2008-05-05 07:07:44 +00:00
|
|
|
NMExportedConnection *nm_exported_connection_new (NMConnection *wrapped);
|
|
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
void nm_exported_connection_register_object (NMExportedConnection *connection,
|
|
|
|
|
NMConnectionScope scope,
|
|
|
|
|
DBusGConnection *dbus_connection);
|
|
|
|
|
|
|
|
|
|
NMConnection *nm_exported_connection_get_connection (NMExportedConnection *connection);
|
2007-08-03 16:10:04 +00:00
|
|
|
|
2008-05-09 06:33:30 +00:00
|
|
|
gboolean nm_exported_connection_update (NMExportedConnection *connection,
|
|
|
|
|
GHashTable *new_settings,
|
|
|
|
|
GError **err);
|
2008-05-05 07:07:44 +00:00
|
|
|
|
2008-05-09 06:33:30 +00:00
|
|
|
gboolean nm_exported_connection_delete (NMExportedConnection *connection,
|
|
|
|
|
GError **err);
|
2008-05-05 07:07:44 +00:00
|
|
|
|
|
|
|
|
void nm_exported_connection_signal_updated (NMExportedConnection *connection,
|
2008-05-09 06:33:30 +00:00
|
|
|
GHashTable *new_settings);
|
2008-05-05 07:07:44 +00:00
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
void nm_exported_connection_signal_removed (NMExportedConnection *connection);
|
2007-08-13 13:07:33 +00:00
|
|
|
|
2007-08-30 02:45:29 +00:00
|
|
|
|
2007-08-03 16:10:04 +00:00
|
|
|
|
|
|
|
|
#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 ((obj), NM_TYPE_SETTINGS))
|
|
|
|
|
#define NM_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS, NMSettingsClass))
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GObject parent;
|
|
|
|
|
} NMSettings;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
|
|
/* virtual methods */
|
2008-05-05 07:07:44 +00:00
|
|
|
/* Returns a list of NMExportedConnections. Caller should free the list. */
|
|
|
|
|
GSList * (*list_connections) (NMSettings *settings);
|
2007-08-03 16:10:04 +00:00
|
|
|
|
|
|
|
|
/* signals */
|
2008-02-20 22:37:39 +00:00
|
|
|
void (* new_connection) (NMSettings *settings, NMExportedConnection *connection);
|
2007-08-03 16:10:04 +00:00
|
|
|
} NMSettingsClass;
|
|
|
|
|
|
|
|
|
|
GType nm_settings_get_type (void);
|
|
|
|
|
|
2008-05-05 07:07:44 +00:00
|
|
|
GSList *nm_settings_list_connections (NMSettings *settings);
|
|
|
|
|
|
2008-02-20 22:37:39 +00:00
|
|
|
void nm_settings_signal_new_connection (NMSettings *settings, NMExportedConnection *connection);
|
2007-08-13 13:07:33 +00:00
|
|
|
|
2008-05-05 07:07:44 +00:00
|
|
|
|
2007-08-09 09:19:57 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
2007-08-03 16:10:04 +00:00
|
|
|
#endif
|