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