libzypp 17.31.23
TargetCallbackReceiver.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
13#define ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
14
15#include <zypp/ZYppCallbacks.h>
17
19namespace zypp
20{
22 namespace target
23 {
24
26 : public callback::ReceiveReport<rpm::RpmInstallReport>
27 {
28 callback::SendReport <rpm::InstallResolvableReport> _report;
31 bool _abort;
32 std::string _finishInfo;
33
34 public:
35
38
39 virtual void reportbegin();
40
41 virtual void reportend();
42
44 void report( const UserData & userData_r ) override;
45
47 virtual void start( const Pathname & name );
48
50
51 bool aborted() const { return _abort; }
52
57 virtual bool progress( unsigned percent );
58
61
63 virtual void finishInfo( const std::string & info_r );
64
66 virtual void finish();
67
69 virtual void finish( Exception & excpt_r );
70 };
71
73 : public callback::ReceiveReport<rpm::RpmRemoveReport>
74 {
75 callback::SendReport <rpm::RemoveResolvableReport> _report;
77 bool _abort;
78 std::string _finishInfo;
79
80 public:
81
84
85 virtual void reportbegin();
86
87 virtual void reportend();
88
91 void report( const UserData & userData_r ) override;
92
93 virtual void start( const std::string & name );
94
99 virtual bool progress( unsigned percent );
100
104 bool aborted() const { return _abort; }
105
108
110 virtual void finishInfo( const std::string & info_r );
111
113 virtual void finish();
114
116 virtual void finish( Exception & excpt_r );
117 };
118
120 } // namespace target
123} // namespace zypp
125#endif // ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
Base class for Exception.
Definition: Exception.h:146
TraitsType::constPtrType constPtr
Definition: Resolvable.h:59
virtual void finish()
Finish operation in case of success.
void tryLevel(target::rpm::InstallResolvableReport::RpmLevel level_r)
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
virtual void start(const Pathname &name)
Start the operation.
void report(const UserData &userData_r) override
Forwards generic reports.
virtual rpm::RpmInstallReport::Action problem(Exception &excpt_r)
inform user about a problem
target::rpm::InstallResolvableReport::RpmLevel _level
virtual bool progress(unsigned percent)
Inform about progress Return true on abort.
callback::SendReport< rpm::InstallResolvableReport > _report
bool aborted() const
Returns true if removing is aborted during progress.
virtual void start(const std::string &name)
virtual void finish()
Finish operation in case of success.
void report(const UserData &userData_r) override
Start the operation.
callback::SendReport< rpm::RemoveResolvableReport > _report
virtual bool progress(unsigned percent)
Inform about progress Return true on abort.
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
virtual rpm::RpmRemoveReport::Action problem(Exception &excpt_r)
inform user about a problem
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2