1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* NetworkManager Connection editor -- Connection editor for NetworkManager
4
* Dan Williams <dcbw@redhat.com>
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.
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.
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.
20
* (C) Copyright 2008 - 2012 Red Hat, Inc.
27
#include <glib-object.h>
31
#include <dbus/dbus-glib.h>
32
#include <nm-connection.h>
33
#include <nm-client.h>
34
#include <nm-remote-settings.h>
37
/* for ARPHRD_ETHER / ARPHRD_INFINIBAND for MAC utilies */
38
#include <net/if_arp.h>
40
typedef void (*PageNewConnectionResultFunc) (NMConnection *connection,
45
typedef GSList * (*PageGetConnectionsFunc) (gpointer user_data);
47
typedef void (*PageNewConnectionFunc) (GtkWindow *parent,
49
NMRemoteSettings *settings,
50
PageNewConnectionResultFunc result_func,
53
#define CE_TYPE_PAGE (ce_page_get_type ())
54
#define CE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CE_TYPE_PAGE, CEPage))
55
#define CE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CE_TYPE_PAGE, CEPageClass))
56
#define CE_IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CE_TYPE_PAGE))
57
#define CE_IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CE_TYPE_PAGE))
58
#define CE_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CE_TYPE_PAGE, CEPageClass))
60
#define CE_PAGE_CONNECTION "connection"
61
#define CE_PAGE_INITIALIZED "initialized"
62
#define CE_PAGE_PARENT_WINDOW "parent-window"
73
gulong secrets_done_validate;
75
NMConnection *connection;
76
GtkWindow *parent_window;
78
NMRemoteSettings *settings;
86
/* Virtual functions */
87
gboolean (*validate) (CEPage *self, NMConnection *connection, GError **error);
88
/* Let the page warn the user if some property needs review */
89
GtkWidget * (*nag_user) (CEPage *self);
92
void (*changed) (CEPage *self);
93
void (*initialized) (CEPage *self, GError *error);
97
typedef CEPage* (*CEPageNewFunc)(NMConnection *connection,
100
NMRemoteSettings *settings,
101
const char **out_secrets_setting_name,
105
GType ce_page_get_type (void);
107
GtkWidget * ce_page_get_page (CEPage *self);
109
const char * ce_page_get_title (CEPage *self);
111
gboolean ce_page_validate (CEPage *self, NMConnection *connection, GError **error);
113
char **ce_page_get_mac_list (CEPage *self, GType device_type, const char *mac_property);
114
void ce_page_setup_mac_combo (CEPage *self, GtkComboBox *combo,
115
const char *current_mac, char **mac_list);
117
void ce_page_changed (CEPage *self);
119
void ce_page_mac_to_entry (const GByteArray *mac, int type, GtkEntry *entry);
121
GByteArray *ce_page_entry_to_mac (GtkEntry *entry, int type, gboolean *invalid);
123
gint ce_spin_output_with_default (GtkSpinButton *spin, gpointer user_data);
125
int ce_get_property_default (NMSetting *setting, const char *property_name);
127
void ce_page_complete_init (CEPage *self,
128
const char *setting_name,
132
gboolean ce_page_get_initialized (CEPage *self);
134
char *ce_page_get_next_available_name (GSList *connections, const char *format);
136
GtkWidget *ce_page_nag_user (CEPage *self);
138
/* Only for subclasses */
139
NMConnection *ce_page_new_connection (const char *format,
141
gboolean autoconnect,
142
NMRemoteSettings *settings,
145
CEPage *ce_page_new (GType page_type,
146
NMConnection *connection,
147
GtkWindow *parent_window,
149
NMRemoteSettings *settings,
151
const char *widget_name,
154
#endif /* __CE_PAGE_H__ */