libzypp  10.5.0
TargetCallbackReceiver.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
00013 #define ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
00014 
00015 #include "zypp/ZYppCallbacks.h"
00016 #include "zypp/target/rpm/RpmCallbacks.h"
00017 
00019 namespace zypp
00020 { 
00021 
00022   namespace target
00023   { 
00024 
00025     class RpmInstallPackageReceiver
00026         : public callback::ReceiveReport<rpm::RpmInstallReport>
00027     {
00028         callback::SendReport <rpm::InstallResolvableReport> _report;
00029         Resolvable::constPtr _resolvable;
00030         target::rpm::InstallResolvableReport::RpmLevel _level;
00031         bool _abort;
00032         std::string _finishInfo;
00033 
00034       public:
00035 
00036         RpmInstallPackageReceiver (Resolvable::constPtr res);
00037         virtual ~RpmInstallPackageReceiver ();
00038 
00039         virtual void reportbegin();
00040 
00041         virtual void reportend();
00042 
00044         virtual void start( const Pathname & name );
00045 
00046         void tryLevel( target::rpm::InstallResolvableReport::RpmLevel level_r );
00047 
00048         bool aborted() const { return _abort; }
00049 
00054         virtual bool progress( unsigned percent );
00055 
00057         virtual rpm::RpmInstallReport::Action problem( Exception & excpt_r );
00058 
00060         virtual void finishInfo( const std::string & info_r );
00061 
00063         virtual void finish();
00064 
00066         virtual void finish( Exception & excpt_r );
00067     };
00068 
00069     class RpmRemovePackageReceiver
00070         : public callback::ReceiveReport<rpm::RpmRemoveReport>
00071     {
00072         callback::SendReport <rpm::RemoveResolvableReport> _report;
00073         Resolvable::constPtr _resolvable;
00074         bool _abort;
00075         std::string _finishInfo;
00076 
00077       public:
00078 
00079         RpmRemovePackageReceiver (Resolvable::constPtr res);
00080         virtual ~RpmRemovePackageReceiver ();
00081 
00082         virtual void reportbegin();
00083 
00084         virtual void reportend();
00085 
00087         virtual void start( const std::string & name );
00088 
00093         virtual bool progress( unsigned percent );
00094 
00098         bool aborted() const { return _abort; }
00099 
00101         virtual rpm::RpmRemoveReport::Action problem( Exception & excpt_r );
00102 
00104         virtual void finishInfo( const std::string & info_r );
00105 
00107         virtual void finish();
00108 
00110         virtual void finish( Exception & excpt_r );
00111     };
00112 
00114   } // namespace target
00117 } // namespace zypp
00119 #endif // ZYPP_TARGET_TARGETCALLBACKRECEIVER_H