1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2015 Red Hat, Inc.
4 */
5
6#ifndef __NM_VPN_PLUGIN_INFO_H__
7#define __NM_VPN_PLUGIN_INFO_H__
8
9#include <glib.h>
10#include <glib-object.h>
11
12#include "nm-utils.h"
13#include "nm-vpn-editor-plugin.h"
14
15G_BEGIN_DECLS
16
17#define NM_TYPE_VPN_PLUGIN_INFO (nm_vpn_plugin_info_get_type())
18#define NM_VPN_PLUGIN_INFO(obj) \
19 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfo))
20#define NM_VPN_PLUGIN_INFO_CLASS(klass) \
21 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass))
22#define NM_IS_VPN_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_VPN_PLUGIN_INFO))
23#define NM_IS_VPN_PLUGIN_INFO_CLASS(klass) \
24 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_VPN_PLUGIN_INFO))
25#define NM_VPN_PLUGIN_INFO_GET_CLASS(obj) \
26 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass))
27
28#define NM_VPN_PLUGIN_INFO_NAME "name"
29#define NM_VPN_PLUGIN_INFO_FILENAME "filename"
30#define NM_VPN_PLUGIN_INFO_KEYFILE "keyfile"
31
32#define NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION "VPN Connection"
33#define NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM "libnm"
34#define NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME "GNOME"
35
36typedef struct _NMVpnPluginInfoClass NMVpnPluginInfoClass;
37
38NM_AVAILABLE_IN_1_2
39GType nm_vpn_plugin_info_get_type(void);
40
41NM_AVAILABLE_IN_1_2
42NMVpnPluginInfo *nm_vpn_plugin_info_new_from_file(const char *filename, GError **error);
43
44NM_AVAILABLE_IN_1_2
45NMVpnPluginInfo *
46nm_vpn_plugin_info_new_with_data(const char *filename, GKeyFile *keyfile, GError **error);
47
48NM_AVAILABLE_IN_1_4
49NMVpnPluginInfo *nm_vpn_plugin_info_new_search_file(const char *name, const char *service);
50
51NM_AVAILABLE_IN_1_2
52const char *nm_vpn_plugin_info_get_name(NMVpnPluginInfo *self);
53NM_AVAILABLE_IN_1_2
54const char *nm_vpn_plugin_info_get_filename(NMVpnPluginInfo *self);
55NM_AVAILABLE_IN_1_4
56const char *nm_vpn_plugin_info_get_service(NMVpnPluginInfo *self);
57NM_AVAILABLE_IN_1_2
58const char *nm_vpn_plugin_info_get_plugin(NMVpnPluginInfo *self);
59NM_AVAILABLE_IN_1_2
60const char *nm_vpn_plugin_info_get_program(NMVpnPluginInfo *self);
61NM_AVAILABLE_IN_1_4
62const char *nm_vpn_plugin_info_get_auth_dialog(NMVpnPluginInfo *self);
63NM_AVAILABLE_IN_1_4
64gboolean nm_vpn_plugin_info_supports_hints(NMVpnPluginInfo *self);
65NM_AVAILABLE_IN_1_2
66gboolean nm_vpn_plugin_info_supports_multiple(NMVpnPluginInfo *self);
67NM_AVAILABLE_IN_1_4
68const char *const *nm_vpn_plugin_info_get_aliases(NMVpnPluginInfo *self);
69NM_AVAILABLE_IN_1_2
70const char *
71nm_vpn_plugin_info_lookup_property(NMVpnPluginInfo *self, const char *group, const char *key);
72
73NM_AVAILABLE_IN_1_2
74gboolean nm_vpn_plugin_info_validate_filename(const char *filename);
75
76NM_AVAILABLE_IN_1_2
77GSList *nm_vpn_plugin_info_list_load(void);
78NM_AVAILABLE_IN_1_2
79gboolean nm_vpn_plugin_info_list_add(GSList **list, NMVpnPluginInfo *plugin_info, GError **error);
80NM_AVAILABLE_IN_1_2
81gboolean nm_vpn_plugin_info_list_remove(GSList **list, NMVpnPluginInfo *plugin_info);
82NM_AVAILABLE_IN_1_2
83NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_name(GSList *list, const char *name);
84NM_AVAILABLE_IN_1_2
85NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_filename(GSList *list, const char *filename);
86NM_AVAILABLE_IN_1_2
87NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_service(GSList *list, const char *service);
88
89NM_AVAILABLE_IN_1_4
90char *nm_vpn_plugin_info_list_find_service_type(GSList *list, const char *name);
91NM_AVAILABLE_IN_1_4
92char **nm_vpn_plugin_info_list_get_service_types(GSList *list,
93 gboolean only_existing,
94 gboolean with_abbreviations);
95
96NM_AVAILABLE_IN_1_2
97NMVpnEditorPlugin *nm_vpn_plugin_info_get_editor_plugin(NMVpnPluginInfo *self);
98NM_AVAILABLE_IN_1_2
99void nm_vpn_plugin_info_set_editor_plugin(NMVpnPluginInfo *self, NMVpnEditorPlugin *plugin);
100NM_AVAILABLE_IN_1_2
101NMVpnEditorPlugin *nm_vpn_plugin_info_load_editor_plugin(NMVpnPluginInfo *self, GError **error);
102
103G_END_DECLS
104
105#endif /* __NM_VPN_PLUGIN_INFO_H__ */
106

source code of include/libnm/nm-vpn-plugin-info.h