Debian Codegraph @

src/dialog.h

raw
1 /*
2 * ConnMan GTK GUI
3 *
4 * Copyright (C) 2015 Intel Corporation. All rights reserved.
5 * Author: Jaakko Hannikainen <[email protected]>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _CONNMAN_GTK_DIALOG_H
22 #define _CONNMAN_GTK_DIALOG_H
23
24 #include <glib.h>
25 #include <gtk/gtk.h>
26
27 #include "config.h"
28
29 enum token_element_type {
30 TOKEN_ELEMENT_INVALID,
31 TOKEN_ELEMENT_TEXT,
32 TOKEN_ELEMENT_ENTRY,
33 TOKEN_ELEMENT_LIST,
34 TOKEN_ELEMENT_CHECKBOX
35 };
36
37 struct token_element {
38 enum token_element_type type;
39 GtkWidget *label, *content;
40 gchar *name, *value;
41 };
42
43 struct token_element *token_new_text(const gchar *name, const gchar *content);
44 struct token_element *token_new_entry_full(const gchar *name, gboolean secret,
45 const gchar *value,
46 gboolean (*check)(GtkWidget *entry));
47 struct token_element *token_new_entry(const gchar *name, gboolean secret);
48 struct token_element *token_new_list(const gchar *name, GPtrArray *options);
49 struct token_element *token_new_checkbox(const gchar *name, gboolean state);
50 void free_token_element(struct token_element *elem);
51
52 gboolean dialog_ask_tokens(const gchar *title, GPtrArray *elements);
53
54 void show_error(const gchar *text, const gchar *message);
55
56 #endif /* _CONNMAN_GTK_DIALOG_H */