summaryrefslogtreecommitdiff
path: root/apt-pkg/iprogress.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-10-11 19:27:23 +0200
committerMichael Vogt <mvo@debian.org>2013-10-11 19:27:23 +0200
commit31f97d7b862ccf3de93b30a15f24d76e806031a3 (patch)
treebe7d38556a459169f083becb8ade1627520a5c5b /apt-pkg/iprogress.h
parent3921580c0b7ab67abb6eb5374af94d8951c525fe (diff)
first iteration of install progress refactor
Diffstat (limited to 'apt-pkg/iprogress.h')
-rw-r--r--apt-pkg/iprogress.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/apt-pkg/iprogress.h b/apt-pkg/iprogress.h
new file mode 100644
index 000000000..14fc89bff
--- /dev/null
+++ b/apt-pkg/iprogress.h
@@ -0,0 +1,59 @@
+#ifndef PKGLIB_IPROGRESS_H
+#define PKGLIB_IPROGRSS_H
+
+
+#include <apt-pkg/packagemanager.h>
+
+namespace APT {
+namespace Progress {
+
+
+ class PackageManager
+ {
+ private:
+ /** \brief dpointer placeholder */
+ void *d;
+
+ public:
+ virtual ~PackageManager() {};
+
+ virtual void Started() {};
+ virtual void Finished() {};
+
+ virtual void StatusChanged(std::string PackageName,
+ unsigned int StepsDone,
+ unsigned int TotalSteps) {};
+ };
+
+ class PackageManagerFancy : public PackageManager
+ {
+ protected:
+ int last_reported_progress;
+ int nr_terminal_rows;
+ public:
+ PackageManagerFancy();
+ virtual void Started();
+ virtual void Finished();
+ virtual void StatusChanged(std::string PackageName,
+ unsigned int StepsDone,
+ unsigned int TotalSteps);
+ };
+
+ class PackageManagerText : public PackageManager
+ {
+ protected:
+ int last_reported_progress;
+
+ public:
+ PackageManagerText() : last_reported_progress(0) {};
+ virtual void StatusChanged(std::string PackageName,
+ unsigned int StepsDone,
+ unsigned int TotalSteps);
+
+ };
+
+
+}; // namespace Progress
+}; // namespace APT
+
+#endif