Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / ETL / tags / ETL_0_04_09 / ETL / _status.h
1 /*! ========================================================================
2 ** Extended Template Library
3 ** Status Callback Class Implementation
4 ** $Id$
5 **
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
7 **
8 ** This package is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License as
10 ** published by the Free Software Foundation; either version 2 of
11 ** the License, or (at your option) any later version.
12 **
13 ** This package is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 ** General Public License for more details.
17 **
18 ** === N O T E S ===========================================================
19 **
20 ** This is an internal header file, included by other ETL headers.
21 ** You should not attempt to use it directly.
22 **
23 ** ========================================================================= */
24
25 /* === S T A R T =========================================================== */
26
27 #ifndef __ETL_STATUS_H
28 #define __ETL_STATUS_H
29
30 /* === H E A D E R S ======================================================= */
31
32 /* === M A C R O S ========================================================= */
33
34 /* === T Y P E D E F S ===================================================== */
35
36 /* === C L A S S E S & S T R U C T S ======================================= */
37
38 _ETL_BEGIN_NAMESPACE
39
40 class status
41 {
42 public:
43         virtual ~ProgressCallback() { }
44
45         virtual bool task(const std::string &task) { return true; }
46
47         virtual void push_task(const std::string &task,int start=0, int end=100, int total=100)
48                 { task(task); }
49         virtual void pop_task() { return; }
50
51         virtual void warning(const std::string &warn) { return; }
52         virtual void error(const std::string &err) { return; }
53
54         virtual bool amount_complete(int current, int total) { return true; }
55         virtual bool amount_complete(float percent)
56                 { return amount_complete((int)(percent*10000),10000); }
57 };
58
59 _ETL_END_NAMESPACE
60
61 /* === E X T E R N S ======================================================= */
62
63 /* === E N D =============================================================== */
64
65 #endif
66