1 #ifndef PKGLIB_IPROGRESS_H
2 #define PKGLIB_IPROGRESS_H
14 /** \brief dpointer placeholder */
18 std::string progress_str
;
20 int last_reported_progress
;
24 : percentage(0.0), last_reported_progress(0) {};
25 virtual ~PackageManager() {};
27 virtual void Started() {};
28 virtual void Finished() {};
30 virtual pid_t
fork() {return fork(); };
32 virtual bool StatusChanged(std::string PackageName
,
33 unsigned int StepsDone
,
34 unsigned int TotalSteps
,
35 std::string HumanReadableAction
) ;
36 virtual void Error(std::string PackageName
,
37 unsigned int StepsDone
,
38 unsigned int TotalSteps
,
39 std::string ErrorMessage
) {};
40 virtual void ConffilePrompt(std::string PackageName
,
41 unsigned int StepsDone
,
42 unsigned int TotalSteps
,
43 std::string ConfMessage
) {};
46 class PackageManagerProgressFd
: public PackageManager
54 PackageManagerProgressFd(int progress_fd
);
55 virtual void Started();
56 virtual void Finished();
58 virtual bool StatusChanged(std::string PackageName
,
59 unsigned int StepsDone
,
60 unsigned int TotalSteps
,
61 std::string HumanReadableAction
);
62 virtual void Error(std::string PackageName
,
63 unsigned int StepsDone
,
64 unsigned int TotalSteps
,
65 std::string ErrorMessage
);
66 virtual void ConffilePrompt(std::string PackageName
,
67 unsigned int StepsDone
,
68 unsigned int TotalSteps
,
69 std::string ConfMessage
);
73 class PackageManagerFancy
: public PackageManager
77 void SetupTerminalScrollArea(int nr_rows
);
80 PackageManagerFancy();
81 virtual void Started();
82 virtual void Finished();
83 virtual bool StatusChanged(std::string PackageName
,
84 unsigned int StepsDone
,
85 unsigned int TotalSteps
,
86 std::string HumanReadableAction
);
89 class PackageManagerText
: public PackageManager
92 virtual bool StatusChanged(std::string PackageName
,
93 unsigned int StepsDone
,
94 unsigned int TotalSteps
,
95 std::string HumanReadableAction
);
99 }; // namespace Progress