3 * Definitions for progress dialog box routines
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __PROGRESS_DLG_H__
13 #define __PROGRESS_DLG_H__
17 #endif /* __cplusplus */
20 * Progress (modal) dialog box routines.
21 * @ingroup dialog_group
24 /** Progress dialog data. */
27 /** Progress dialog data. */
28 typedef struct progdlg progdlg_t
;
31 * Create and pop up the progress dialog. Allocates a "progdlg_t"
32 * and initialize it to contain all information the implementation
33 * needs in order to manipulate the dialog, and return a pointer to
36 * @param top_level_window UI widget to associate with the progress dialog, e.g.
38 * @param task_title The task to do, e.g. "Loading"
39 * @param item_title The item to do, e.g. "capture.cap"
40 * @param terminate_is_stop true if the operation can't be cancelled, just
41 * stopped (i.e., it has a "Stop" button and clicking it doesn't undo
42 * anything already done), false if it can
43 * @param stop_flag A pointer to a Boolean variable that will be
44 * set to true if the user hits that button
45 * @return The newly created progress dialog
47 progdlg_t
*create_progress_dlg(void *top_level_window
, const char *task_title
, const char *item_title
,
48 bool terminate_is_stop
, bool *stop_flag
);
51 * Create a progress dialog, but only if it's not likely to disappear
52 * immediately. This can be disconcerting for the user.
54 * @param top_level_window The top-level window associated with the progress update.
56 * @param task_title The task to do, e.g. "Loading"
57 * @param item_title The item to do, e.g. "capture.cap"
58 * @param terminate_is_stop true if the operation can't be cancelled, just
59 * stopped (i.e., it has a "Stop" button and clicking it doesn't undo
60 * anything already done), false if it can
61 * @param stop_flag A pointer to a Boolean variable that will be
62 * set to true if the user hits that button
63 * @param progress The current progress (0..1)
64 * @return The newly created progress dialog
66 progdlg_t
*delayed_create_progress_dlg(void *top_level_window
, const char *task_title
, const char *item_title
,
67 bool terminate_is_stop
, bool *stop_flag
, float progress
);
70 * Update the progress information of the progress dialog box.
72 * @param dlg The progress dialog from create_progress_dlg()
73 * @param percentage The current percentage value (0..1)
74 * @param status the New status string to show, e.g. "3000KB of 6000KB"
76 void update_progress_dlg(progdlg_t
*dlg
, float percentage
, const char *status
);
79 * Destroy or hide the progress bar.
81 * @param dlg The progress dialog from create_progress_dlg()
83 void destroy_progress_dlg(progdlg_t
*dlg
);
87 #endif /* __cplusplus */
89 #endif /* __PROGRESS_DLG_H__ */