2 * Definitions for progress dialog box routines
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef __PROGRESS_DLG_H__
26 #define __PROGRESS_DLG_H__
30 #endif /* __cplusplus */
33 * Progress (modal) dialog box routines.
34 * @ingroup dialog_group
37 /** Progress dialog data. */
40 /** Progress dialog data. */
41 typedef struct progdlg progdlg_t
;
44 * Create and pop up the progress dialog. Allocates a "progdlg_t"
45 * and initialize it to contain all information the implementation
46 * needs in order to manipulate the dialog, and return a pointer to
49 * @param top_level_window UI widget to associate with the progress dialog, e.g.
51 * @param task_title The task to do, e.g. "Loading"
52 * @param item_title The item to do, e.g. "capture.cap"
53 * @param terminate_is_stop TRUE if the operation can't be cancelled, just
54 * stopped (i.e., it has a "Stop" button and clicking it doesn't undo
55 * anything already done), FALSE if it can
56 * @param stop_flag A pointer to a Boolean variable that will be
57 * set to TRUE if the user hits that button
58 * @return The newly created progress dialog
60 progdlg_t
*create_progress_dlg(const gpointer top_level_window
, const gchar
*task_title
, const gchar
*item_title
,
61 gboolean terminate_is_stop
, gboolean
*stop_flag
);
64 * Create a progress dialog, but only if it's not likely to disappear
65 * immediately. This can be disconcerting for the user.
67 * @param top_level_window The top-level window associated with the progress update.
69 * @param task_title The task to do, e.g. "Loading"
70 * @param item_title The item to do, e.g. "capture.cap"
71 * @param terminate_is_stop TRUE if the operation can't be cancelled, just
72 * stopped (i.e., it has a "Stop" button and clicking it doesn't undo
73 * anything already done), FALSE if it can
74 * @param stop_flag A pointer to a Boolean variable that will be
75 * set to TRUE if the user hits that button
76 * @param start_time A pointer to a GTimeVal structure which holds
77 * the time at which the caller started to process the data
78 * @param progress The current progress (0..1)
79 * @return The newly created progress dialog
82 delayed_create_progress_dlg(const gpointer top_level_window
, const gchar
*task_title
, const gchar
*item_title
,
83 gboolean terminate_is_stop
, gboolean
*stop_flag
,
84 const GTimeVal
*start_time
, gfloat progress
);
87 * Update the progress information of the progress dialog box.
89 * @param dlg The progress dialog from create_progress_dlg()
90 * @param percentage The current percentage value (0..1)
91 * @param status the New status string to show, e.g. "3000KB of 6000KB"
93 void update_progress_dlg(progdlg_t
*dlg
, gfloat percentage
, const gchar
*status
);
96 * Destroy or hide the progress bar.
98 * @param dlg The progress dialog from create_progress_dlg()
100 void destroy_progress_dlg(progdlg_t
*dlg
);
104 #endif /* __cplusplus */
106 #endif /* __PROGRESS_DLG_H__ */
114 * indent-tabs-mode: nil
117 * ex: set shiftwidth=4 tabstop=8 expandtab:
118 * :indentSize=4:tabSize=8:noTabs=true: