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