1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ZYppCallbacks.h
12 #ifndef ZYPP_ZYPPCALLBACKS_H
13 #define ZYPP_ZYPPCALLBACKS_H
15 #include "zypp/Callback.h"
16 #include "zypp/Resolvable.h"
17 #include "zypp/Source.h"
18 #include "zypp/Pathname.h"
21 ///////////////////////////////////////////////////////////////////
23 { /////////////////////////////////////////////////////////////////
26 // progress for downloading a resolvable
27 struct DownloadResolvableReport : public callback::ReportBase
30 ABORT, // abort and return error
36 NOT_FOUND, // the requested Url was not found
38 INVALID // the downloaded file is invalid
42 Resolvable::Ptr resolvable_ptr
46 // return false if the download should be aborted right now
47 virtual bool progress(int value, Resolvable::Ptr resolvable_ptr)
50 virtual Action problem(
51 Resolvable::Ptr resolvable_ptr
53 , std::string description
56 virtual void finish(Resolvable::Ptr resolvable_ptr
63 // progress for downloading a specific file
64 struct DownloadFileReport : public callback::ReportBase
67 ABORT, // abort and return error
73 NOT_FOUND, // the requested Url was not found
75 INVALID // the downloaded file is invalid
82 virtual bool progress(int value, Url url)
85 virtual Action problem(
88 , std::string description
98 // progress for refreshing a source data
99 struct RefreshSourceReport : public callback::ReportBase
102 ABORT, // abort and return error
108 NOT_FOUND, // the requested Url was not found
110 INVALID // th source is invalid
117 virtual bool progress(int value, Source_Ref source)
120 virtual Action problem(
123 , std::string description
133 // progress for creating a source (download and parsing)
134 struct CreateSourceReport : public callback::ReportBase
137 ABORT, // abort and return error
143 NOT_FOUND, // the requested Url was not found
145 INVALID // th source is invalid
152 virtual bool progress(int value, Url url)
155 virtual Action problem(
158 , std::string description
168 /////////////////////////////////////////////////////////////////
169 } // namespace source
170 ///////////////////////////////////////////////////////////////////
172 ///////////////////////////////////////////////////////////////////
175 // media change request callback
176 struct MediaChangeReport : public callback::ReportBase
179 ABORT, // abort and return error
181 IGNORE, // ignore this media in future, not available anymore
186 NOT_FOUND, // the medie not found at all
187 IO, // error accessing the media
188 INVALID, // media is broken
189 WRONG // wrong media, need a different one
192 virtual Action requestMedia(
193 const Source_Ref source
196 , std::string description
200 /////////////////////////////////////////////////////////////////
202 ///////////////////////////////////////////////////////////////////
204 ///////////////////////////////////////////////////////////////////
208 ///////////////////////////////////////////////////////////////////
212 // progress for installing a resolvable
213 struct InstallResolvableReport : public callback::ReportBase
216 ABORT, // abort and return error
218 IGNORE // ignore the failure
223 NOT_FOUND, // the requested Url was not found
225 INVALID // th resolvable is invalid
229 Resolvable::constPtr resolvable
232 virtual bool progress(int value, Resolvable::constPtr resolvable)
235 virtual Action problem(
236 Resolvable::constPtr resolvable
238 , std::string description
242 Resolvable::constPtr resolvable
248 // progress for removing a resolvable
249 struct RemoveResolvableReport : public callback::ReportBase
252 ABORT, // abort and return error
254 IGNORE // ignore the failure
259 NOT_FOUND, // the requested Url was not found
261 INVALID // th resolvable is invalid
265 Resolvable::Ptr resolvable
268 virtual bool progress(int value, Resolvable::Ptr resolvable)
271 virtual Action problem(
272 Resolvable::Ptr resolvable
274 , std::string description
278 Resolvable::Ptr resolvable
284 // progress for rebuilding the database
285 struct RebuildDBReport : public callback::ReportBase
288 ABORT, // abort and return error
290 IGNORE // ignore the failure
295 NOT_FOUND, // the requested Url was not found
297 INVALID // th resolvable is invalid
304 virtual bool progress(int value, Pathname path)
307 virtual Action problem(
310 , std::string description
320 // progress for converting the database
321 struct ConvertDBReport : public callback::ReportBase
324 ABORT, // abort and return error
326 IGNORE // ignore the failure
331 NOT_FOUND, // the requested Url was not found
333 INVALID // th resolvable is invalid
340 virtual bool progress(int value, Pathname path)
343 virtual Action problem(
346 , std::string description
356 /////////////////////////////////////////////////////////////////
358 ///////////////////////////////////////////////////////////////////
360 /////////////////////////////////////////////////////////////////
361 } // namespace target
362 ///////////////////////////////////////////////////////////////////
364 /////////////////////////////////////////////////////////////////
366 ///////////////////////////////////////////////////////////////////
368 #endif // ZYPP_ZYPPCALLBACKS_H