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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 #endif /* __cplusplus */
35 #include "epan/timestamp.h"
36 #include "ui/ui_util.h"
39 * Recent user interface settings.
40 * @ingroup main_window_group
44 #define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
47 #define RECENT_KEY_DISPLAY_FILTER "recent.display_filter"
49 #define RECENT_KEY_COL_WIDTH "column.width"
51 #define RECENT_KEY_CAPTURE_FILTER "recent.capture_filter"
53 #define RECENT_KEY_REMOTE_HOST "recent.remote_host"
55 typedef struct _col_width_data
{
62 /** Defines used in col_width_data.xalign */
63 #define COLUMN_XALIGN_DEFAULT 0
64 #define COLUMN_XALIGN_LEFT 'L'
65 #define COLUMN_XALIGN_CENTER 'C'
66 #define COLUMN_XALIGN_RIGHT 'R'
68 /** Recent settings. */
69 typedef struct recent_settings_tag
{
70 gboolean main_toolbar_show
;
71 gboolean filter_toolbar_show
;
72 gboolean wireless_toolbar_show
;
73 gboolean airpcap_driver_check_show
;
74 gboolean packet_list_show
;
75 gboolean tree_view_show
;
76 gboolean byte_view_show
;
77 gboolean statusbar_show
;
78 gboolean packet_list_colorize
;
79 ts_type gui_time_format
;
80 gint gui_time_precision
;
81 ts_seconds_type gui_seconds_format
;
85 gint gui_geometry_main_x
;
86 gint gui_geometry_main_y
;
87 gint gui_geometry_main_width
;
88 gint gui_geometry_main_height
;
90 gboolean gui_geometry_main_maximized
;
92 gboolean has_gui_geometry_main_upper_pane
; /* gui_geometry_main_upper_pane is valid */
93 gint gui_geometry_main_upper_pane
;
94 gboolean has_gui_geometry_main_lower_pane
; /* gui_geometry_main_lower_pane is valid */
95 gint gui_geometry_main_lower_pane
;
96 gboolean has_gui_geometry_status_pane
; /* gui_geometry_status_pane is valid */
97 gint gui_geometry_status_pane_left
;
98 gint gui_geometry_status_pane_right
;
99 gint gui_geometry_wlan_stats_pane
;
100 gboolean privs_warn_if_elevated
;
101 gboolean privs_warn_if_no_npf
;
102 GList
*col_width_list
; /* column widths */
103 gchar
*gui_fileopen_remembered_dir
; /* folder of last capture loaded in File Open dialog */
106 /** Global recent settings. */
107 extern recent_settings_t recent
;
109 /** Write recent settings file.
111 * @return TRUE if succeeded, FALSE if failed
113 extern gboolean
write_recent(void);
115 /** Write profile recent settings file.
117 * @return TRUE if succeeded, FALSE if failed
119 extern gboolean
write_profile_recent(void);
121 /** Read recent settings file (static part).
123 * @param rf_path_return path to recent file if function failed
124 * @param rf_errno_return if failed
126 extern void recent_read_static(char **rf_path_return
, int *rf_errno_return
);
128 /** Read profile recent settings file (static part).
130 * @param rf_path_return path to recent file if function failed
131 * @param rf_errno_return if failed
133 extern void recent_read_profile_static(char **rf_path_return
, int *rf_errno_return
);
135 /** Read recent settings file (dynamic part).
137 * @param rf_path_return path to recent file if function failed
138 * @param rf_errno_return if failed
140 extern void recent_read_dynamic(char **rf_path_return
, int *rf_errno_return
);
143 * Given a -o command line string, parse it and set the recent value in
144 * question. Return an indication of whether it succeeded or failed
147 * @param prefarg a string of the form "<recent name>:<recent value>", as might appear
148 * as an argument to a "-o" command line option
149 * @return PREFS_SET_OK or PREFS_SET_SYNTAX_ERR
151 extern int recent_set_arg(char *prefarg
);
153 /** Get the column width for the given column
155 * @param col column number
157 extern gint
recent_get_column_width(gint col
);
159 /** Set the column width for the given column
161 * @param col column number
162 * @param width column width
164 extern void recent_set_column_width(gint col
, gint width
);
166 /** Get the column xalign for the given column
168 * @param col column number
170 extern gchar
recent_get_column_xalign(gint col
);
172 /** Set the column xalign for the given column
174 * @param col column number
175 * @param xalign column alignment
177 extern void recent_set_column_xalign(gint col
, gchar xalign
);
179 /* save the window and its current geometry into the geometry hashtable */
180 extern void window_geom_save(const gchar
*name
, window_geometry_t
*geom
);
182 /* load the desired geometry for this window from the geometry hashtable */
183 extern gboolean
window_geom_load(const gchar
*name
, window_geometry_t
*geom
);
186 * Returns a list of recent capture filters.
188 * @param ifname interface name; NULL refers to the global list.
190 extern GList
*recent_get_cfilter_list(const gchar
*ifname
);
193 * Add a capture filter to the global recent capture filter list or
194 * the recent capture filter list for an interface.
196 * @param ifname interface name; NULL refers to the global list.
197 * @param s text of capture filter
199 extern void recent_add_cfilter(const gchar
*ifname
, const gchar
*s
);
203 #endif /* __cplusplus */
205 #endif /* recent.h */
213 * indent-tabs-mode: nil
216 * ex: set shiftwidth=4 tabstop=8 expandtab:
217 * :indentSize=4:tabSize=8:noTabs=true: