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