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"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
25 // progress for downloading a resolvable
26 struct DownloadResolvableReport : public callback::ReportBase
29 ABORT, // abort and return error
34 NOT_FOUND, // the requested URL was not found
36 INVALID // the downloaded file is invalid
40 Resolvable::Ptr resolvable_ptr
45 virtual void progress(int value, Resolvable::Ptr resolvable_ptr) {]
47 virtual Action problem(
48 Resolvable::Ptr resolvable_ptr
50 , TranslatedText description
53 virtual void finish(Resolvable::Ptr resolvable_ptr
55 , TranslatedText reason
60 // progress for downloading a specific file
61 struct DownloadFileReport : public callback::ReportBase
63 virtual void start() {}
64 virtual void progress(int value) {]
65 virtual void finish() {}
68 // progress for refreshing a source data
69 struct RefreshSourceReport : public callback::ReportBase
71 virtual void start() {}
72 virtual void progress(int value) {]
73 virtual void finish() {}
76 // progress for downloading a resolvable
77 struct CreateSourceReport : public callback::ReportBase
79 virtual void start() {}
80 virtual void progress(int value) {]
81 virtual void finish() {}
84 // progress for downloading a resolvable
85 struct RefreshSourceReport : public callback::ReportBase
87 virtual void start() {}
88 virtual void progress(int value) {]
89 virtual void finish() {}
92 /////////////////////////////////////////////////////////////////
94 ///////////////////////////////////////////////////////////////////
96 ///////////////////////////////////////////////////////////////////
100 // media change request callback
101 struct MediaChangeReport : public callback::ReportBase
104 ABORT, // abort and return error
108 virtual Action userAction() { return ABORT; }
111 /////////////////////////////////////////////////////////////////
113 ///////////////////////////////////////////////////////////////////
115 ///////////////////////////////////////////////////////////////////
117 { ///////////////////////////////////////////////////////////////////
121 // progress for installing a resolvable
122 struct InstallResolvableReport : public callback::ReportBase
125 ABORT, // abort and return error
130 virtual void start() {}
131 virtual void progress(int value) {]
132 virtual Action error () { return ABORT; }
133 virtual void finish() {}
136 // progress for removing a resolvable
137 struct RemoveResolvableReport : public callback::ReportBase
140 ABORT, // abort and return error
145 virtual void start() {}
146 virtual void progress(int value) {]
147 virtual Action error () { return ABORT; }
148 virtual void finish() {}
151 // progress for rebuilding the database
152 struct RebuildDBReport : public callback::ReportBase
154 virtual void start() {}
155 virtual void progress(int value) {]
156 virtual void finish() {}
159 // progress for converting the database
160 struct ConvertDBReport : public callback::ReportBase
162 virtual void start() {}
163 virtual void progress(int value) {]
164 virtual void finish() {}
167 /////////////////////////////////////////////////////////////////
169 ///////////////////////////////////////////////////////////////////
171 /////////////////////////////////////////////////////////////////
172 } // namespace target
173 ///////////////////////////////////////////////////////////////////
175 /////////////////////////////////////////////////////////////////
177 ///////////////////////////////////////////////////////////////////
179 #endif // ZYPP_ZYPPCALLBACKS_H