Merge branch 'genete_device_settings'
[synfig.git] / synfig-core / src / tool / progress.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file tool/progress.h
3 **      \brief Progress class
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2007, 2008 Chris Moore
10 **
11 **      This package is free software; you can redistribute it and/or
12 **      modify it under the terms of the GNU General Public License as
13 **      published by the Free Software Foundation; either version 2 of
14 **      the License, or (at your option) any later version.
15 **
16 **      This package is distributed in the hope that it will be useful,
17 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
18 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 **      General Public License for more details.
20 **      \endlegal
21 */
22 /* ========================================================================= */
23
24 #ifndef __SYNFIG_PROGRESS_H
25 #define __SYNFIG_PROGRESS_H
26
27 using namespace std;
28 using namespace etl;
29 using namespace synfig;
30
31 #include <synfig/string.h>
32 #include "definitions.h"
33
34 class Progress : public synfig::ProgressCallback
35 {
36         const char *program;
37
38 public:
39
40         Progress(const char *name):program(name) { }
41
42         virtual bool
43         task(const String &task)
44         {
45                 VERBOSE_OUT(1)<<program<<": "<<task<<std::endl;
46                 return true;
47         }
48
49         virtual bool
50         error(const String &task)
51         {
52                 std::cerr<<program<<": "<<_("error")<<": "<<task<<std::endl;
53                 return true;
54         }
55
56         virtual bool
57         warning(const String &task)
58         {
59                 std::cerr<<program<<": "<<_("warning")<<": "<<task<<std::endl;
60                 return true;
61         }
62
63         virtual bool
64         amount_complete(int /*current*/, int /*total*/)
65         {
66                 return true;
67         }
68 };
69
70 #endif