e92012680ac688455c64d51894bb52fa994abab9
[platform/upstream/libzypp.git] / zypp / ZYppCallbacks.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ZYppCallbacks.h
10  *
11 */
12 #ifndef ZYPP_ZYPPCALLBACKS_H
13 #define ZYPP_ZYPPCALLBACKS_H
14
15 #include "zypp/base/Gettext.h"
16 #include "zypp/base/EnumClass.h"
17 #include "zypp/Callback.h"
18 #include "zypp/UserData.h"
19 #include "zypp/Resolvable.h"
20 #include "zypp/RepoInfo.h"
21 #include "zypp/Pathname.h"
22 #include "zypp/Package.h"
23 #include "zypp/Patch.h"
24 #include "zypp/Url.h"
25 #include "zypp/ProgressData.h"
26 #include "zypp/media/MediaUserAuth.h"
27
28 ///////////////////////////////////////////////////////////////////
29 namespace zypp
30 { /////////////////////////////////////////////////////////////////
31
32   ///////////////////////////////////////////////////////////////////
33   namespace sat
34   {
35     class Queue;
36     class FileConflicts;
37   } // namespace sat
38   ///////////////////////////////////////////////////////////////////
39
40   struct ProgressReport : public callback::ReportBase
41   {
42     virtual void start( const ProgressData &/*task*/ )
43     {}
44
45     virtual bool progress( const ProgressData &/*task*/ )
46     { return true; }
47
48 //     virtual Action problem(
49 //         Repo /*source*/
50 //         , Error /*error*/
51 //         , const std::string &/*description*/ )
52 //     { return ABORT; }
53
54     virtual void finish( const ProgressData &/*task*/ )
55     {}
56
57   };
58
59   struct ProgressReportAdaptor
60   {
61
62     ProgressReportAdaptor( const ProgressData::ReceiverFnc &fnc,
63                            callback::SendReport<ProgressReport> &report )
64       : _fnc(fnc)
65       , _report(report)
66       , _first(true)
67     {
68     }
69
70     bool operator()( const ProgressData &progress )
71     {
72       if ( _first )
73       {
74         _report->start(progress);
75         _first = false;
76       }
77
78       bool value = _report->progress(progress);
79       if ( _fnc )
80         value &= _fnc(progress);
81
82       if ( progress.finalReport() )
83       {
84         _report->finish(progress);
85       }
86       return value;
87     }
88
89     ProgressData::ReceiverFnc _fnc;
90     callback::SendReport<ProgressReport> &_report;
91     bool _first;
92   };
93
94   ////////////////////////////////////////////////////////////////////////////
95
96   namespace repo
97   {
98     // progress for downloading a resolvable
99     struct DownloadResolvableReport : public callback::ReportBase
100     {
101       enum Action {
102         ABORT,  // abort and return error
103         RETRY,  // retry
104         IGNORE, // ignore this resolvable but continue
105       };
106
107       enum Error {
108         NO_ERROR,
109         NOT_FOUND,      // the requested Url was not found
110         IO,             // IO error
111         INVALID         // the downloaded file is invalid
112       };
113
114       /** Hint that package is available in the local cache (no download needed).
115        * This will be the only trigger for an already cached package.
116        */
117       virtual void infoInCache( Resolvable::constPtr res_r, const Pathname & localfile_r )
118       {}
119
120       virtual void start(
121         Resolvable::constPtr /*resolvable_ptr*/
122         , const Url &/*url*/
123       ) {}
124
125
126       // Dowmload delta rpm:
127       // - path below url reported on start()
128       // - expected download size (0 if unknown)
129       // - download is interruptable
130       // - problems are just informal
131       virtual void startDeltaDownload( const Pathname & /*filename*/, const ByteCount & /*downloadsize*/ )
132       {}
133
134       virtual bool progressDeltaDownload( int /*value*/ )
135       { return true; }
136
137       virtual void problemDeltaDownload( const std::string &/*description*/ )
138       {}
139
140       virtual void finishDeltaDownload()
141       {}
142
143       // Apply delta rpm:
144       // - local path of downloaded delta
145       // - aplpy is not interruptable
146       // - problems are just informal
147       virtual void startDeltaApply( const Pathname & /*filename*/ )
148       {}
149
150       virtual void progressDeltaApply( int /*value*/ )
151       {}
152
153       virtual void problemDeltaApply( const std::string &/*description*/ )
154       {}
155
156       virtual void finishDeltaApply()
157       {}
158
159       // return false if the download should be aborted right now
160       virtual bool progress(int /*value*/, Resolvable::constPtr /*resolvable_ptr*/)
161       { return true; }
162
163       virtual Action problem(
164         Resolvable::constPtr /*resolvable_ptr*/
165         , Error /*error*/
166         , const std::string &/*description*/
167       ) { return ABORT; }
168
169
170       /** Detail information about the result of a performed pkgGpgCheck.
171        *
172        * Userdata sent:
173        * \param "ResObject"     ResObject::constPtr of the downloaded package (Package or SrcPackage)
174        * \param "Localpath"     Pathname to downloaded package on disk
175        * \param "CheckPackageResult"    RpmDb::CheckPackageResult of signature check
176        * \param "CheckPackageDetail"    RpmDb::CheckPackageDetail logmessages of rpm signature check
177        *
178        *  Userdata accepted:
179        * \param "Action"        DownloadResolvableReport::Action user advice how to behave on error (ABORT).
180        *                        If you set just an empty value here, a default probelm report will be triggered.
181        *
182        * Legacy data:
183        * \param "Package"       Replaced by \c "ResObject" in 16.10.0. Package::constPtr of the package (\c nullptr in case of a SrcPackage)
184        */
185       virtual void pkgGpgCheck( const UserData & userData_r = UserData() )
186       {}
187
188       virtual void finish(Resolvable::constPtr /*resolvable_ptr*/
189         , Error /*error*/
190         , const std::string &/*reason*/
191       ) {}
192     };
193
194     // progress for probing a source
195     struct ProbeRepoReport : public callback::ReportBase
196     {
197       enum Action {
198         ABORT,  // abort and return error
199         RETRY   // retry
200       };
201
202       enum Error {
203         NO_ERROR,
204         NOT_FOUND,      // the requested Url was not found
205         IO,             // IO error
206         INVALID,                // th source is invalid
207         UNKNOWN
208       };
209
210       virtual void start(const Url &/*url*/) {}
211       virtual void failedProbe( const Url &/*url*/, const std::string &/*type*/ ) {}
212       virtual void successProbe( const Url &/*url*/, const std::string &/*type*/ ) {}
213       virtual void finish(const Url &/*url*/, Error /*error*/, const std::string &/*reason*/ ) {}
214
215       virtual bool progress(const Url &/*url*/, int /*value*/)
216       { return true; }
217
218       virtual Action problem( const Url &/*url*/, Error /*error*/, const std::string &/*description*/ ) { return ABORT; }
219     };
220
221     struct RepoCreateReport : public callback::ReportBase
222     {
223       enum Action {
224         ABORT,  // abort and return error
225         RETRY,  // retry
226         IGNORE  // skip refresh, ignore failed refresh
227       };
228
229       enum Error {
230         NO_ERROR,
231         NOT_FOUND,      // the requested Url was not found
232         IO,             // IO error
233         REJECTED,
234         INVALID, // th source is invali
235         UNKNOWN
236       };
237
238       virtual void start( const zypp::Url &/*url*/ ) {}
239       virtual bool progress( int /*value*/ )
240       { return true; }
241
242       virtual Action problem(
243           const zypp::Url &/*url*/
244           , Error /*error*/
245           , const std::string &/*description*/ )
246       { return ABORT; }
247
248       virtual void finish(
249           const zypp::Url &/*url*/
250           , Error /*error*/
251           , const std::string &/*reason*/ )
252       {}
253     };
254
255     struct RepoReport : public callback::ReportBase
256     {
257       enum Action {
258         ABORT,  // abort and return error
259         RETRY,  // retry
260         IGNORE  // skip refresh, ignore failed refresh
261       };
262
263       enum Error {
264         NO_ERROR,
265         NOT_FOUND,      // the requested Url was not found
266         IO,             // IO error
267         INVALID         // th source is invalid
268       };
269
270       virtual void start( const ProgressData &/*task*/, const RepoInfo /*repo*/  ) {}
271       virtual bool progress( const ProgressData &/*task*/ )
272       { return true; }
273
274       virtual Action problem(
275           Repository /*source*/
276           , Error /*error*/
277           , const std::string &/*description*/ )
278       { return ABORT; }
279
280       virtual void finish(
281           Repository /*source*/
282           , const std::string &/*task*/
283           , Error /*error*/
284           , const std::string &/*reason*/ )
285       {}
286     };
287
288
289     /////////////////////////////////////////////////////////////////
290   } // namespace source
291   ///////////////////////////////////////////////////////////////////
292
293   ///////////////////////////////////////////////////////////////////
294   namespace media
295   {
296     // media change request callback
297     struct MediaChangeReport : public callback::ReportBase
298     {
299       enum Action {
300         ABORT,  // abort and return error
301         RETRY,  // retry
302         IGNORE, // ignore this media in future, not available anymore
303         IGNORE_ID,      // ignore wrong medium id
304         CHANGE_URL,     // change media URL
305         EJECT           // eject the medium
306       };
307
308       enum Error {
309         NO_ERROR,
310         NOT_FOUND,  // the medie not found at all
311         IO,     // error accessing the media
312         INVALID, // media is broken
313         WRONG,  // wrong media, need a different one
314         IO_SOFT       /**< IO error which can happen on worse connection like timeout exceed */
315       };
316
317       /**
318        *
319        * \param url         in: url for which the media is requested,
320        *                    out: url to use instead of the original one
321        * \param mediumNr    requested medium number
322        * \param label       label of requested medium
323        * \param error       type of error from \ref Error enum
324        * \param description error message (media not desired or error foo occured)
325        * \param devices     list of the available devices (for eject)
326        * \param dev_current in: index of the currently used device in the \a devices list
327        *                    out: index of the devices to be ejected in the \a devices list
328        * \return \ref Action (ABORT by default)
329        */
330       virtual Action requestMedia(
331         Url & /* url (I/O parameter) */
332         , unsigned /*mediumNr*/
333         , const std::string & /* label */
334         , Error /*error*/
335         , const std::string & /*description*/
336         , const std::vector<std::string> & /* devices */
337         , unsigned int & /* dev_current (I/O param) */
338       ) { return ABORT; }
339     };
340
341     ///////////////////////////////////////////////////////////////////
342     /// \class ScopedDisableMediaChangeReport
343     /// \brief Temporarily disable MediaChangeReport
344     /// Sometimes helpful to suppress interactive messages connected to
345     /// MediaChangeReport while fallback URLs are avaialble.
346     struct ScopedDisableMediaChangeReport
347     {
348       /** Disbale MediaChangeReport if \a condition_r is \c true.*/
349       ScopedDisableMediaChangeReport( bool condition_r = true );
350     private:
351       shared_ptr<callback::TempConnect<media::MediaChangeReport> > _guard;
352     };
353
354     // progress for downloading a file
355     struct DownloadProgressReport : public callback::ReportBase
356     {
357         enum Action {
358           ABORT,  // abort and return error
359           RETRY,        // retry
360           IGNORE        // ignore the failure
361         };
362
363         enum Error {
364           NO_ERROR,
365           NOT_FOUND,    // the requested Url was not found
366           IO,           // IO error
367           ACCESS_DENIED, // user authent. failed while accessing restricted file
368           ERROR // other error
369         };
370
371         virtual void start( const Url &/*file*/, Pathname /*localfile*/ ) {}
372
373         /**
374          * Download progress.
375          *
376          * \param value        Percentage value.
377          * \param file         File URI.
378          * \param dbps_avg     Average download rate so far. -1 if unknown.
379          * \param dbps_current Current download (cca last 1 sec). -1 if unknown.
380          */
381         virtual bool progress(int /*value*/, const Url &/*file*/,
382                               double dbps_avg = -1,
383                               double dbps_current = -1)
384         { return true; }
385
386         virtual Action problem(
387           const Url &/*file*/
388           , Error /*error*/
389           , const std::string &/*description*/
390         ) { return ABORT; }
391
392         virtual void finish(
393           const Url &/*file*/
394           , Error /*error*/
395           , const std::string &/*reason*/
396         ) {}
397     };
398
399     // authentication issues report
400     struct AuthenticationReport : public callback::ReportBase
401     {
402       /**
403        * Prompt for authentication data.
404        *
405        * \param url       URL which required the authentication
406        * \param msg       prompt text
407        * \param auth_data input/output object for handling authentication
408        *        data. As an input parameter auth_data can be prefilled with
409        *        username (from previous try) or auth_type (available
410        *        authentication methods aquired from server (only CurlAuthData)).
411        *        As an output parameter it serves for sending username, pasword
412        *        or other special data (derived AuthData objects).
413        * \return true if user chooses to continue with authentication,
414        *         false otherwise
415        */
416       virtual bool prompt(const Url & /* url */,
417         const std::string & /* msg */,
418         AuthData & /* auth_data */)
419       {
420         return false;
421       }
422     };
423
424     /////////////////////////////////////////////////////////////////
425   } // namespace media
426   ///////////////////////////////////////////////////////////////////
427
428   ///////////////////////////////////////////////////////////////////
429   namespace target
430   {
431     /** Request to display the pre commit message of a patch. */
432     struct PatchMessageReport : public callback::ReportBase
433     {
434       /** Display \c patch->message().
435        * Return \c true to continue, \c false to abort commit.
436       */
437       virtual bool show( Patch::constPtr & /*patch*/ )
438       { return true; }
439     };
440
441     /** Indicate execution of a patch script. This is a sort of
442      * \c %post script shipped by a package and to be executed
443      * after the package was installed.
444     */
445     struct PatchScriptReport : public callback::ReportBase
446     {
447       enum Notify { OUTPUT, PING };
448       enum Action {
449         ABORT,  // abort commit and return error
450         RETRY,  // (re)try to execute this script
451         IGNORE  // ignore any failue and continue
452       };
453
454       /** Start executing the script provided by package.
455       */
456       virtual void start( const Package::constPtr & /*package*/,
457                           const Pathname & /*script path*/ )
458       {}
459       /** Progress provides the script output. If the script is quiet,
460        * from time to time still-alive pings are sent to the ui. Returning \c FALSE
461        * aborts script execution.
462       */
463       virtual bool progress( Notify /*OUTPUT or PING*/,
464                              const std::string & /*output*/ = std::string() )
465       { return true; }
466       /** Report error. */
467       virtual Action problem( const std::string & /*description*/ )
468       { return ABORT; }
469       /** Report success. */
470       virtual void finish()
471       {}
472     };
473
474     ///////////////////////////////////////////////////////////////////
475     /// \class FindFileConflictstReport
476     /// \brief Check for package file conflicts in commit (after download)
477     ///
478     /// File conflict check requires that all packages are downloaded and
479     /// now available in the cache (need to access the filelists). Missing
480     /// packages are omitted from check and their number is reported in
481     /// \a noFilelist_r. This usually happens if download mode 'as-needed'
482     /// is used.
483     ///////////////////////////////////////////////////////////////////
484     struct FindFileConflictstReport : public callback::ReportBase
485     {
486       /**
487        * \param progress_r      Progress counter for packages to check.
488        * \return \c true to continue, \c false upon user abort request.
489        */
490       virtual bool start( const ProgressData & progress_r )
491       { return true; }
492
493       /**
494        * \param progress_r      Progress counter for packages to check.
495        * \param noFilelist_r    Queue of so far skipped solvables (no filelist/not yet downloaded).
496        * \return \c true to continue, \c false upon user abort request.
497        */
498       virtual bool progress( const ProgressData & progress_r, const sat::Queue & noFilelist_r )
499       { return true; }
500
501       /**
502        * \param progress_r      Progress counter for packages to check.
503        * \param noFilelist_r    Queue of skipped solvables (no filelist/not yet downloaded).
504        * \param conflicts_r     File conflits queue.
505        * \return \c true to continue, \c false upon user abort request.
506        */
507       virtual bool result( const ProgressData & progress_r, const sat::Queue & noFilelist_r, const sat::FileConflicts & conflicts_r )
508       { return true; }
509     };
510
511
512     ///////////////////////////////////////////////////////////////////
513     namespace rpm
514     {
515
516       // progress for installing a resolvable
517       struct InstallResolvableReport : public callback::ReportBase
518       {
519         enum Action {
520           ABORT,  // abort and return error
521           RETRY,        // retry
522           IGNORE        // ignore the failure
523         };
524
525         enum Error {
526           NO_ERROR,
527           NOT_FOUND,    // the requested Url was not found
528           IO,           // IO error
529           INVALID               // th resolvable is invalid
530         };
531
532         // the level of RPM pushing
533         /** \deprecated We fortunately no longer do 3 attempts. */
534         enum RpmLevel {
535             RPM,
536             RPM_NODEPS,
537             RPM_NODEPS_FORCE    //!< only this one used
538         };
539
540         virtual void start(
541           Resolvable::constPtr /*resolvable*/
542         ) {}
543
544         virtual bool progress(int /*value*/, Resolvable::constPtr /*resolvable*/)
545         { return true; }
546
547         virtual Action problem(
548           Resolvable::constPtr /*resolvable*/
549           , Error /*error*/
550           , const std::string &/*description*/
551           , RpmLevel /*level*/
552         ) { return ABORT; }
553
554         virtual void finish(
555           Resolvable::constPtr /*resolvable*/
556           , Error /*error*/
557           , const std::string &/*reason*/
558           , RpmLevel /*level*/
559         ) {}
560       };
561
562       // progress for removing a resolvable
563       struct RemoveResolvableReport : public callback::ReportBase
564       {
565         enum Action {
566           ABORT,  // abort and return error
567           RETRY,        // retry
568           IGNORE        // ignore the failure
569         };
570
571         enum Error {
572           NO_ERROR,
573           NOT_FOUND,    // the requested Url was not found
574           IO,           // IO error
575           INVALID               // th resolvable is invalid
576         };
577
578         virtual void start(
579           Resolvable::constPtr /*resolvable*/
580         ) {}
581
582         virtual bool progress(int /*value*/, Resolvable::constPtr /*resolvable*/)
583         { return true; }
584
585         virtual Action problem(
586           Resolvable::constPtr /*resolvable*/
587           , Error /*error*/
588           , const std::string &/*description*/
589         ) { return ABORT; }
590
591         virtual void finish(
592           Resolvable::constPtr /*resolvable*/
593           , Error /*error*/
594           , const std::string &/*reason*/
595         ) {}
596       };
597
598       // progress for rebuilding the database
599       struct RebuildDBReport : public callback::ReportBase
600       {
601         enum Action {
602           ABORT,  // abort and return error
603           RETRY,        // retry
604           IGNORE        // ignore the failure
605         };
606
607         enum Error {
608           NO_ERROR,
609           FAILED                // failed to rebuild
610         };
611
612         virtual void start(Pathname /*path*/) {}
613
614         virtual bool progress(int /*value*/, Pathname /*path*/)
615         { return true; }
616
617         virtual Action problem(
618           Pathname /*path*/
619          , Error /*error*/
620          , const std::string &/*description*/
621         ) { return ABORT; }
622
623         virtual void finish(
624           Pathname /*path*/
625           , Error /*error*/
626           , const std::string &/*reason*/
627         ) {}
628       };
629
630       // progress for converting the database
631       struct ConvertDBReport : public callback::ReportBase
632       {
633         enum Action {
634           ABORT,  // abort and return error
635           RETRY,        // retry
636           IGNORE        // ignore the failure
637         };
638
639         enum Error {
640           NO_ERROR,
641           FAILED                // conversion failed
642         };
643
644         virtual void start(
645           Pathname /*path*/
646         ) {}
647
648         virtual bool progress(int /*value*/, Pathname /*path*/)
649         { return true; }
650
651         virtual Action problem(
652           Pathname /*path*/
653           , Error /*error*/
654          , const std::string &/*description*/
655         ) { return ABORT; }
656
657         virtual void finish(
658           Pathname /*path*/
659           , Error /*error*/
660           , const std::string &/*reason*/
661         ) {}
662       };
663
664       /////////////////////////////////////////////////////////////////
665     } // namespace rpm
666     ///////////////////////////////////////////////////////////////////
667
668     /////////////////////////////////////////////////////////////////
669   } // namespace target
670   ///////////////////////////////////////////////////////////////////
671
672   class PoolQuery;
673
674   /** \name Locks */
675   //@{
676   /**
677    * Callback for cleaning locks which doesn't lock anything in pool.
678    */
679
680   struct CleanEmptyLocksReport : public callback::ReportBase
681   {
682     /**
683      * action performed by cleaning api to specific lock
684      */
685     enum Action {
686       ABORT,  /**< abort and return error */
687       DELETE, /**< delete empty lock    */
688       IGNORE  /**< skip empty lock */
689     };
690
691     /**
692      * result of cleaning
693      */
694     enum Error {
695       NO_ERROR, /**< no problem */
696       ABORTED /** cleaning aborted by user */
697     };
698
699     /**
700      * cleaning is started
701      */
702     virtual void start(
703     ) {}
704
705     /**
706      * progress of cleaning specifies in percents
707      * \return if continue
708      */
709     virtual bool progress(int /*value*/)
710     { return true; }
711
712     /**
713      * When find empty lock ask what to do with it
714      * \return action
715      */
716     virtual Action execute(
717         const PoolQuery& /*error*/
718      ) { return DELETE; }
719
720       /**
721        * cleaning is done
722        */
723      virtual void finish(
724        Error /*error*/
725       ) {}
726
727   };
728
729   /**
730    * this callback handles merging old locks with newly added or removed
731    */
732   struct SavingLocksReport : public callback::ReportBase
733   {
734     /**
735      * action for old lock which is in conflict
736      * \see ConflictState
737      */
738     enum Action {
739       ABORT,  /**< abort and return error*/
740       DELETE, /**< delete conflicted lock    */
741       IGNORE  /**< skip conflict lock */
742     };
743
744     /**
745      * result of merging
746      */
747     enum Error {
748       NO_ERROR, /**< no problem */
749       ABORTED  /**< cleaning aborted by user */
750     };
751
752     /**
753      * type of conflict of old and new lock
754      */
755     enum ConflictState{
756       SAME_RESULTS, /**< locks lock same item in pool but his parameters is different */
757       INTERSECT /**< locks lock some file and unlocking lock unlock only part
758       * of iti, so removing old lock can unlock more items in pool */
759     };
760
761     virtual void start() {}
762
763     /**
764      * merging still live
765      * \return if continue
766      */
767     virtual bool progress()
768     { return true; }
769
770     /**
771      * When user unlock something which is locked by non-identical query
772      */
773     virtual Action conflict(
774          const PoolQuery&, /**< problematic query*/
775        ConflictState
776      ) { return DELETE; }
777
778      virtual void finish(
779        Error /*error*/
780       ) {}
781   };
782
783   ///////////////////////////////////////////////////////////////////
784   /// \class JobReport
785   /// \brief Generic report for sending messages.
786   ///////////////////////////////////////////////////////////////////
787   struct JobReport : public callback::ReportBase
788   {
789   public:
790     /** message type (use like 'enum class \ref MsgType') */
791     struct EMsgTypeDef {
792       enum Enum { debug, info, warning, error, important, data };
793     };
794     typedef base::EnumClass<EMsgTypeDef> MsgType;       ///< 'enum class MsgType'
795
796     /** typsafe map of userdata */
797     typedef callback::UserData UserData;
798
799   public:
800     /** Send a ready to show message text. */
801     virtual bool message( MsgType type_r, const std::string & msg_r, const UserData & userData_r ) const
802     { return true; }
803
804
805     /** \name Static sender instance */
806     //@{
807     /** Singleton sender instance */
808     static callback::SendReport<JobReport> & instance();        // impl in ZYppImpl.cc
809
810     /** send debug message text */
811     static bool debug( const std::string & msg_r, const UserData & userData_r = UserData() )
812     { return instance()->message( MsgType::debug, msg_r, userData_r ); }
813
814     /** send message text */
815     static bool info( const std::string & msg_r, const UserData & userData_r = UserData() )
816     { return instance()->message( MsgType::info, msg_r, userData_r ); }
817
818     /** send warning text */
819     static bool warning( const std::string & msg_r, const UserData & userData_r = UserData() )
820     { return instance()->message( MsgType::warning, msg_r, userData_r ); }
821
822     /** send error text */
823     static bool error( const std::string & msg_r, const UserData & userData_r = UserData() )
824     { return instance()->message( MsgType::error, msg_r, userData_r ); }
825
826     /** send important message text */
827     static bool important( const std::string & msg_r, const UserData & userData_r = UserData() )
828     { return instance()->message( MsgType::important, msg_r, userData_r ); }
829
830     /** send data message */
831     static bool data( const std::string & msg_r, const UserData & userData_r = UserData() )
832     { return instance()->message( MsgType::data, msg_r, userData_r ); }
833     //@}
834   };
835
836
837   /////////////////////////////////////////////////////////////////
838 } // namespace zypp
839 ///////////////////////////////////////////////////////////////////
840
841 #endif // ZYPP_ZYPPCALLBACKS_H