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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 /** Create a check 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 check button
100 * @param active the check button is initially active
101 * @return the new check button
103 extern GtkWidget *create_preference_check_button(GtkWidget *main_tb, int table_row,
104 const gchar *label_text, const gchar *tooltip_text, gboolean active);
106 /** Create a radio button for a preferences page.
108 * @param main_tb the table to put this button into
109 * @param table_row row in the table
110 * @param label_text the label text for the left side
111 * @param tooltip_text the tooltip for this radio button
112 * @param enumvals the values
113 * @param current_val the initially selected value
114 * @return the new radio button
116 extern GtkWidget *create_preference_radio_buttons(GtkWidget *main_tb, int table_row,
117 const gchar *label_text, const gchar *tooltip_text,
118 const enum_val_t *enumvals, gint current_val);
120 /** Get the currently selected value from a radio button.
122 * @param button the button from create_preference_radio_buttons()
123 * @param enumvals the same enum vals as in create_preference_radio_buttons()
124 * @return the index of the currently selected item
126 extern gint fetch_preference_radio_buttons_val(GtkWidget *button, const enum_val_t *enumvals);
128 /** Create an option menu for a preferences page.
130 * @param main_tb the table to put this menu into
131 * @param table_row row in the table
132 * @param label_text the label text for the left side
133 * @param tooltip_text the tooltip for this option menu
134 * @param enumvals the values
135 * @param current_val the initially selected value
136 * @return the new option menu
138 extern GtkWidget *create_preference_option_menu(GtkWidget *main_tb, int table_row,
139 const gchar *label_text, const gchar *tooltip_text,
140 const enum_val_t *enumvals, gint current_val);
142 /** Get the currently selected value from an option menu.
144 * @param optmenu the option menu from create_preference_option_menu()
145 * @param enumvals the same enum vals as in create_preference_option_menu()
146 * @return the index of the currently selected item
148 extern gint fetch_preference_option_menu_val(GtkWidget *optmenu, const enum_val_t *enumvals);
150 /** Create a text entry for a preferences page.
152 * @param main_tb the table to put this entry into
153 * @param table_row row in the table
154 * @param label_text the label text for the left side
155 * @param tooltip_text the tooltip for this text entry
156 * @param value the initially value
157 * @return the new text entry
159 extern GtkWidget *create_preference_entry(GtkWidget *main_tb, int table_row,
160 const gchar *label_text, const gchar *tooltip_text, char *value);
162 /** Create a static text for a preferences page.
164 * @param main_tb the table to put this entry into
165 * @param table_position row in the table
166 * @param label_text the label text
167 * @param tooltip_text the tooltip for this text (not needed at all...)
168 * @return the new static text label
171 create_preference_static_text(GtkWidget *main_tb, int table_position,
172 const gchar *label_text, const gchar *tooltip_text);
174 /** Create a UAT button for a preferences page.
176 * @param main_tb the table to put this entry into
177 * @param table_position row in the table
178 * @param label_text the label text
179 * @param tooltip_text the tooltip for this text
180 * @param uat pointer to the UAT
181 * @return the new UAT button
184 create_preference_uat(GtkWidget *main_tb, int table_position,
185 const gchar *label_text, const gchar *tooltip_text, void *uat);
187 /** Save all preferences */
189 prefs_main_write(void);