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/TranslatedText.h"
19 #include "zypp/Pathname.h"
21 ///////////////////////////////////////////////////////////////////
23 { /////////////////////////////////////////////////////////////////
26 // progress for downloading a resolvable
27 struct DownloadResolvableReport : public callback::ReportBase
30 ABORT, // abort and return error
35 NOT_FOUND, // the requested URL was not found
37 INVALID // the downloaded file is invalid
41 Resolvable::Ptr resolvable_ptr
46 // return true 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 , TranslatedText description
56 virtual void finish(Resolvable::Ptr resolvable_ptr
58 , TranslatedText reason
63 // progress for downloading a specific file
64 struct DownloadFileReport : public callback::ReportBase
67 ABORT, // abort and return error
72 NOT_FOUND, // the requested URL was not found
74 INVALID // the downloaded file is invalid
81 virtual bool progress(int value, URL url)
84 virtual Action problem(
87 , TranslatedText description
93 , TranslatedText reason
97 // progress for refreshing a source data
98 struct RefreshSourceReport : public callback::ReportBase
101 ABORT, // abort and return error
106 NOT_FOUND, // the requested URL was not found
108 INVALID // th source is invalid
115 virtual bool progress(int value, Source_Ref source)
118 virtual Action problem(
121 , TranslatedText description
127 , TranslatedText reason
131 // progress for creating a source (download and parsing)
132 struct CreateSourceReport : public callback::ReportBase
135 ABORT, // abort and return error
140 NOT_FOUND, // the requested URL was not found
142 INVALID // th source is invalid
149 virtual bool progress(int value, URL url)
152 virtual Action problem(
155 , TranslatedText description
161 , TranslatedText reason
165 /////////////////////////////////////////////////////////////////
166 } // namespace source
167 ///////////////////////////////////////////////////////////////////
169 ///////////////////////////////////////////////////////////////////
172 // media change request callback
173 struct MediaChangeReport : public callback::ReportBase
176 ABORT, // abort and return error
178 IGNORE, // ignore this media in future, not available anymore
181 virtual Action requestMedia(
185 , TranslatedText description
189 /////////////////////////////////////////////////////////////////
191 ///////////////////////////////////////////////////////////////////
193 ///////////////////////////////////////////////////////////////////
197 ///////////////////////////////////////////////////////////////////
201 // progress for installing a resolvable
202 struct InstallResolvableReport : public callback::ReportBase
205 ABORT, // abort and return error
207 IGNORE // ignore the failure
211 NOT_FOUND, // the requested URL was not found
213 INVALID // th resolvable is invalid
217 Resolvable::Ptr resolvable
220 virtual bool progress(int value, Resolvable::Ptr resolvable)
223 virtual Action problem(
224 Resolvable::Ptr resolvable
226 , TranslatedText description
230 Resolvable::Ptr resolvable
232 , TranslatedText reason
236 // progress for removing a resolvable
237 struct RemoveResolvableReport : public callback::ReportBase
240 ABORT, // abort and return error
242 IGNORE // ignore the failure
246 NOT_FOUND, // the requested URL was not found
248 INVALID // th resolvable is invalid
252 Resolvable::Ptr resolvable
255 virtual bool progress(int value, Resolvable::Ptr resolvable)
258 virtual Action problem(
259 Resolvable::Ptr resolvable
261 , TranslatedText description
265 Resolvable::Ptr resolvable
267 , TranslatedText reason
271 // progress for rebuilding the database
272 struct RebuildDBReport : public callback::ReportBase
275 ABORT, // abort and return error
277 IGNORE // ignore the failure
281 NOT_FOUND, // the requested URL was not found
283 INVALID // th resolvable is invalid
290 virtual bool progress(int value, Pathname path)
293 virtual Action problem(
296 , TranslatedText description
302 , TranslatedText reason
306 // progress for converting the database
307 struct ConvertDBReport : public callback::ReportBase
310 ABORT, // abort and return error
312 IGNORE // ignore the failure
316 NOT_FOUND, // the requested URL was not found
318 INVALID // th resolvable is invalid
325 virtual bool progress(int value, Pathname path)
328 virtual Action problem(
331 , TranslatedText description
337 , TranslatedText reason
341 /////////////////////////////////////////////////////////////////
343 ///////////////////////////////////////////////////////////////////
345 /////////////////////////////////////////////////////////////////
346 } // namespace target
347 ///////////////////////////////////////////////////////////////////
349 /////////////////////////////////////////////////////////////////
351 ///////////////////////////////////////////////////////////////////
353 #endif // ZYPP_ZYPPCALLBACKS_H