2 * Definitions for preference handling routines
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef __PREFS_DLG_H__
26 #define __PREFS_DLG_H__
28 /** @defgroup prefs_group Preferences
30 * All GUI related preferences things. Please note, that some GUI related things
31 * are saved in the recent file, which is processed in recent.h.
33 * The Preference dialog has the following page submodules:
36 node [shape=record, fontname=Helvetica, fontsize=10];
37 dialog [ label="Preferences dialog" URL="\ref prefs_dlg.h"];
38 ui [ label="User Interface" URL="\ref gui_prefs.h"];
39 layout [ label="UI: Layout" URL="\ref layout_prefs.h"];
40 columns [ label="UI: Columns" URL="\ref column_prefs.h"];
41 font [ label="UI: Font" URL="\ref gui_prefs.h"];
42 colors [ label="UI: Colors" URL="\ref stream_prefs.h"];
43 capture [ label="Capture" URL="\ref capture_prefs.h"];
44 print [ label="Printing" URL="\ref print_prefs.h"];
45 nameres [ label="Name resolution" URL="\ref nameres_prefs.h"];
46 protocols [ label="Protocols" URL="\ref prefs_dlg.h"];
47 dialog -> ui [ arrowhead="open", style="solid" ];
48 dialog -> layout [ arrowhead="open", style="solid" ];
49 dialog -> columns [ arrowhead="open", style="solid" ];
50 dialog -> font [ arrowhead="open", style="solid" ];
51 dialog -> colors [ arrowhead="open", style="solid" ];
52 dialog -> capture [ arrowhead="open", style="solid" ];
53 dialog -> print [ arrowhead="open", style="solid" ];
54 dialog -> nameres [ arrowhead="open", style="solid" ];
55 dialog -> protocols [ arrowhead="open", style="solid" ];
61 * "Preferences" and "Protocol properties" dialog boxes.
62 * @ingroup dialog_group
63 * @ingroup prefs_group
66 /** Show the preferences dialog.
68 * @param widget parent widget (unused)
71 extern void prefs_cb(GtkWidget *widget, gpointer data);
73 /** Show the protocol properties dialog.
75 * @param widget parent widget (unused)
78 extern void properties_cb(GtkWidget *widget, gpointer data);
80 #define E_TOOLTIPS_KEY "tooltips"
82 /** Create a check button for a preferences page.
84 * @param main_tb the table to put this button into
85 * @param table_row row in the table
86 * @param label_text the label text for the left side
87 * @param tooltip_text the tooltip for this check button
88 * @param active the check button is initially active
89 * @return the new check button
91 extern GtkWidget *create_preference_check_button(GtkWidget *main_tb, int table_row,
92 const gchar *label_text, const gchar *tooltip_text, gboolean active);
94 /** Create a radio button for a preferences page.
96 * @param main_tb the table to put this button into
97 * @param table_row row in the table
98 * @param label_text the label text for the left side
99 * @param tooltip_text the tooltip for this radio button
100 * @param enumvals the values
101 * @param current_val the initially selected value
102 * @return the new radio button
104 extern GtkWidget *create_preference_radio_buttons(GtkWidget *main_tb, int table_row,
105 const gchar *label_text, const gchar *tooltip_text,
106 const enum_val_t *enumvals, gint current_val);
108 /** Get the currently selected value from a radio button.
110 * @param button the button from create_preference_radio_buttons()
111 * @param enumvals the same enum vals as in create_preference_radio_buttons()
112 * @return the index of the currently selected item
114 extern gint fetch_preference_radio_buttons_val(GtkWidget *button, const enum_val_t *enumvals);
116 /** Create an option menu for a preferences page.
118 * @param main_tb the table to put this menu into
119 * @param table_row row in the table
120 * @param label_text the label text for the left side
121 * @param tooltip_text the tooltip for this option menu
122 * @param enumvals the values
123 * @param current_val the initially selected value
124 * @return the new option menu
126 extern GtkWidget *create_preference_option_menu(GtkWidget *main_tb, int table_row,
127 const gchar *label_text, const gchar *tooltip_text,
128 const enum_val_t *enumvals, gint current_val);
130 /** Get the currently selected value from an option menu.
132 * @param optmenu the option menu from create_preference_option_menu()
133 * @param enumvals the same enum vals as in create_preference_option_menu()
134 * @return the index of the currently selected item
136 extern gint fetch_preference_option_menu_val(GtkWidget *optmenu, const enum_val_t *enumvals);
138 /** Create a text entry for a preferences page.
140 * @param main_tb the table to put this entry into
141 * @param table_row row in the table
142 * @param label_text the label text for the left side
143 * @param tooltip_text the tooltip for this text entry
144 * @param value the initially value
145 * @return the new text entry
147 extern GtkWidget *create_preference_entry(GtkWidget *main_tb, int table_row,
148 const gchar *label_text, const gchar *tooltip_text, char *value);