00001
00002
00003
00004
00005
00006
00007
00008
00012 #ifndef ZYPP_ZYPPCALLBACKS_H
00013 #define ZYPP_ZYPPCALLBACKS_H
00014
00015 #include "zypp/Callback.h"
00016 #include "zypp/Resolvable.h"
00017 #include "zypp/Source.h"
00018 #include "zypp/Pathname.h"
00019 #include "zypp/Message.h"
00020 #include "zypp/Url.h"
00021
00023 namespace zypp
00024 {
00025 namespace source
00026 {
00027
00028 struct DownloadResolvableReport : public callback::ReportBase
00029 {
00030 enum Action {
00031 ABORT,
00032 RETRY,
00033 IGNORE,
00034 };
00035
00036 enum Error {
00037 NO_ERROR,
00038 NOT_FOUND,
00039 IO,
00040 INVALID
00041 };
00042
00043 virtual void start(
00044 Resolvable::constPtr resolvable_ptr
00045 , Url url
00046 ) {}
00047
00048
00049
00050
00051
00052
00053
00054 virtual void startDeltaDownload( const Pathname & filename, const ByteCount & downloadsize )
00055 {}
00056
00057 virtual bool progressDeltaDownload( int value )
00058 { return true; }
00059
00060 virtual void problemDeltaDownload( std::string description )
00061 {}
00062
00063 virtual void finishDeltaDownload()
00064 {}
00065
00066
00067
00068
00069
00070 virtual void startDeltaApply( const Pathname & filename )
00071 {}
00072
00073 virtual void progressDeltaApply( int value )
00074 {}
00075
00076 virtual void problemDeltaApply( std::string description )
00077 {}
00078
00079 virtual void finishDeltaApply()
00080 {}
00081
00082
00083
00084
00085
00086 virtual void startPatchDownload( const Pathname & filename, const ByteCount & downloadsize )
00087 {}
00088
00089 virtual bool progressPatchDownload( int value )
00090 { return true; }
00091
00092 virtual void problemPatchDownload( std::string description )
00093 {}
00094
00095 virtual void finishPatchDownload()
00096 {}
00097
00098
00099
00100 virtual bool progress(int value, Resolvable::constPtr resolvable_ptr)
00101 { return true; }
00102
00103 virtual Action problem(
00104 Resolvable::constPtr resolvable_ptr
00105 , Error error
00106 , std::string description
00107 ) { return ABORT; }
00108
00109 virtual void finish(Resolvable::constPtr resolvable_ptr
00110 , Error error
00111 , std::string reason
00112 ) {}
00113 };
00114
00115
00116
00117 struct DownloadFileReport : public callback::ReportBase
00118 {
00119 enum Action {
00120 ABORT,
00121 RETRY
00122 };
00123
00124 enum Error {
00125 NO_ERROR,
00126 NOT_FOUND,
00127 IO,
00128 INVALID
00129 };
00130 virtual void start(
00131 Source_Ref source
00132 , Url url
00133 ) {}
00134
00135 virtual bool progress(int value, Url url)
00136 { return true; }
00137
00138 virtual Action problem(
00139 Url url
00140 , Error error
00141 , std::string description
00142 ) { return ABORT; }
00143
00144 virtual void finish(
00145 Url url
00146 , Error error
00147 , std::string reason
00148 ) {}
00149 };
00150
00151
00152 struct RefreshSourceReport : public callback::ReportBase
00153 {
00154 enum Action {
00155 ABORT,
00156 RETRY,
00157 IGNORE
00158 };
00159
00160 enum Error {
00161 NO_ERROR,
00162 NOT_FOUND,
00163 IO,
00164 INVALID
00165 };
00166 virtual void start(
00167 Source_Ref source
00168 , Url url
00169 ) {}
00170
00171 virtual bool progress(int value, Source_Ref source)
00172 { return true; }
00173
00174 virtual Action problem(
00175 Source_Ref source
00176 , Error error
00177 , std::string description
00178 ) { return ABORT; }
00179
00180 virtual void finish(
00181 Source_Ref source
00182 , Error error
00183 , std::string reason
00184 ) {}
00185 };
00186
00187
00188 struct CreateSourceReport : public callback::ReportBase
00189 {
00190 enum Action {
00191 ABORT,
00192 RETRY
00193 };
00194
00195 enum Error {
00196 NO_ERROR,
00197 NOT_FOUND,
00198 IO,
00199 INVALID
00200 };
00201
00202 virtual void startData(
00203 Url source_url
00204 ) {}
00205
00206 virtual void startProbe(Url url) {}
00207
00208 virtual void endProbe(Url url) {}
00209
00210 virtual bool progressData(int value, Url url)
00211 { return true; }
00212
00213 virtual Action problem(
00214 Url url
00215 , Error error
00216 , std::string description
00217 ) { return ABORT; }
00218
00219 virtual void finishData(
00220 Url url
00221 , Error error
00222 , std::string reason
00223 ) {}
00224 };
00225
00227 }
00229
00231 namespace media
00232 {
00233
00234 struct MediaChangeReport : public callback::ReportBase
00235 {
00236 enum Action {
00237 ABORT,
00238 RETRY,
00239 IGNORE,
00240 IGNORE_ID,
00241 CHANGE_URL,
00242 EJECT
00243 };
00244
00245 enum Error {
00246 NO_ERROR,
00247 NOT_FOUND,
00248 IO,
00249 INVALID,
00250 WRONG
00251 };
00252
00253 virtual Action requestMedia(
00254 const Source_Ref source
00255 , unsigned mediumNr
00256 , Error error
00257 , std::string description
00258 ) { return ABORT; }
00259 };
00260
00261
00262 struct DownloadProgressReport : public callback::ReportBase
00263 {
00264 enum Action {
00265 ABORT,
00266 RETRY,
00267 IGNORE
00268 };
00269
00270 enum Error {
00271 NO_ERROR,
00272 NOT_FOUND,
00273 IO
00274 };
00275
00276 virtual void start( Url file, Pathname localfile ) {}
00277
00278 virtual bool progress(int value, Url file)
00279 { return true; }
00280
00281 virtual Action problem(
00282 Url file
00283 , Error error
00284 , std::string description
00285 ) { return ABORT; }
00286
00287 virtual void finish(
00288 Url file
00289 , Error error
00290 , std::string reason
00291 ) {}
00292 };
00293
00295 }
00297
00299 namespace target
00300 {
00301
00302
00303 struct MessageResolvableReport : public callback::ReportBase
00304 {
00305 virtual void show(
00306 Message::constPtr message
00307 ) {}
00308 };
00309
00311 namespace rpm
00312 {
00313
00314
00315 struct InstallResolvableReport : public callback::ReportBase
00316 {
00317 enum Action {
00318 ABORT,
00319 RETRY,
00320 IGNORE
00321 };
00322
00323 enum Error {
00324 NO_ERROR,
00325 NOT_FOUND,
00326 IO,
00327 INVALID
00328 };
00329
00330
00331 enum RpmLevel {
00332 RPM,
00333 RPM_NODEPS,
00334 RPM_NODEPS_FORCE
00335 };
00336
00337 virtual void start(
00338 Resolvable::constPtr resolvable
00339 ) {}
00340
00341 virtual bool progress(int value, Resolvable::constPtr resolvable)
00342 { return true; }
00343
00344 virtual Action problem(
00345 Resolvable::constPtr resolvable
00346 , Error error
00347 , std::string description
00348 , RpmLevel level
00349 ) { return ABORT; }
00350
00351 virtual void finish(
00352 Resolvable::constPtr resolvable
00353 , Error error
00354 , std::string reason
00355 , RpmLevel level
00356 ) {}
00357 };
00358
00359
00360 struct RemoveResolvableReport : public callback::ReportBase
00361 {
00362 enum Action {
00363 ABORT,
00364 RETRY,
00365 IGNORE
00366 };
00367
00368 enum Error {
00369 NO_ERROR,
00370 NOT_FOUND,
00371 IO,
00372 INVALID
00373 };
00374
00375 virtual void start(
00376 Resolvable::constPtr resolvable
00377 ) {}
00378
00379 virtual bool progress(int value, Resolvable::constPtr resolvable)
00380 { return true; }
00381
00382 virtual Action problem(
00383 Resolvable::constPtr resolvable
00384 , Error error
00385 , std::string description
00386 ) { return ABORT; }
00387
00388 virtual void finish(
00389 Resolvable::constPtr resolvable
00390 , Error error
00391 , std::string reason
00392 ) {}
00393 };
00394
00395
00396 struct RebuildDBReport : public callback::ReportBase
00397 {
00398 enum Action {
00399 ABORT,
00400 RETRY,
00401 IGNORE
00402 };
00403
00404 enum Error {
00405 NO_ERROR,
00406 FAILED
00407 };
00408
00409 virtual void start(Pathname path) {}
00410
00411 virtual bool progress(int value, Pathname path)
00412 { return true; }
00413
00414 virtual Action problem(
00415 Pathname path
00416 , Error error
00417 , std::string description
00418 ) { return ABORT; }
00419
00420 virtual void finish(
00421 Pathname path
00422 , Error error
00423 , std::string reason
00424 ) {}
00425 };
00426
00427
00428 struct ConvertDBReport : public callback::ReportBase
00429 {
00430 enum Action {
00431 ABORT,
00432 RETRY,
00433 IGNORE
00434 };
00435
00436 enum Error {
00437 NO_ERROR,
00438 FAILED
00439 };
00440
00441 virtual void start(
00442 Pathname path
00443 ) {}
00444
00445 virtual bool progress(int value, Pathname path)
00446 { return true; }
00447
00448 virtual Action problem(
00449 Pathname path
00450 , Error error
00451 , std::string description
00452 ) { return ABORT; }
00453
00454 virtual void finish(
00455 Pathname path
00456 , Error error
00457 , std::string reason
00458 ) {}
00459 };
00460
00461
00462 struct ScanDBReport : public callback::ReportBase
00463 {
00464 enum Action {
00465 ABORT,
00466 RETRY,
00467 IGNORE
00468 };
00469
00470 enum Error {
00471 NO_ERROR,
00472 FAILED
00473 };
00474
00475 virtual void start(
00476 ) {}
00477
00478 virtual bool progress(int value)
00479 { return true; }
00480
00481 virtual Action problem(
00482 Error error
00483 , std::string description
00484 ) { return ABORT; }
00485
00486 virtual void finish(
00487 Error error
00488 , std::string reason
00489 ) {}
00490 };
00491
00493 }
00495
00497 }
00499
00501 }
00503
00504 #endif // ZYPP_ZYPPCALLBACKS_H