2015-05-22 11:26:40 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
* Copyright 2015 Red Hat, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NM_VPN_PLUGIN_INFO_H__
|
|
|
|
#define __NM_VPN_PLUGIN_INFO_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
|
|
#include "nm-utils.h"
|
2015-05-28 20:12:31 +00:00
|
|
|
#include "nm-vpn-editor-plugin.h"
|
2015-05-22 11:26:40 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define NM_TYPE_VPN_PLUGIN_INFO (nm_vpn_plugin_info_get_type ())
|
|
|
|
#define NM_VPN_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfo))
|
|
|
|
#define NM_VPN_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass))
|
|
|
|
#define NM_IS_VPN_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_INFO))
|
|
|
|
#define NM_IS_VPN_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_VPN_PLUGIN_INFO))
|
|
|
|
#define NM_VPN_PLUGIN_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass))
|
|
|
|
|
|
|
|
#define NM_VPN_PLUGIN_INFO_NAME "name"
|
|
|
|
#define NM_VPN_PLUGIN_INFO_FILENAME "filename"
|
|
|
|
#define NM_VPN_PLUGIN_INFO_KEYFILE "keyfile"
|
|
|
|
|
|
|
|
#define NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION "VPN Connection"
|
|
|
|
#define NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM "libnm"
|
|
|
|
#define NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME "GNOME"
|
|
|
|
|
libnm/vpn: pass NMVpnPluginInfo to the NMVpnEditorPlugin instance
The NMVpnPluginInfo is essentially the .name file, that is, a
configuration file about the plugin itself. Via NMVpnPluginInfo
instance, the NMVpnEditorPlugin can be created.
Usually, one would create a NMVpnPluginInfo (that is, reading the
.name file) and then create a NMVpnEditorPlugin instance from there.
In this case, usually the editor-plugin is owned by the plugin-info
instance (although the API allows for creating the editor-plugin
independently).
Now, pass the NMVpnPluginInfo to the editor-plugin too.
This is useful, because then the editor-plugin can look at the .name
file.
The .name file is not user configuration. Instead it is configuration
about the plugin itself. Although the .name file is part of the plugin
build artefacts, it is useful to allow the plugin to access the .name
file. The reason is, that this can allow the user to easily change a
configuration knob of the plugin without requiring to patch or the
plugin.
2016-06-08 22:50:40 +00:00
|
|
|
struct _NMVpnPluginInfo;
|
|
|
|
|
2016-05-05 07:36:32 +00:00
|
|
|
/**
|
|
|
|
* NMVpnPluginInfo:
|
|
|
|
*/
|
libnm/vpn: pass NMVpnPluginInfo to the NMVpnEditorPlugin instance
The NMVpnPluginInfo is essentially the .name file, that is, a
configuration file about the plugin itself. Via NMVpnPluginInfo
instance, the NMVpnEditorPlugin can be created.
Usually, one would create a NMVpnPluginInfo (that is, reading the
.name file) and then create a NMVpnEditorPlugin instance from there.
In this case, usually the editor-plugin is owned by the plugin-info
instance (although the API allows for creating the editor-plugin
independently).
Now, pass the NMVpnPluginInfo to the editor-plugin too.
This is useful, because then the editor-plugin can look at the .name
file.
The .name file is not user configuration. Instead it is configuration
about the plugin itself. Although the .name file is part of the plugin
build artefacts, it is useful to allow the plugin to access the .name
file. The reason is, that this can allow the user to easily change a
configuration knob of the plugin without requiring to patch or the
plugin.
2016-06-08 22:50:40 +00:00
|
|
|
typedef struct _NMVpnPluginInfo {
|
2015-05-22 11:26:40 +00:00
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
GObject parent;
|
2015-08-04 13:25:14 +00:00
|
|
|
} NMVpnPluginInfo;
|
2015-05-22 11:26:40 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
GObjectClass parent;
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
gpointer padding[8];
|
|
|
|
} NMVpnPluginInfoClass NM_AVAILABLE_IN_1_2;
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
GType nm_vpn_plugin_info_get_type (void);
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
NMVpnPluginInfo *nm_vpn_plugin_info_new_from_file (const char *filename,
|
|
|
|
GError **error);
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
NMVpnPluginInfo *nm_vpn_plugin_info_new_with_data (const char *filename,
|
|
|
|
GKeyFile *keyfile,
|
|
|
|
GError **error);
|
|
|
|
|
2016-04-22 07:12:54 +00:00
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
NMVpnPluginInfo *nm_vpn_plugin_info_new_search_file (const char *name,
|
|
|
|
const char *service);
|
|
|
|
|
2015-05-22 11:26:40 +00:00
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
const char *nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
const char *nm_vpn_plugin_info_get_filename (NMVpnPluginInfo *self);
|
2016-04-20 14:04:13 +00:00
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
const char *nm_vpn_plugin_info_get_service (NMVpnPluginInfo *self);
|
2015-05-22 11:26:40 +00:00
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
const char *nm_vpn_plugin_info_get_plugin (NMVpnPluginInfo *self);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
const char *nm_vpn_plugin_info_get_program (NMVpnPluginInfo *self);
|
2016-04-20 14:18:05 +00:00
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
const char *nm_vpn_plugin_info_get_auth_dialog (NMVpnPluginInfo *self);
|
2016-04-20 14:24:54 +00:00
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
gboolean nm_vpn_plugin_info_supports_hints (NMVpnPluginInfo *self);
|
2015-05-22 11:26:40 +00:00
|
|
|
NM_AVAILABLE_IN_1_2
|
2015-08-21 14:14:27 +00:00
|
|
|
gboolean nm_vpn_plugin_info_supports_multiple (NMVpnPluginInfo *self);
|
2016-06-03 14:43:26 +00:00
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
const char *const*nm_vpn_plugin_info_get_aliases (NMVpnPluginInfo *self);
|
2015-08-21 14:14:27 +00:00
|
|
|
NM_AVAILABLE_IN_1_2
|
2015-05-22 11:26:40 +00:00
|
|
|
const char *nm_vpn_plugin_info_lookup_property (NMVpnPluginInfo *self, const char *group, const char *key);
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
gboolean nm_vpn_plugin_info_validate_filename (const char *filename);
|
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
GSList *nm_vpn_plugin_info_list_load (void);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
gboolean nm_vpn_plugin_info_list_add (GSList **list, NMVpnPluginInfo *plugin_info, GError **error);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
gboolean nm_vpn_plugin_info_list_remove (GSList **list, NMVpnPluginInfo *plugin_info);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_name (GSList *list, const char *name);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_filename (GSList *list, const char *filename);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_service (GSList *list, const char *service);
|
|
|
|
|
2016-06-07 09:11:30 +00:00
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
char *nm_vpn_plugin_info_list_find_service_type (GSList *list, const char *name);
|
|
|
|
NM_AVAILABLE_IN_1_4
|
|
|
|
char **nm_vpn_plugin_info_list_get_service_types (GSList *list,
|
|
|
|
gboolean only_existing,
|
|
|
|
gboolean with_abbreviations);
|
2015-05-28 20:12:31 +00:00
|
|
|
|
|
|
|
NM_AVAILABLE_IN_1_2
|
2015-07-31 19:19:14 +00:00
|
|
|
NMVpnEditorPlugin *nm_vpn_plugin_info_get_editor_plugin (NMVpnPluginInfo *self);
|
2015-05-28 20:12:31 +00:00
|
|
|
NM_AVAILABLE_IN_1_2
|
|
|
|
void nm_vpn_plugin_info_set_editor_plugin (NMVpnPluginInfo *self,
|
|
|
|
NMVpnEditorPlugin *plugin);
|
|
|
|
NM_AVAILABLE_IN_1_2
|
2015-07-31 19:19:14 +00:00
|
|
|
NMVpnEditorPlugin *nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self,
|
2015-05-28 20:12:31 +00:00
|
|
|
GError **error);
|
|
|
|
|
2015-05-22 11:26:40 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __NM_VPN_PLUGIN_INFO_H__ */
|