libzypp 17.37.10

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>
16#include <zypp/target/rpm/RpmCallbacks.h>
17
19 namespace zypp
20{
22 namespace target
23 {
24
25 class RpmInstallPackageReceiver
26 : public callback::ReceiveReport<rpm::RpmInstallReport>
27 {
28 callback::SendReport <rpm::InstallResolvableReport> _report;
29 Resolvable::constPtr _resolvable;
30 target::rpm::InstallResolvableReport::RpmLevel _level;
31 bool _abort;
32 std::string _finishInfo;
33
34 public:
35
36 RpmInstallPackageReceiver (Resolvable::constPtr res);
37 virtual ~RpmInstallPackageReceiver ();
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
49 void tryLevel( target::rpm::InstallResolvableReport::RpmLevel level_r );
50
51 bool aborted() const { return _abort; }
52
57 virtual bool progress( unsigned percent );
58
60 virtual rpm::RpmInstallReport::Action problem( Exception & excpt_r );
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
72 class RpmRemovePackageReceiver
73 : public callback::ReceiveReport<rpm::RpmRemoveReport>
74 {
75 callback::SendReport <rpm::RemoveResolvableReport> _report;
76 Resolvable::constPtr _resolvable;
77 bool _abort;
78 std::string _finishInfo;
79
80 public:
81
82 RpmRemovePackageReceiver (Resolvable::constPtr res);
83 virtual ~RpmRemovePackageReceiver ();
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
107 virtual rpm::RpmRemoveReport::Action problem( Exception & excpt_r );
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
RpmCallbacks.h
ZYppCallbacks.h
zypp::Exception
Base class for Exception.
Definition Exception.h:153
zypp::Resolvable::constPtr
TraitsType::constPtrType constPtr
Definition Resolvable.h:59
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::target::RpmInstallPackageReceiver::_abort
bool _abort
Definition TargetCallbackReceiver.h:31
zypp::target::RpmInstallPackageReceiver::finish
virtual void finish()
Finish operation in case of success.
Definition TargetCallbackReceiver.cc:99
zypp::target::RpmInstallPackageReceiver::tryLevel
void tryLevel(target::rpm::InstallResolvableReport::RpmLevel level_r)
Definition TargetCallbackReceiver.cc:110
zypp::target::RpmInstallPackageReceiver::finishInfo
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
Definition TargetCallbackReceiver.cc:93
zypp::target::RpmInstallPackageReceiver::_finishInfo
std::string _finishInfo
Definition TargetCallbackReceiver.h:32
zypp::target::RpmInstallPackageReceiver::~RpmInstallPackageReceiver
virtual ~RpmInstallPackageReceiver()
Definition TargetCallbackReceiver.cc:34
zypp::target::RpmInstallPackageReceiver::aborted
bool aborted() const
Definition TargetCallbackReceiver.h:51
zypp::target::RpmInstallPackageReceiver::start
virtual void start(const Pathname &name)
Start the operation.
Definition TargetCallbackReceiver.cc:54
zypp::target::RpmInstallPackageReceiver::report
void report(const UserData &userData_r) override
Forwards generic reports.
Definition TargetCallbackReceiver.cc:46
zypp::target::RpmInstallPackageReceiver::problem
virtual rpm::RpmInstallReport::Action problem(Exception &excpt_r)
inform user about a problem
Definition TargetCallbackReceiver.cc:71
zypp::target::RpmInstallPackageReceiver::RpmInstallPackageReceiver
RpmInstallPackageReceiver(Resolvable::constPtr res)
Definition TargetCallbackReceiver.cc:26
zypp::target::RpmInstallPackageReceiver::reportend
virtual void reportend()
Definition TargetCallbackReceiver.cc:42
zypp::target::RpmInstallPackageReceiver::_level
target::rpm::InstallResolvableReport::RpmLevel _level
Definition TargetCallbackReceiver.h:30
zypp::target::RpmInstallPackageReceiver::progress
virtual bool progress(unsigned percent)
Inform about progress Return true on abort.
Definition TargetCallbackReceiver.cc:64
zypp::target::RpmInstallPackageReceiver::reportbegin
virtual void reportbegin()
Definition TargetCallbackReceiver.cc:38
zypp::target::RpmInstallPackageReceiver::_report
callback::SendReport< rpm::InstallResolvableReport > _report
Definition TargetCallbackReceiver.h:28
zypp::target::RpmInstallPackageReceiver::_resolvable
Resolvable::constPtr _resolvable
Definition TargetCallbackReceiver.h:29
zypp::target::RpmRemovePackageReceiver::RpmRemovePackageReceiver
RpmRemovePackageReceiver(Resolvable::constPtr res)
RpmRemovePackageReceiver.
Definition TargetCallbackReceiver.cc:120
zypp::target::RpmRemovePackageReceiver::reportend
virtual void reportend()
Definition TargetCallbackReceiver.cc:135
zypp::target::RpmRemovePackageReceiver::_finishInfo
std::string _finishInfo
Definition TargetCallbackReceiver.h:78
zypp::target::RpmRemovePackageReceiver::reportbegin
virtual void reportbegin()
Definition TargetCallbackReceiver.cc:131
zypp::target::RpmRemovePackageReceiver::aborted
bool aborted() const
Returns true if removing is aborted during progress.
Definition TargetCallbackReceiver.h:104
zypp::target::RpmRemovePackageReceiver::start
virtual void start(const std::string &name)
Definition TargetCallbackReceiver.cc:147
zypp::target::RpmRemovePackageReceiver::finish
virtual void finish()
Finish operation in case of success.
Definition TargetCallbackReceiver.cc:191
zypp::target::RpmRemovePackageReceiver::report
void report(const UserData &userData_r) override
Start the operation.
Definition TargetCallbackReceiver.cc:140
zypp::target::RpmRemovePackageReceiver::_report
callback::SendReport< rpm::RemoveResolvableReport > _report
Definition TargetCallbackReceiver.h:75
zypp::target::RpmRemovePackageReceiver::_resolvable
Resolvable::constPtr _resolvable
Definition TargetCallbackReceiver.h:76
zypp::target::RpmRemovePackageReceiver::progress
virtual bool progress(unsigned percent)
Inform about progress Return true on abort.
Definition TargetCallbackReceiver.cc:157
zypp::target::RpmRemovePackageReceiver::finishInfo
virtual void finishInfo(const std::string &info_r)
Additional rpm output to be reported in finish in case of success.
Definition TargetCallbackReceiver.cc:185
zypp::target::RpmRemovePackageReceiver::problem
virtual rpm::RpmRemoveReport::Action problem(Exception &excpt_r)
inform user about a problem
Definition TargetCallbackReceiver.cc:164
zypp::target::RpmRemovePackageReceiver::_abort
bool _abort
Definition TargetCallbackReceiver.h:77
zypp::target::RpmRemovePackageReceiver::~RpmRemovePackageReceiver
virtual ~RpmRemovePackageReceiver()
Definition TargetCallbackReceiver.cc:127
zypp::target
Definition KeyRing.h:325
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::callback::ReceiveReport
Definition Callback.h:169
zypp::target::rpm::InstallResolvableReport::RpmLevel
RpmLevel
Definition ZYppCallbacks.h:608
zypp::target::rpm::RpmInstallReport::Action
Action
Definition RpmCallbacks.h:73
zypp::target::rpm::RpmRemoveReport::Action
Action
Definition RpmCallbacks.h:36