1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301 USA.
18 * Copyright 2008 Novell, Inc.
19 * Copyright 2009 - 2011 Red Hat, Inc.
22 #ifndef __NM_REMOTE_SETTINGS_H__
23 #define __NM_REMOTE_SETTINGS_H__
25 #include <nm-object.h>
29 #define NM_TYPE_REMOTE_SETTINGS (nm_remote_settings_get_type ())
30 #define NM_REMOTE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettings))
31 #define NM_REMOTE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettingsClass))
32 #define NM_IS_REMOTE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_REMOTE_SETTINGS))
33 #define NM_IS_REMOTE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_REMOTE_SETTINGS))
34 #define NM_REMOTE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettingsClass))
36 #define NM_REMOTE_SETTINGS_CONNECTIONS "connections"
37 #define NM_REMOTE_SETTINGS_HOSTNAME "hostname"
38 #define NM_REMOTE_SETTINGS_CAN_MODIFY "can-modify"
40 #define NM_REMOTE_SETTINGS_CONNECTION_ADDED "connection-added"
41 #define NM_REMOTE_SETTINGS_CONNECTION_REMOVED "connection-removed"
43 typedef struct _NMRemoteSettings NMRemoteSettings;
44 typedef struct _NMRemoteSettingsClass NMRemoteSettingsClass;
46 struct _NMRemoteSettings {
50 struct _NMRemoteSettingsClass {
54 void (*connection_added) (NMRemoteSettings *settings,
55 NMRemoteConnection *connection);
56 void (*connection_removed) (NMRemoteSettings *settings,
57 NMRemoteConnection *connection);
63 GType nm_remote_settings_get_type (void);
65 const GPtrArray *nm_remote_settings_get_connections (NMRemoteSettings *settings);
67 NMRemoteConnection *nm_remote_settings_get_connection_by_id (NMRemoteSettings *settings,
70 NMRemoteConnection *nm_remote_settings_get_connection_by_path (NMRemoteSettings *settings,
73 NMRemoteConnection *nm_remote_settings_get_connection_by_uuid (NMRemoteSettings *settings,
76 void nm_remote_settings_add_connection_async (NMRemoteSettings *settings,
77 NMConnection *connection,
78 gboolean save_to_disk,
79 GCancellable *cancellable,
80 GAsyncReadyCallback callback,
82 NMRemoteConnection *nm_remote_settings_add_connection_finish (NMRemoteSettings *settings,
86 gboolean nm_remote_settings_load_connections (NMRemoteSettings *settings,
89 GCancellable *cancellable,
91 void nm_remote_settings_load_connections_async (NMRemoteSettings *settings,
93 GCancellable *cancellable,
94 GAsyncReadyCallback callback,
96 gboolean nm_remote_settings_load_connections_finish (NMRemoteSettings *settings,
101 gboolean nm_remote_settings_reload_connections (NMRemoteSettings *settings,
102 GCancellable *cancellable,
104 void nm_remote_settings_reload_connections_async (NMRemoteSettings *settings,
105 GCancellable *cancellable,
106 GAsyncReadyCallback callback,
108 gboolean nm_remote_settings_reload_connections_finish (NMRemoteSettings *settings,
109 GAsyncResult *result,
112 gboolean nm_remote_settings_save_hostname (NMRemoteSettings *settings,
113 const char *hostname,
114 GCancellable *cancellable,
116 void nm_remote_settings_save_hostname_async (NMRemoteSettings *settings,
117 const char *hostname,
118 GCancellable *cancellable,
119 GAsyncReadyCallback callback,
121 gboolean nm_remote_settings_save_hostname_finish (NMRemoteSettings *settings,
122 GAsyncResult *result,
127 #endif /* __NM_REMOTE_SETTINGS_H__ */