2 * Definitions for progress dialog box routines
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef __PROGRESS_DLG_H__
12 #define __PROGRESS_DLG_H__
16 #endif /* __cplusplus */
19 * Progress (modal) dialog box routines.
20 * @ingroup dialog_group
23 /** Progress dialog data. */
26 /** Progress dialog data. */
27 typedef struct progdlg progdlg_t;
30 * Create and pop up the progress dialog. Allocates a "progdlg_t"
31 * and initialize it to contain all information the implementation
32 * needs in order to manipulate the dialog, and return a pointer to
35 * @param top_level_window UI widget to associate with the progress dialog, e.g.
37 * @param task_title The task to do, e.g. "Loading"
38 * @param item_title The item to do, e.g. "capture.cap"
39 * @param terminate_is_stop TRUE if the operation can't be cancelled, just
40 * stopped (i.e., it has a "Stop" button and clicking it doesn't undo
41 * anything already done), FALSE if it can
42 * @param stop_flag A pointer to a Boolean variable that will be
43 * set to TRUE if the user hits that button
44 * @return The newly created progress dialog
46 progdlg_t *create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title,
47 gboolean terminate_is_stop, gboolean *stop_flag);
50 * Create a progress dialog, but only if it's not likely to disappear
51 * immediately. This can be disconcerting for the user.
53 * @param top_level_window The top-level window associated with the progress update.
55 * @param task_title The task to do, e.g. "Loading"
56 * @param item_title The item to do, e.g. "capture.cap"
57 * @param terminate_is_stop TRUE if the operation can't be cancelled, just
58 * stopped (i.e., it has a "Stop" button and clicking it doesn't undo
59 * anything already done), FALSE if it can
60 * @param stop_flag A pointer to a Boolean variable that will be
61 * set to TRUE if the user hits that button
62 * @param start_time A pointer to a GTimeVal structure which holds
63 * the time at which the caller started to process the data
64 * @param progress The current progress (0..1)
65 * @return The newly created progress dialog
67 progdlg_t *delayed_create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title,
68 gboolean terminate_is_stop, gboolean *stop_flag,
69 const GTimeVal *start_time, gfloat progress);
72 * Update the progress information of the progress dialog box.
74 * @param dlg The progress dialog from create_progress_dlg()
75 * @param percentage The current percentage value (0..1)
76 * @param status the New status string to show, e.g. "3000KB of 6000KB"
78 void update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *status);
81 * Destroy or hide the progress bar.
83 * @param dlg The progress dialog from create_progress_dlg()
85 void destroy_progress_dlg(progdlg_t *dlg);
89 #endif /* __cplusplus */
91 #endif /* __PROGRESS_DLG_H__ */
99 * indent-tabs-mode: nil
102 * ex: set shiftwidth=4 tabstop=8 expandtab:
103 * :indentSize=4:tabSize=8:noTabs=true: