Qt: More byte view and proto tree fixes.
[metze/wireshark/wip.git] / ui / preference_utils.h
1 /* preference_utils.h
2  * Routines for handling preferences
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0+
9  */
10
11 #ifndef __PREFRENCE_UTILS_H__
12 #define __PREFRENCE_UTILS_H__
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17
18 /** @file
19  * Preference utility routines.
20  *  @ingroup prefs_group
21  */
22
23 /** If autoscroll in live captures is active or not
24  */
25 extern gboolean auto_scroll_live;
26
27 /** Fill in capture options with values from the preferences
28  */
29 extern void prefs_to_capture_opts(void);
30
31 /** Save all preferences
32  */
33 extern void prefs_main_write(void);
34
35 /** Convenient function for plugin_if
36  *
37  * Note: The preferences must exist, it is not possible to create entries
38  * using this function
39  *
40  * @param module the module for the preference
41  * @param key the key for the preference
42  * @param value the new value as string for the preference
43  *
44  * @return flags of types of preferences changed, non-zero if the value has been stored successfully
45  */
46 extern unsigned int prefs_store_ext(const char * module, const char * key, const char * value);
47
48 /** Convenient function for the writing of multiple preferences, without
49  * explicitly having prefs_t variables.
50  *
51  * Note: The preferences must exist, it is not possible to create entries
52  * using this function
53  *
54  * @param module the module for the preference
55  * @param pref_values a hash table
56  *
57  * @return true if the value has been stored successfully
58  */
59 extern gboolean prefs_store_ext_multiple(const char * module, GHashTable * pref_values);
60
61 /** Add a custom column.
62  *
63  * @param fmt column format
64  * @param title column title
65  * @param custom_field column custom field
66  * @param custom_occurrence custom occurrence
67  *
68  * @return The index of the inserted column
69  */
70 gint column_prefs_add_custom(gint fmt, const gchar *title,
71                              const gchar *custom_field,
72                              gint custom_occurrence);
73
74 /** Remove a column.
75  *
76  * @param col_link Column list entry
77  */
78 void column_prefs_remove_link(GList* col_link);
79
80 /** Remove a column.
81  *
82  * @param col Column number
83  */
84 void column_prefs_remove_nth(gint col);
85
86
87 #ifdef __cplusplus
88 }
89 #endif /* __cplusplus */
90
91 #endif /* __PREFRENCE_UTILS_H__ */
92
93 /*
94  * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
95  *
96  * Local Variables:
97  * c-basic-offset: 4
98  * tab-width: 8
99  * indent-tabs-mode: nil
100  * End:
101  *
102  * ex: set shiftwidth=4 tabstop=8 expandtab:
103  * :indentSize=4:tabSize=8:noTabs=true:
104  */