WSDG: Update docbook info
[metze/wireshark/wip.git] / ui / profile.h
1 /* profile.h
2  * Definitions for dialog box for profiles editing.
3  * Stig Bjorlykke <stig@bjorlykke.org>, 2008
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later*/
10
11 #ifndef __PROFILE_H__
12 #define __PROFILE_H__
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17
18 /** @file
19  * "Configuration Profiles" dialog box
20  * @ingroup dialog_group
21  */
22
23 #define PROF_STAT_DEFAULT  1
24 #define PROF_STAT_EXISTS   2
25 #define PROF_STAT_NEW      3
26 #define PROF_STAT_CHANGED  4
27 #define PROF_STAT_COPY     5
28
29 typedef struct {
30     char     *name;             /* profile name */
31     char     *reference;        /* profile reference */
32     int       status;
33     gboolean  is_global;
34     gboolean  from_global;
35 } profile_def;
36
37 /** @file
38  * "Configuration Profiles" utility routines
39  * @ingroup utility_group
40  */
41
42 /** Initialize the profile list. Can be called more than once.
43  */
44 void init_profile_list(void);
45
46 /** User requested the "Configuration Profiles" popup menu.
47  *
48  * @param name Profile name
49  * @param parent Parent profile name
50  * @param status Current status
51  * @param is_global Profile is in the global configuration directory
52  * @param from_global Profile is copied from the global configuration directory
53  *
54  * @return A pointer to the new profile list
55  */
56 GList *add_to_profile_list(const char *name, const char *parent, int status,
57                            gboolean is_global, gboolean from_global);
58
59 /** Refresh the current (non-edited) profile list.
60  */
61 void copy_profile_list(void);
62
63 /** Clear out the profile list
64  *
65  * @param edit_list Remove edited entries
66  */
67 void empty_profile_list(gboolean edit_list);
68
69 /** Remove an entry from the profile list.
70  *
71  * @param fl_entry Profile list entry
72  */
73 void remove_from_profile_list(GList *fl_entry);
74
75 /** Current profile list
76  *
77  * @return The head of the current profile list
78  */
79 GList *current_profile_list(void);
80
81 /** Edited profile list
82  *
83  * @return The head of the edited profile list
84  */
85 GList * edited_profile_list(void);
86
87 /** Apply the changes in the edited profile list
88  * @return NULL if the operation was successful or an error message otherwise.
89  * The error message must be freed by the caller.
90  */
91 gchar *apply_profile_changes(void);
92
93 /** Given a profile name, return the name of its parent profile.
94  *
95  * @param profilename Child profile name
96  *
97  * @return Parent profile name
98  */
99 const gchar *get_profile_parent (const gchar *profilename);
100
101 /** Check the validity of a profile name.
102  *
103  * @param name Profile name
104  * @return NULL if the name is valid or an error message otherwise.
105  */
106 gchar *profile_name_is_valid(const gchar *name);
107
108 /** Remove the current profile.
109  *
110  * @return TRUE if the current profile exists and was successfully deleted
111  * or FALSE otherwise.
112  */
113 gboolean delete_current_profile(void);
114
115 #ifdef __cplusplus
116 }
117 #endif /* __cplusplus */
118
119 #endif /* __PROFILE_H__ */
120
121 /*
122  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
123  *
124  * Local variables:
125  * c-basic-offset: 4
126  * tab-width: 8
127  * indent-tabs-mode: nil
128  * End:
129  *
130  * vi: set shiftwidth=4 tabstop=8 expandtab:
131  * :indentSize=4:tabSize=8:noTabs=true:
132  */