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(-1) {};
25 virtual ~PackageManager() {};
27 virtual void Start() {};
28 virtual void Stop() {};
30 virtual pid_t
fork() {return fork(); };
32 virtual void Pulse() {};
33 virtual long GetPulseInterval() {
37 virtual bool StatusChanged(std::string PackageName
,
38 unsigned int StepsDone
,
39 unsigned int TotalSteps
,
40 std::string HumanReadableAction
) ;
41 virtual void Error(std::string PackageName
,
42 unsigned int StepsDone
,
43 unsigned int TotalSteps
,
44 std::string ErrorMessage
) {};
45 virtual void ConffilePrompt(std::string PackageName
,
46 unsigned int StepsDone
,
47 unsigned int TotalSteps
,
48 std::string ConfMessage
) {};
51 class PackageManagerProgressFd
: public PackageManager
57 void WriteToStatusFd(std::string msg
);
60 PackageManagerProgressFd(int progress_fd
);
65 virtual bool StatusChanged(std::string PackageName
,
66 unsigned int StepsDone
,
67 unsigned int TotalSteps
,
68 std::string HumanReadableAction
);
69 virtual void Error(std::string PackageName
,
70 unsigned int StepsDone
,
71 unsigned int TotalSteps
,
72 std::string ErrorMessage
);
73 virtual void ConffilePrompt(std::string PackageName
,
74 unsigned int StepsDone
,
75 unsigned int TotalSteps
,
76 std::string ConfMessage
);
80 class PackageManagerFancy
: public PackageManager
84 void SetupTerminalScrollArea(int nr_rows
);
87 PackageManagerFancy();
90 virtual bool StatusChanged(std::string PackageName
,
91 unsigned int StepsDone
,
92 unsigned int TotalSteps
,
93 std::string HumanReadableAction
);
96 class PackageManagerText
: public PackageManager
99 virtual bool StatusChanged(std::string PackageName
,
100 unsigned int StepsDone
,
101 unsigned int TotalSteps
,
102 std::string HumanReadableAction
);
106 }; // namespace Progress