2 * Definitions for recent "preference" handling routines
3 * Copyright 2004, Ulf Lamping <ulf.lamping@web.de>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 * Recent user interface settings.
33 * @ingroup main_window_group
37 #define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
40 #define RECENT_KEY_DISPLAY_FILTER "recent.display_filter"
42 typedef struct _col_width_data {
49 /** Defines used in col_width_data.xalign */
50 #define COLUMN_XALIGN_DEFAULT 0
51 #define COLUMN_XALIGN_LEFT 'L'
52 #define COLUMN_XALIGN_CENTER 'C'
53 #define COLUMN_XALIGN_RIGHT 'R'
55 /** Recent settings. */
56 typedef struct recent_settings_tag {
57 gboolean main_toolbar_show;
58 gboolean filter_toolbar_show;
59 gboolean airpcap_toolbar_show;
60 gboolean airpcap_driver_check_show;
61 gboolean packet_list_show;
62 gboolean tree_view_show;
63 gboolean byte_view_show;
64 gboolean statusbar_show;
65 gboolean packet_list_colorize;
67 gint gui_time_precision;
68 gint gui_seconds_format;
72 gint gui_geometry_main_x;
73 gint gui_geometry_main_y;
74 gint gui_geometry_main_width;
75 gint gui_geometry_main_height;
77 gboolean gui_geometry_main_maximized;
79 gboolean has_gui_geometry_main_upper_pane; /* gui_geometry_main_upper_pane is valid */
80 gint gui_geometry_main_upper_pane;
81 gboolean has_gui_geometry_main_lower_pane; /* gui_geometry_main_lower_pane is valid */
82 gint gui_geometry_main_lower_pane;
83 gboolean has_gui_geometry_status_pane; /* gui_geometry_status_pane is valid */
84 gint gui_geometry_status_pane_left;
85 gint gui_geometry_status_pane_right;
86 gint gui_geometry_wlan_stats_pane;
87 gboolean privs_warn_if_elevated;
88 gboolean privs_warn_if_no_npf;
89 GList *col_width_list; /* column widths */
90 gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
93 /** Global recent settings. */
94 extern recent_settings_t recent;
96 /** Write recent settings file.
98 * @return TRUE if succeeded, FALSE if failed
100 extern gboolean write_recent(void);
102 /** Write profile recent settings file.
104 * @return TRUE if succeeded, FALSE if failed
106 extern gboolean write_profile_recent(void);
108 /** Read recent settings file (static part).
110 * @param rf_path_return path to recent file if function failed
111 * @param rf_errno_return if failed
113 extern void recent_read_static(char **rf_path_return, int *rf_errno_return);
115 /** Read profile recent settings file (static part).
117 * @param rf_path_return path to recent file if function failed
118 * @param rf_errno_return if failed
120 extern void recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
122 /** Read recent settings file (dynamic part).
124 * @param rf_path_return path to recent file if function failed
125 * @param rf_errno_return if failed
127 extern void recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
129 /** Write the geometry values of a single window to the recent file.
132 * @param value the geometry values
133 * @param rf recent file handle (FILE)
135 extern void write_recent_geom(gpointer key, gpointer value, gpointer rf);
138 * Given a -o command line string, parse it and set the recent value in
139 * question. Return an indication of whether it succeeded or failed
142 * @param prefarg a string of the form "<recent name>:<recent value>", as might appear
143 * as an argument to a "-o" command line option
144 * @return PREFS_SET_OK or PREFS_SET_SYNTAX_ERR
146 extern int recent_set_arg(char *prefarg);
148 /** Get the column width for the given column
150 * @param col column number
152 extern gint recent_get_column_width(gint col);
154 /** Set the column width for the given column
156 * @param col column number
157 * @param width column width
159 extern void recent_set_column_width(gint col, gint width);
161 /** Get the column xalign for the given column
163 * @param col column number
165 extern gchar recent_get_column_xalign(gint col);
167 /** Set the column xalign for the given column
169 * @param col column number
170 * @param xalign column alignment
172 extern void recent_set_column_xalign(gint col, gchar xalign);
174 #endif /* recent.h */