2 * Definitions for preference handling routines
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
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 prefs_gui.h"];
39 layout [ label="UI: Layout" URL="\ref prefs_layout.h"];
40 columns [ label="UI: Columns" URL="\ref prefs_column.h"];
41 font [ label="UI: Font" URL="\ref prefs_gui.h"];
42 colors [ label="UI: Colors" URL="\ref prefs_stream.h"];
43 capture [ label="Capture" URL="\ref prefs_capture.h"];
44 print [ label="Printing" URL="\ref prefs_print.h"];
45 nameres [ label="Name resolution" URL="\ref prefs_nameres.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
67 PREFS_PAGE_USER_INTERFACE,
72 /** Show the preferences dialog.
74 * @param widget parent widget (unused)
77 extern void prefs_cb(GtkWidget *widget, gpointer data);
79 /** Show the preferences dialog in given page.
81 * @param widget parent widget (unused)
83 * @param prefs_page page to show
85 extern void prefs_page_cb(GtkWidget *widget, gpointer data, PREFS_PAGE_E prefs_page);
87 /** Show the protocol properties dialog.
89 * @param widget parent widget (unused)
92 extern void properties_cb(GtkWidget *widget, gpointer data);
94 #define E_TOOLTIPS_KEY "tooltips"
96 /** Create a check button for a preferences page.
98 * @param main_tb the table to put this button into
99 * @param table_row row in the table
100 * @param label_text the label text for the left side
101 * @param tooltip_text the tooltip for this check button
102 * @param active the check button is initially active
103 * @return the new check button
105 extern GtkWidget *create_preference_check_button(GtkWidget *main_tb, int table_row,
106 const gchar *label_text, const gchar *tooltip_text, gboolean active);
108 /** Create a radio button for a preferences page.
110 * @param main_tb the table to put this button into
111 * @param table_row row in the table
112 * @param label_text the label text for the left side
113 * @param tooltip_text the tooltip for this radio button
114 * @param enumvals the values
115 * @param current_val the initially selected value
116 * @return the new radio button
118 extern GtkWidget *create_preference_radio_buttons(GtkWidget *main_tb, int table_row,
119 const gchar *label_text, const gchar *tooltip_text,
120 const enum_val_t *enumvals, gint current_val);
122 /** Get the currently selected value from a radio button.
124 * @param button the button from create_preference_radio_buttons()
125 * @param enumvals the same enum vals as in create_preference_radio_buttons()
126 * @return the index of the currently selected item
128 extern gint fetch_preference_radio_buttons_val(GtkWidget *button, const enum_val_t *enumvals);
130 /** Create an option menu for a preferences page.
132 * @param main_tb the table to put this menu into
133 * @param table_row row in the table
134 * @param label_text the label text for the left side
135 * @param tooltip_text the tooltip for this option menu
136 * @param enumvals the values
137 * @param current_val the initially selected value
138 * @return the new option menu
140 extern GtkWidget *create_preference_option_menu(GtkWidget *main_tb, int table_row,
141 const gchar *label_text, const gchar *tooltip_text,
142 const enum_val_t *enumvals, gint current_val);
144 /** Get the currently selected value from an option menu.
146 * @param optmenu the option menu from create_preference_option_menu()
147 * @param enumvals the same enum vals as in create_preference_option_menu()
148 * @return the index of the currently selected item
150 extern gint fetch_preference_option_menu_val(GtkWidget *optmenu, const enum_val_t *enumvals);
152 /** Create a text entry for a preferences page.
154 * @param main_tb the table to put this entry into
155 * @param table_row row in the table
156 * @param label_text the label text for the left side
157 * @param tooltip_text the tooltip for this text entry
158 * @param value the initially value
159 * @return the new text entry
161 extern GtkWidget *create_preference_entry(GtkWidget *main_tb, int table_row,
162 const gchar *label_text, const gchar *tooltip_text, char *value);
164 /** Create a static text for a preferences page.
166 * @param main_tb the table to put this entry into
167 * @param table_position row in the table
168 * @param label_text the label text
169 * @param tooltip_text the tooltip for this text (not needed at all...)
170 * @return the new static text label
173 create_preference_static_text(GtkWidget *main_tb, int table_position,
174 const gchar *label_text, const gchar *tooltip_text);
176 /** Create a UAT button for a preferences page.
178 * @param main_tb the table to put this entry into
179 * @param table_position row in the table
180 * @param label_text the label text
181 * @param tooltip_text the tooltip for this text
182 * @param uat pointer to the UAT
183 * @return the new UAT button
186 create_preference_uat(GtkWidget *main_tb, int table_position,
187 const gchar *label_text, const gchar *tooltip_text, void *uat);
189 /** Save all preferences */
191 prefs_main_write(void);