00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: InstTargetCallbacks.h 00014 00015 Author: Michael Andres <ma@suse.de> 00016 Maintainer: Michael Andres <ma@suse.de> 00017 00018 Purpose: Callbacks triggered by InstTarget 00019 00020 /-*/ 00021 #ifndef InstTargetCallbacks_h 00022 #define InstTargetCallbacks_h 00023 00024 #include <iosfwd> 00025 00026 #include <y2pm/PMCallbacks.h> 00027 00029 namespace InstTargetCallbacks { 00031 00033 // Reporting progress of script execution. 00035 struct ScriptExecCallback : public RedirectCallback<ScriptExecCallback> { 00036 virtual void start( const Pathname & pkpath ) = 0; 00042 virtual bool progress( const ProgressData & prg ) = 0; 00043 virtual void stop( PMError error ) = 0; 00044 }; 00045 00046 class ScriptExecReport : public Report<ScriptExecCallback> { 00047 virtual void start( const Pathname & pkpath ) { 00048 ScriptExecCallback::start( pkpath ); 00049 } 00050 virtual bool progress( const ProgressData & prg ) { 00051 return ScriptExecCallback::progress( prg ); 00052 } 00053 virtual void stop( PMError error ) { 00054 ScriptExecCallback::stop( error ); 00055 } 00056 }; 00057 00058 extern ScriptExecReport scriptExecReport; 00059 00060 #if 0 00061 00062 // Reporting @ 00064 struct @Callback : public RedirectCallback<@Callback> { 00065 virtual void start() = 0; 00066 virtual void progress( const ProgressData & prg ) = 0; 00067 virtual void stop( PMError error ) = 0; 00068 }; 00069 00070 class @Report : public Report<@Callback> { 00071 virtual void start() { 00072 @Callback::start(); 00073 } 00074 virtual void progress( const ProgressData & prg ) { 00075 @Callback::progress( prg ); 00076 } 00077 virtual void stop( PMError error ) { 00078 @Callback::stop( error ); 00079 } 00080 }; 00081 00082 extern @Report @Report; 00083 #endif 00084 00086 } // namespace InstTargetCallbacks 00088 00089 #endif // InstTargetCallbacks_h
1.4.4