]> git.saurik.com Git - apt.git/blob - apt-pkg/iprogress.h
5f1655ab970c524c1b2b4e129c1a9cdfad08e4ac
[apt.git] / apt-pkg / iprogress.h
1 #ifndef PKGLIB_IPROGRESS_H
2 #define PKGLIB_IPROGRSS_H
3
4
5 #include <apt-pkg/packagemanager.h>
6
7 namespace APT {
8 namespace Progress {
9
10
11 class PackageManager
12 {
13 private:
14 /** \brief dpointer placeholder */
15 void *d;
16
17 protected:
18 std::string progress_str;
19 float percentage;
20 int last_reported_progress;
21
22 public:
23 PackageManager() : percentage(0.0), last_reported_progress(0) {};
24 virtual ~PackageManager() {};
25
26 virtual void Started() {};
27 virtual void Finished() {};
28
29 virtual bool StatusChanged(std::string PackageName,
30 unsigned int StepsDone,
31 unsigned int TotalSteps);
32 };
33
34 class PackageManagerFancy : public PackageManager
35 {
36 protected:
37 int nr_terminal_rows;
38 void SetupTerminalScrollArea(int nr_rows);
39
40 public:
41 PackageManagerFancy();
42 virtual void Started();
43 virtual void Finished();
44 virtual bool StatusChanged(std::string PackageName,
45 unsigned int StepsDone,
46 unsigned int TotalSteps);
47 };
48
49 class PackageManagerText : public PackageManager
50 {
51 public:
52 virtual bool StatusChanged(std::string PackageName,
53 unsigned int StepsDone,
54 unsigned int TotalSteps);
55
56 };
57
58
59 }; // namespace Progress
60 }; // namespace APT
61
62 #endif