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 | |
15 | G_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 | |
36 | typedef struct _NMVpnPluginInfoClass NMVpnPluginInfoClass; |
37 | |
38 | NM_AVAILABLE_IN_1_2 |
39 | GType nm_vpn_plugin_info_get_type(void); |
40 | |
41 | NM_AVAILABLE_IN_1_2 |
42 | NMVpnPluginInfo *nm_vpn_plugin_info_new_from_file(const char *filename, GError **error); |
43 | |
44 | NM_AVAILABLE_IN_1_2 |
45 | NMVpnPluginInfo * |
46 | nm_vpn_plugin_info_new_with_data(const char *filename, GKeyFile *keyfile, GError **error); |
47 | |
48 | NM_AVAILABLE_IN_1_4 |
49 | NMVpnPluginInfo *nm_vpn_plugin_info_new_search_file(const char *name, const char *service); |
50 | |
51 | NM_AVAILABLE_IN_1_2 |
52 | const char *nm_vpn_plugin_info_get_name(NMVpnPluginInfo *self); |
53 | NM_AVAILABLE_IN_1_2 |
54 | const char *nm_vpn_plugin_info_get_filename(NMVpnPluginInfo *self); |
55 | NM_AVAILABLE_IN_1_4 |
56 | const char *nm_vpn_plugin_info_get_service(NMVpnPluginInfo *self); |
57 | NM_AVAILABLE_IN_1_2 |
58 | const char *nm_vpn_plugin_info_get_plugin(NMVpnPluginInfo *self); |
59 | NM_AVAILABLE_IN_1_2 |
60 | const char *nm_vpn_plugin_info_get_program(NMVpnPluginInfo *self); |
61 | NM_AVAILABLE_IN_1_4 |
62 | const char *nm_vpn_plugin_info_get_auth_dialog(NMVpnPluginInfo *self); |
63 | NM_AVAILABLE_IN_1_4 |
64 | gboolean nm_vpn_plugin_info_supports_hints(NMVpnPluginInfo *self); |
65 | NM_AVAILABLE_IN_1_2 |
66 | gboolean nm_vpn_plugin_info_supports_multiple(NMVpnPluginInfo *self); |
67 | NM_AVAILABLE_IN_1_4 |
68 | const char *const *nm_vpn_plugin_info_get_aliases(NMVpnPluginInfo *self); |
69 | NM_AVAILABLE_IN_1_2 |
70 | const char * |
71 | nm_vpn_plugin_info_lookup_property(NMVpnPluginInfo *self, const char *group, const char *key); |
72 | |
73 | NM_AVAILABLE_IN_1_2 |
74 | gboolean nm_vpn_plugin_info_validate_filename(const char *filename); |
75 | |
76 | NM_AVAILABLE_IN_1_2 |
77 | GSList *nm_vpn_plugin_info_list_load(void); |
78 | NM_AVAILABLE_IN_1_2 |
79 | gboolean nm_vpn_plugin_info_list_add(GSList **list, NMVpnPluginInfo *plugin_info, GError **error); |
80 | NM_AVAILABLE_IN_1_2 |
81 | gboolean nm_vpn_plugin_info_list_remove(GSList **list, NMVpnPluginInfo *plugin_info); |
82 | NM_AVAILABLE_IN_1_2 |
83 | NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_name(GSList *list, const char *name); |
84 | NM_AVAILABLE_IN_1_2 |
85 | NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_filename(GSList *list, const char *filename); |
86 | NM_AVAILABLE_IN_1_2 |
87 | NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_service(GSList *list, const char *service); |
88 | |
89 | NM_AVAILABLE_IN_1_4 |
90 | char *nm_vpn_plugin_info_list_find_service_type(GSList *list, const char *name); |
91 | NM_AVAILABLE_IN_1_4 |
92 | char **nm_vpn_plugin_info_list_get_service_types(GSList *list, |
93 | gboolean only_existing, |
94 | gboolean with_abbreviations); |
95 | |
96 | NM_AVAILABLE_IN_1_2 |
97 | NMVpnEditorPlugin *nm_vpn_plugin_info_get_editor_plugin(NMVpnPluginInfo *self); |
98 | NM_AVAILABLE_IN_1_2 |
99 | void nm_vpn_plugin_info_set_editor_plugin(NMVpnPluginInfo *self, NMVpnEditorPlugin *plugin); |
100 | NM_AVAILABLE_IN_1_2 |
101 | NMVpnEditorPlugin *nm_vpn_plugin_info_load_editor_plugin(NMVpnPluginInfo *self, GError **error); |
102 | |
103 | G_END_DECLS |
104 | |
105 | #endif /* __NM_VPN_PLUGIN_INFO_H__ */ |
106 | |