4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef MAINPROGRESS_H
23 #define MAINPROGRESS_H
25 #include "arraylist.h"
26 #include "bcprogressbox.inc"
28 #include "mainprogress.inc"
29 #include "mwindow.inc"
30 #include "mwindowgui.inc"
31 #include "bctimer.inc"
33 // Generic progress bar for the MainProgress
39 MainProgressBar(MWindow *mwindow, MainProgress *mainprogress);
42 friend class MainProgress;
46 void update_title(char *string, int default_ = 1);
47 void update_length(int64_t length);
48 int update(int64_t value);
49 void get_time(char *text);
52 // Only defined if this is a separate window;
53 BC_ProgressBox *progress_box;
54 // Only defined if this is the main progress bar
55 BC_ProgressBar *progress_bar;
57 MainProgress *mainprogress;
58 // Title assigned by user
59 char default_title[BCTEXTLEN];
61 // Last time eta was updated
69 // Controls all progressbars and locations
74 MainProgress(MWindow *mwindow, MWindowGUI *gui);
77 // Start a progress sequence and return the bar.
78 // use_window - force opening of a new window if 1.
79 MainProgressBar* start_progress(char *text,
82 void end_progress(MainProgressBar* progress_bar);
84 ArrayList<MainProgressBar*> progress_bars;
85 MainProgressBar *mwindow_progress;
89 // For mwindow progress