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"
20 #include "zypp/media/MediaManager.h"
22 ///////////////////////////////////////////////////////////////////
24 { /////////////////////////////////////////////////////////////////
27 // progress for downloading a resolvable
28 struct DownloadResolvableReport : public callback::ReportBase
31 ABORT, // abort and return error
37 NOT_FOUND, // the requested Url was not found
39 INVALID // the downloaded file is invalid
43 Resolvable::Ptr resolvable_ptr
47 // return true if the download should be aborted right now
48 virtual bool progress(int value, Resolvable::Ptr resolvable_ptr)
51 virtual Action problem(
52 Resolvable::Ptr resolvable_ptr
54 , std::string description
57 virtual void finish(Resolvable::Ptr resolvable_ptr
64 // progress for downloading a specific file
65 struct DownloadFileReport : public callback::ReportBase
68 ABORT, // abort and return error
74 NOT_FOUND, // the requested Url was not found
76 INVALID // the downloaded file is invalid
83 virtual bool progress(int value, Url url)
86 virtual Action problem(
89 , std::string description
99 // progress for refreshing a source data
100 struct RefreshSourceReport : public callback::ReportBase
103 ABORT, // abort and return error
109 NOT_FOUND, // the requested Url was not found
111 INVALID // th source is invalid
118 virtual bool progress(int value, Source_Ref source)
121 virtual Action problem(
124 , std::string description
134 // progress for creating a source (download and parsing)
135 struct CreateSourceReport : public callback::ReportBase
138 ABORT, // abort and return error
144 NOT_FOUND, // the requested Url was not found
146 INVALID // th source is invalid
153 virtual bool progress(int value, Url url)
156 virtual Action problem(
159 , std::string description
169 /////////////////////////////////////////////////////////////////
170 } // namespace source
171 ///////////////////////////////////////////////////////////////////
173 ///////////////////////////////////////////////////////////////////
176 // media change request callback
177 struct MediaChangeReport : public callback::ReportBase
180 ABORT, // abort and return error
182 IGNORE, // ignore this media in future, not available anymore
187 NOT_FOUND, // the medie not found at all
188 IO, // error accessing the media
189 INVALID, // media is broken
190 WRONG // wrong media, need a different one
193 virtual Action requestMedia(
194 const media::MediaAccessRef &ref
197 , std::string description
201 /////////////////////////////////////////////////////////////////
203 ///////////////////////////////////////////////////////////////////
205 ///////////////////////////////////////////////////////////////////
209 ///////////////////////////////////////////////////////////////////
213 // progress for installing a resolvable
214 struct InstallResolvableReport : public callback::ReportBase
217 ABORT, // abort and return error
219 IGNORE // ignore the failure
224 NOT_FOUND, // the requested Url was not found
226 INVALID // th resolvable is invalid
230 Resolvable::constPtr resolvable
233 virtual bool progress(int value, Resolvable::constPtr resolvable)
236 virtual Action problem(
237 Resolvable::constPtr resolvable
239 , std::string description
243 Resolvable::constPtr resolvable
249 // progress for removing a resolvable
250 struct RemoveResolvableReport : public callback::ReportBase
253 ABORT, // abort and return error
255 IGNORE // ignore the failure
260 NOT_FOUND, // the requested Url was not found
262 INVALID // th resolvable is invalid
266 Resolvable::Ptr resolvable
269 virtual bool progress(int value, Resolvable::Ptr resolvable)
272 virtual Action problem(
273 Resolvable::Ptr resolvable
275 , std::string description
279 Resolvable::Ptr resolvable
285 // progress for rebuilding the database
286 struct RebuildDBReport : public callback::ReportBase
289 ABORT, // abort and return error
291 IGNORE // ignore the failure
296 NOT_FOUND, // the requested Url was not found
298 INVALID // th resolvable is invalid
305 virtual bool progress(int value, Pathname path)
308 virtual Action problem(
311 , std::string description
321 // progress for converting the database
322 struct ConvertDBReport : public callback::ReportBase
325 ABORT, // abort and return error
327 IGNORE // ignore the failure
332 NOT_FOUND, // the requested Url was not found
334 INVALID // th resolvable is invalid
341 virtual bool progress(int value, Pathname path)
344 virtual Action problem(
347 , std::string description
357 /////////////////////////////////////////////////////////////////
359 ///////////////////////////////////////////////////////////////////
361 /////////////////////////////////////////////////////////////////
362 } // namespace target
363 ///////////////////////////////////////////////////////////////////
365 /////////////////////////////////////////////////////////////////
367 ///////////////////////////////////////////////////////////////////
369 #endif // ZYPP_ZYPPCALLBACKS_H