HACK: 1. try to match RowsetProperties
[wireshark-wip.git] / ui / gtk / prefs_dlg.h
blob863a05722163e107d4626963c1f8700b93d566ad
1 /* prefs_dlg.h
2 * Definitions for preference handling routines
4 * $Id$
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:
34 @dot
35 digraph prefs_pages {
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_font_colors.h"];
42 colors [ label="UI: Colors" URL="\ref prefs_font_colors.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" ];
57 @enddot
60 /** @file
61 * "Preferences" and "Protocol properties" dialog boxes.
62 * @ingroup dialog_group
63 * @ingroup prefs_group
66 typedef enum {
67 PREFS_PAGE_USER_INTERFACE,
68 PREFS_PAGE_LAYOUT,
69 PREFS_PAGE_COLUMNS,
70 PREFS_PAGE_CAPTURE
71 } PREFS_PAGE_E;
73 /** Show the preferences dialog.
75 * @param widget parent widget (unused)
76 * @param data unused
78 extern void prefs_cb(GtkWidget *widget, gpointer data);
80 /** Show the preferences dialog in given page.
82 * @param widget parent widget (unused)
83 * @param data unused
84 * @param prefs_page page to show
86 extern void prefs_page_cb(GtkWidget *widget, gpointer data, PREFS_PAGE_E prefs_page);
88 /** Show the protocol properties dialog.
90 * @param widget parent widget (unused)
91 * @param data unused
93 extern void properties_cb(GtkWidget *widget, gpointer data);
95 /** Create a check button for a preferences page.
97 * @param main_grid the grid to put this button into
98 * @param grid_row row in the grid
99 * @param label_text the label text for the left side
100 * @param tooltip_text the tooltip for this check button
101 * @param active the check button is initially active
102 * @return the new check button
104 extern GtkWidget *create_preference_check_button(GtkWidget *main_grid, int grid_row,
105 const gchar *label_text, const gchar *tooltip_text, gboolean active);
107 /** Create a radio button for a preferences page.
109 * @param main_grid the grid to put this button into
110 * @param grid_row row in the grid
111 * @param label_text the label text for the left side
112 * @param tooltip_text the tooltip for this radio button
113 * @param enumvals the values
114 * @param current_val the initially selected value
115 * @return the new radio button
117 extern GtkWidget *create_preference_radio_buttons(GtkWidget *main_grid, int grid_row,
118 const gchar *label_text, const gchar *tooltip_text,
119 const enum_val_t *enumvals, gint current_val);
121 /** Get the currently selected value from a radio button.
123 * @param button the button from create_preference_radio_buttons()
124 * @param enumvals the same enum vals as in create_preference_radio_buttons()
125 * @return the index of the currently selected item
127 extern gint fetch_preference_radio_buttons_val(GtkWidget *button, const enum_val_t *enumvals);
129 /** Create an option menu for a preferences page.
131 * @param main_grid the grid to put this menu into
132 * @param grid_row row in the grid
133 * @param label_text the label text for the left side
134 * @param tooltip_text the tooltip for this option menu
135 * @param enumvals the values
136 * @param current_val the initially selected value
137 * @return the new option menu
139 extern GtkWidget *create_preference_option_menu(GtkWidget *main_grid, int grid_row,
140 const gchar *label_text, const gchar *tooltip_text,
141 const enum_val_t *enumvals, gint current_val);
143 /** Get the currently selected value from an option menu.
145 * @param optmenu the option menu from create_preference_option_menu()
146 * @param enumvals the same enum vals as in create_preference_option_menu()
147 * @return the index of the currently selected item
149 extern gint fetch_preference_option_menu_val(GtkWidget *optmenu, const enum_val_t *enumvals);
151 /** Create a text entry for a preferences page.
153 * @param main_grid the grid to put this entry into
154 * @param grid_row row in the grid
155 * @param label_text the label text for the left side
156 * @param tooltip_text the tooltip for this text entry
157 * @param value the initially value
158 * @return the new text entry
160 extern GtkWidget *create_preference_entry(GtkWidget *main_grid, int grid_row,
161 const gchar *label_text, const gchar *tooltip_text, char *value);
163 /** Create a static text for a preferences page.
165 * @param main_grid the grid to put this entry into
166 * @param grid_position row in the grid
167 * @param label_text the label text
168 * @param tooltip_text the tooltip for this text (not needed at all...)
169 * @return the new static text label
171 extern GtkWidget *create_preference_static_text(GtkWidget *main_grid, int grid_position,
172 const gchar *label_text, const gchar *tooltip_text);
174 /** Create a UAT button for a preferences page.
176 * @param main_grid the grid to put this entry into
177 * @param grid_position row in the grid
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
183 extern GtkWidget *create_preference_uat(GtkWidget *main_grid, int grid_position,
184 const gchar *label_text, const gchar *tooltip_text, void *uat);
186 #endif