~khurshid-alam/unity-control-center/use-usd-schemas

« back to all changes in this revision

Viewing changes to panels/network/wireless-security/wireless-security.h

  • Committer: Sebastien Bacher
  • Author(s): Khurshid Alam
  • Date: 2019-05-17 07:34:33 UTC
  • mfrom: (12920.1.1 unity-control-center)
  • Revision ID: seb128@ubuntu.com-20190517073433-ch2kybdhhzpkmvq4
Network: Port to libnm 1.2 (lp: #1744619)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 
2
/* NetworkManager Applet -- allow user control over networking
 
3
 *
 
4
 * Dan Williams <dcbw@redhat.com>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
18
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
19
 *
 
20
 * Copyright 2007 - 2014 Red Hat, Inc.
 
21
 */
 
22
 
 
23
#ifndef WIRELESS_SECURITY_H
 
24
#define WIRELESS_SECURITY_H
 
25
 
 
26
#include <gtk/gtk.h>
 
27
 
 
28
#define WIRELESS_TYPE_SECURITY (wireless_security_get_type ())
 
29
 
 
30
typedef struct _WirelessSecurity WirelessSecurity;
 
31
 
 
32
typedef void (*WSChangedFunc) (WirelessSecurity *sec, gpointer user_data);
 
33
 
 
34
typedef void (*WSAddToSizeGroupFunc) (WirelessSecurity *sec, GtkSizeGroup *group);
 
35
typedef void (*WSFillConnectionFunc) (WirelessSecurity *sec, NMConnection *connection);
 
36
typedef void (*WSUpdateSecretsFunc)  (WirelessSecurity *sec, NMConnection *connection);
 
37
typedef void (*WSDestroyFunc)        (WirelessSecurity *sec);
 
38
typedef gboolean (*WSValidateFunc)   (WirelessSecurity *sec, GError **error);
 
39
typedef GtkWidget * (*WSNagUserFunc) (WirelessSecurity *sec);
 
40
 
 
41
struct _WirelessSecurity {
 
42
        guint32 refcount;
 
43
        gsize obj_size;
 
44
        GtkBuilder *builder;
 
45
        GtkWidget *ui_widget;
 
46
        WSChangedFunc changed_notify;
 
47
        gpointer changed_notify_data;
 
48
        const char *default_field;
 
49
        gboolean adhoc_compatible;
 
50
        gboolean hotspot_compatible;
 
51
 
 
52
        char *username, *password;
 
53
        gboolean always_ask, show_password;
 
54
 
 
55
        WSAddToSizeGroupFunc add_to_size_group;
 
56
        WSFillConnectionFunc fill_connection;
 
57
        WSUpdateSecretsFunc update_secrets;
 
58
        WSValidateFunc validate;
 
59
        WSDestroyFunc destroy;
 
60
};
 
61
 
 
62
#define WIRELESS_SECURITY(x) ((WirelessSecurity *) x)
 
63
 
 
64
 
 
65
GtkWidget *wireless_security_get_widget (WirelessSecurity *sec);
 
66
 
 
67
void wireless_security_set_changed_notify (WirelessSecurity *sec,
 
68
                                           WSChangedFunc func,
 
69
                                           gpointer user_data);
 
70
 
 
71
gboolean wireless_security_validate (WirelessSecurity *sec, GError **error);
 
72
 
 
73
void wireless_security_add_to_size_group (WirelessSecurity *sec,
 
74
                                          GtkSizeGroup *group);
 
75
 
 
76
void wireless_security_fill_connection (WirelessSecurity *sec,
 
77
                                        NMConnection *connection);
 
78
 
 
79
void wireless_security_update_secrets (WirelessSecurity *sec,
 
80
                                       NMConnection *connection);
 
81
 
 
82
gboolean wireless_security_adhoc_compatible (WirelessSecurity *sec);
 
83
 
 
84
gboolean wireless_security_hotspot_compatible (WirelessSecurity *sec);
 
85
 
 
86
void wireless_security_set_userpass (WirelessSecurity *sec,
 
87
                                     const char *user,
 
88
                                     const char *password,
 
89
                                     gboolean always_ask,
 
90
                                     gboolean show_password);
 
91
void wireless_security_set_userpass_802_1x (WirelessSecurity *sec,
 
92
                                            NMConnection *connection);
 
93
 
 
94
WirelessSecurity *wireless_security_ref (WirelessSecurity *sec);
 
95
 
 
96
void wireless_security_unref (WirelessSecurity *sec);
 
97
 
 
98
GType wireless_security_get_type (void);
 
99
 
 
100
/* Below for internal use only */
 
101
 
 
102
#include "ws-wep-key.h"
 
103
#include "ws-wpa-psk.h"
 
104
#include "ws-leap.h"
 
105
#include "ws-wpa-eap.h"
 
106
#include "ws-dynamic-wep.h"
 
107
 
 
108
WirelessSecurity *wireless_security_init (gsize obj_size,
 
109
                                          WSValidateFunc validate,
 
110
                                          WSAddToSizeGroupFunc add_to_size_group,
 
111
                                          WSFillConnectionFunc fill_connection,
 
112
                                          WSUpdateSecretsFunc update_secrets,
 
113
                                          WSDestroyFunc destroy,
 
114
                                          const char *ui_resource,
 
115
                                          const char *ui_widget_name,
 
116
                                          const char *default_field);
 
117
 
 
118
void wireless_security_changed_cb (GtkWidget *entry, gpointer user_data);
 
119
 
 
120
void wireless_security_clear_ciphers (NMConnection *connection);
 
121
 
 
122
#define AUTH_NAME_COLUMN   0
 
123
#define AUTH_METHOD_COLUMN 1
 
124
 
 
125
GtkWidget *ws_802_1x_auth_combo_init (WirelessSecurity *sec,
 
126
                                      const char *combo_name,
 
127
                                      const char *combo_label,
 
128
                                      GCallback auth_combo_changed_cb,
 
129
                                      NMConnection *connection,
 
130
                                      gboolean is_editor,
 
131
                                      gboolean secrets_only);
 
132
 
 
133
void ws_802_1x_auth_combo_changed (GtkWidget *combo,
 
134
                                   WirelessSecurity *sec,
 
135
                                   const char *vbox_name,
 
136
                                   GtkSizeGroup *size_group);
 
137
 
 
138
gboolean ws_802_1x_validate (WirelessSecurity *sec, const char *combo_name, GError **error);
 
139
 
 
140
void ws_802_1x_add_to_size_group (WirelessSecurity *sec,
 
141
                                  GtkSizeGroup *size_group,
 
142
                                  const char *label_name,
 
143
                                  const char *combo_name);
 
144
 
 
145
void ws_802_1x_fill_connection (WirelessSecurity *sec,
 
146
                                const char *combo_name,
 
147
                                NMConnection *connection);
 
148
 
 
149
void ws_802_1x_update_secrets (WirelessSecurity *sec,
 
150
                               const char *combo_name,
 
151
                               NMConnection *connection);
 
152
 
 
153
#endif /* WIRELESS_SECURITY_H */
 
154