12#ifndef ZYPP_ZYPPCALLBACKS_H
13#define ZYPP_ZYPPCALLBACKS_H
15#include <zypp/base/EnumClass.h>
20#include <zypp/Pathname.h>
24#include <zypp-core/ui/ProgressData>
25#include <zypp-media/auth/AuthData>
26#include <zypp-curl/auth/CurlAuthData>
82 bool value =
_report->progress(progress);
84 value &=
_fnc(progress);
170 ,
const std::string &
194 ,
const std::string &
249 ,
const std::string & )
255 ,
const std::string & )
281 ,
const std::string & )
286 ,
const std::string &
288 ,
const std::string & )
337 ,
const std::string &
339 ,
const std::string &
340 ,
const std::vector<std::string> &
355 shared_ptr<callback::TempConnect<media::MediaChangeReport> >
_guard;
386 double dbps_avg = -1,
387 double dbps_current = -1)
393 ,
const std::string &
399 ,
const std::string &
421 const std::string & ,
468 const std::string & = std::string() )
554 ,
const std::string &
561 ,
const std::string &
600 ,
const std::string &
606 ,
const std::string &
637 ,
const std::string &
643 ,
const std::string &
663 virtual void start( Pathname )
666 virtual bool progress(
int, Pathname )
669 virtual Action problem( Pathname, Error,
const std::string & )
672 virtual void finish( Pathname, Error,
const std::string & )
817 const std::string & ,
849 const std::string & ,
850 const std::string & ,
1023 {
return instance()->message( MsgType::debug, msg_r, userData_r ); }
1027 {
return instance()->message( MsgType::info, msg_r, userData_r ); }
1031 {
return instance()->message( MsgType::warning, msg_r, userData_r ); }
1035 {
return instance()->message( MsgType::error, msg_r, userData_r ); }
1039 {
return instance()->message( MsgType::important, msg_r, userData_r ); }
1043 {
return instance()->message( MsgType::data, msg_r, userData_r ); }
Store and operate with byte count.
Mime type like 'type/subtype' classification of content.
TraitsType::constPtrType constPtr
TraitsType::constPtrType constPtr
Maintain [min,max] and counter (value) for progress counting.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
What is known about a repository.
TraitsType::constPtrType constPtr
Typesafe passing of user data via callbacks.
Libsolv queue representing file conflicts.
Libsolv Id queue wrapper.
Easy-to use interface to the ZYPP dependency resolver.
Callback for cleaning locks which doesn't lock anything in pool.
@ ABORTED
cleaning aborted by user
Action
action performed by cleaning api to specific lock
@ ABORT
abort and return error
@ DELETE
delete empty lock
virtual void start()
cleaning is started
virtual Action execute(const PoolQuery &)
When find empty lock ask what to do with it.
virtual bool progress(int)
progress of cleaning specifies in percents
virtual void finish(Error)
cleaning is done
message type (use like 'enum class MsgType')
Generic report for sending messages.
static bool debug(const std::string &msg_r, const UserData &userData_r=UserData())
send debug message text
base::EnumClass< EMsgTypeDef > MsgType
'enum class MsgType'
static bool warning(const std::string &msg_r, const UserData &userData_r=UserData())
send warning text
static bool error(const std::string &msg_r, const UserData &userData_r=UserData())
send error text
virtual bool message(MsgType type_r, const std::string &msg_r, const UserData &userData_r) const
Send a ready to show message text.
static bool data(const std::string &msg_r, const UserData &userData_r=UserData())
send data message
callback::UserData UserData
typsafe map of userdata
static bool important(const std::string &msg_r, const UserData &userData_r=UserData())
send important message text
static callback::SendReport< JobReport > & instance()
Singleton sender instance.
static bool info(const std::string &msg_r, const UserData &userData_r=UserData())
send message text
ProgressReportAdaptor(callback::SendReport< ProgressReport > &report)
ProgressData::ReceiverFnc _fnc
callback::SendReport< ProgressReport > & _report
ProgressReportAdaptor(const ProgressData::ReceiverFnc &fnc, callback::SendReport< ProgressReport > &report)
bool operator()(const ProgressData &progress)
virtual void start(const ProgressData &)
virtual void finish(const ProgressData &)
virtual bool progress(const ProgressData &)
this callback handles merging old locks with newly added or removed
Action
action for old lock which is in conflict
@ DELETE
delete conflicted lock
@ IGNORE
skip conflict lock
@ ABORT
abort and return error
virtual bool progress()
merging still live
virtual void finish(Error)
ConflictState
type of conflict of old and new lock
@ INTERSECT
locks lock some file and unlocking lock unlock only part of iti, so removing old lock can unlock more...
@ SAME_RESULTS
locks lock same item in pool but its parameters are different
@ ABORTED
cleaning aborted by user
virtual Action conflict(const PoolQuery &, ConflictState)
When user unlock something which is locked by non-identical query.
JobReport convenience sending this instance of UserData with each message.
bool error(const std::string &msg_r)
bool data(const std::string &msg_r)
bool info(const std::string &msg_r)
bool debug(const std::string &msg_r)
bool important(const std::string &msg_r)
bool warning(const std::string &msg_r)
callback::UserData UserData
virtual void pkgGpgCheck(const UserData &userData_r=UserData())
Detail information about the result of a performed pkgGpgCheck.
virtual void problemDeltaApply(const std::string &)
virtual void finish(Resolvable::constPtr, Error, const std::string &)
virtual void startDeltaApply(const Pathname &)
virtual void infoInCache(Resolvable::constPtr res_r, const Pathname &localfile_r)
Hint that package is available in the local cache (no download needed).
virtual Action problem(Resolvable::constPtr, Error, const std::string &)
virtual void problemDeltaDownload(const std::string &)
virtual void startDeltaDownload(const Pathname &, const ByteCount &)
virtual bool progressDeltaDownload(int)
virtual bool progress(int, Resolvable::constPtr)
virtual void finishDeltaDownload()
virtual void finishDeltaApply()
virtual void progressDeltaApply(int)
virtual void start(Resolvable::constPtr, const Url &)
virtual Action problem(const Url &, Error, const std::string &)
virtual void start(const Url &)
virtual void failedProbe(const Url &, const std::string &)
virtual void finish(const Url &, Error, const std::string &)
virtual bool progress(const Url &, int)
virtual void successProbe(const Url &, const std::string &)
virtual void finish(const zypp::Url &, Error, const std::string &)
virtual bool progress(int)
virtual void start(const zypp::Url &)
virtual Action problem(const zypp::Url &, Error, const std::string &)
virtual void start(const ProgressData &, const RepoInfo)
virtual void finish(Repository, const std::string &, Error, const std::string &)
virtual bool progress(const ProgressData &)
virtual Action problem(Repository, Error, const std::string &)
Check for package file conflicts in commit (after download)
virtual bool start(const ProgressData &progress_r)
virtual bool result(const ProgressData &progress_r, const sat::Queue &noFilelist_r, const sat::FileConflicts &conflicts_r)
virtual bool progress(const ProgressData &progress_r, const sat::Queue &noFilelist_r)
Request to display the pre commit message of a patch.
virtual bool show(Patch::constPtr &)
Display patch->message().
Indicate execution of a patch script.
virtual bool progress(Notify, const std::string &=std::string())
Progress provides the script output.
virtual Action problem(const std::string &)
Report error.
virtual void finish()
Report success.
virtual void start(const Package::constPtr &, const Pathname &)
Start executing the script provided by package.
static const UserData::ContentType contentRpmout
"zypp-rpm/cleanupkgsa": Additional rpm output (sent immediately).
virtual void start(const std::string &, const UserData &=UserData())
virtual void progress(int, const UserData &=UserData())
virtual void finish(Error, const UserData &=UserData())
virtual void finish(Resolvable::constPtr, Error, const UserData &=UserData())
virtual void progress(int, Resolvable::constPtr, const UserData &=UserData())
static const UserData::ContentType contentRpmout
"zypp-rpm/scriptsa": Additional rpm output (sent immediately).
virtual void start(const std::string &, const std::string &, Resolvable::constPtr, const UserData &=UserData())
virtual void finish(Resolvable::constPtr, Error, const UserData &=UserData())
static const UserData::ContentType contentRpmout
"zypp-rpm/installpkgsa": Additional rpm output (sent immediately).
virtual void start(Resolvable::constPtr, const UserData &=UserData())
virtual void progress(int, Resolvable::constPtr, const UserData &=UserData())
virtual bool progress(int, Resolvable::constPtr)
virtual Action problem(Resolvable::constPtr, Error, const std::string &, RpmLevel)
virtual void start(Resolvable::constPtr)
virtual void finish(Resolvable::constPtr, Error, const std::string &, RpmLevel)
@ RPM_NODEPS_FORCE
only this one used
static const UserData::ContentType contentRpmout
"rpmout/installpkg": Additional rpm output (sent immediately).
virtual bool progress(int, Pathname)
virtual void finish(Pathname, Error, const std::string &)
virtual void start(Pathname)
virtual Action problem(Pathname, Error, const std::string &)
virtual void finish(Resolvable::constPtr, Error, const UserData &=UserData())
virtual void start(Resolvable::constPtr, const UserData &=UserData())
static const UserData::ContentType contentRpmout
"zypp-rpm/removepkgsa": Additional rpm output (sent immediately).
virtual void progress(int, Resolvable::constPtr, const UserData &=UserData())
virtual void start(Resolvable::constPtr)
virtual Action problem(Resolvable::constPtr, Error, const std::string &)
static const UserData::ContentType contentRpmout
"rpmout/removepkg": Additional rpm output (sent immediately).
virtual void finish(Resolvable::constPtr, Error, const std::string &)
virtual bool progress(int, Resolvable::constPtr)
Report active throughout the whole rpm transaction.
static const UserData::ContentType contentLogline
"zypp-rpm/logline" report a line suitable to be written to the screen.
static const char *const loglevelPrefix(loglevel level_r)
Suggested prefix for log-lines to show.
loglevel
Rendering hint for log-lines to show.
virtual void progress(int, const UserData &=UserData())
static const UserData::ContentType contentRpmout
"zypp-rpm/transactionsa": Additional rpm output (sent immediately).
virtual void finish(Error, const UserData &=UserData())
virtual void start(const std::string &, const UserData &=UserData())
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3....