RpmCallbacks.h

Go to the documentation of this file.
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   namespace target {
00025     namespace rpm {
00026 
00028       // Reporting progress of package removing
00030       struct RpmRemoveReport : public callback::ReportBase {
00031 
00032         enum Action {
00033           ABORT,  // abort and return error
00034           RETRY,   // retry
00035           IGNORE   // ignore
00036         };
00037 
00039         virtual void start( const std::string & name )
00040         { }
00045         virtual bool progress( unsigned percent )
00046         { return false; }
00047 
00048         virtual Action problem( Exception & excpt_r )
00049          { return ABORT; }
00050 
00052         virtual void finish()
00053         { }
00055         virtual void finish( Exception & excpt_r )
00056         { }
00057       };
00058 
00060       // Reporting progress of package installation
00062       struct RpmInstallReport : public callback::ReportBase {
00063 
00064         enum Action {
00065           ABORT,  // abort and return error
00066           RETRY,   // retry
00067           IGNORE   // ignore
00068         };
00069 
00071         virtual void start( const Pathname & name ) 
00072         { }
00077         virtual bool progress( unsigned percent )
00078         { return true; }
00079 
00081         virtual void finish()
00082         { }
00083         
00084         virtual Action problem( Exception & excpt_r )
00085          { return ABORT; }
00086 
00088         virtual void finish( Exception & excpt_r )
00089         { }
00090       };
00091 
00092     } // namespace rpm
00093   } // namespace target
00094 } // namespace zypp
00095 
00096 #endif // ZYPP_TARGET_RPM_RPMCALLBACKS_H

Generated on Thu Jul 6 00:07:26 2006 for zypp by  doxygen 1.4.6