Fix for bug 2964.
[obnox/wireshark/wip.git] / gtk / prefs_dlg.h
1 /* prefs_dlg.h
2  * Definitions for preference handling routines
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
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.
14  *
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.
19  *
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.
23  */
24
25 #ifndef __PREFS_DLG_H__
26 #define __PREFS_DLG_H__
27
28 /** @defgroup prefs_group Preferences
29  * 
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.
32  *
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 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" ];
56   }
57   @enddot
58  */
59
60 /** @file
61  * "Preferences" and "Protocol properties" dialog boxes.
62  *  @ingroup dialog_group
63  *  @ingroup prefs_group
64  */
65
66 /** Show the preferences dialog.
67  * 
68  * @param widget parent widget (unused)
69  * @param data unused
70  */
71 extern void prefs_cb(GtkWidget *widget, gpointer data);
72
73 /** Show the protocol properties dialog.
74  * 
75  * @param widget parent widget (unused)
76  * @param data unused
77  */
78 extern void properties_cb(GtkWidget *widget, gpointer data);
79
80 #define E_TOOLTIPS_KEY "tooltips"
81
82 /** Create a check button for a preferences page.
83  *
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
90  */
91 extern GtkWidget *create_preference_check_button(GtkWidget *main_tb, int table_row,
92     const gchar *label_text, const gchar *tooltip_text, gboolean active);
93
94 /** Create a radio button for a preferences page.
95  *
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
103  */
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);
107
108 /** Get the currently selected value from a radio button.
109  * 
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
113  */
114 extern gint fetch_preference_radio_buttons_val(GtkWidget *button, const enum_val_t *enumvals);
115
116 /** Create an option menu for a preferences page.
117  *
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
125  */
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);
129
130 /** Get the currently selected value from an option menu.
131  * 
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
135  */
136 extern gint fetch_preference_option_menu_val(GtkWidget *optmenu, const enum_val_t *enumvals);
137
138 /** Create a text entry for a preferences page.
139  *
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
146  */
147 extern GtkWidget *create_preference_entry(GtkWidget *main_tb, int table_row,
148     const gchar *label_text, const gchar *tooltip_text, char *value);
149
150 /** Create a static text for a preferences page.
151  *
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
155  * @param tooltip_text the tooltip for this text (not needed at all...)
156  * @return the new static text label
157  */
158 GtkWidget *
159 create_preference_static_text(GtkWidget *main_tb, int table_position,
160     const gchar *label_text, const gchar *tooltip_text);
161
162 /** Create a UAT button for a preferences page.
163  *
164  * @param main_tb the table to put this entry into
165  * @param table_row row in the table
166  * @param label_text the label text
167  * @param tooltip_text the tooltip for this text
168  * @return the new UAT botton
169  */
170 GtkWidget *
171 create_preference_uat(GtkWidget *main_tb, int table_position,
172     const gchar *label_text, const gchar *tooltip_text, void *uat);
173
174 #endif