libzypp
10.5.0
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00013 #ifndef ZYPP_TARGET_RPM_RPMCALLBACKS_H 00014 #define ZYPP_TARGET_RPM_RPMCALLBACKS_H 00015 00016 #include <iosfwd> 00017 00018 #include "zypp/Url.h" 00019 #include "zypp/Callback.h" 00020 #include "zypp/base/Exception.h" 00021 #include "zypp/Pathname.h" 00022 00023 namespace zypp 00024 { 00025 namespace target 00026 { 00027 namespace rpm 00028 { 00029 00031 // Reporting progress of package removing 00033 struct RpmRemoveReport : public callback::ReportBase 00034 { 00035 00036 enum Action { 00037 ABORT, // abort and return error 00038 RETRY, // retry 00039 IGNORE // ignore 00040 }; 00041 00043 virtual void start( const std::string & name ) 00044 {} 00049 virtual bool progress( unsigned percent ) 00050 { return false; } 00051 00052 virtual Action problem( Exception & excpt_r ) 00053 { return ABORT; } 00054 00056 virtual void finishInfo( const std::string & info_r ) 00057 {} 00058 00060 virtual void finish() 00061 {} 00063 virtual void finish( Exception & excpt_r ) 00064 {} 00065 }; 00066 00068 // Reporting progress of package installation 00070 struct RpmInstallReport : public callback::ReportBase 00071 { 00072 00073 enum Action { 00074 ABORT, // abort and return error 00075 RETRY, // retry 00076 IGNORE // ignore 00077 }; 00078 00080 virtual void start( const Pathname & name ) 00081 {} 00086 virtual bool progress( unsigned percent ) 00087 { return true; } 00088 00090 virtual void finishInfo( const std::string & info_r ) 00091 {} 00092 00094 virtual void finish() 00095 {} 00096 00097 virtual Action problem( Exception & excpt_r ) 00098 { return ABORT; } 00099 00101 virtual void finish( Exception & excpt_r ) 00102 {} 00103 }; 00104 00105 } // namespace rpm 00106 } // namespace target 00107 } // namespace zypp 00108 00109 #endif // ZYPP_TARGET_RPM_RPMCALLBACKS_H