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 2008 - 2015 Red Hat, Inc.
22 #ifndef __NM_VPN_EDITOR_H__
23 #define __NM_VPN_EDITOR_H__
25 #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
26 #error "Only <NetworkManager.h> can be included directly."
30 #include <glib-object.h>
33 #include "nm-vpn-editor-plugin.h"
37 /**************************************************/
38 /* Editor interface */
39 /**************************************************/
41 #define NM_TYPE_VPN_EDITOR (nm_vpn_editor_get_type ())
42 #define NM_VPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_EDITOR, NMVpnEditor))
43 #define NM_IS_VPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_EDITOR))
44 #define NM_VPN_EDITOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_EDITOR, NMVpnEditorInterface))
47 * NMVpnEditorInterface:
48 * @g_iface: the parent interface
49 * @get_widget: return the #GtkWidget for the VPN editor's UI
50 * @placeholder: not currently used
51 * @update_connection: called to save the user-entered options to the connection
52 * object. Should return %FALSE and set @error if the current options are
53 * invalid. @error should contain enough information for the plugin to
54 * determine which UI widget is invalid at a later point in time. For
55 * example, creating unique error codes for what error occurred and populating
56 * the message field of @error with the name of the invalid property.
57 * @changed: emitted when the value of a UI widget changes. May trigger a
58 * validity check via @update_connection to write values to the connection.
60 * Interface for editing a specific #NMConnection
63 GTypeInterface g_iface;
65 GObject * (*get_widget) (NMVpnEditor *editor);
67 void (*placeholder) (void);
69 gboolean (*update_connection) (NMVpnEditor *editor,
70 NMConnection *connection,
73 void (*changed) (NMVpnEditor *editor);
74 } NMVpnEditorInterface;
76 GType nm_vpn_editor_get_type (void);
78 GObject * nm_vpn_editor_get_widget (NMVpnEditor *editor);
80 gboolean nm_vpn_editor_update_connection (NMVpnEditor *editor,
81 NMConnection *connection,
86 #endif /* __NM_VPN_EDITOR_H__ */