Imported Upstream version 17.20.0
[platform/upstream/libzypp.git] / zypp / ZYppCallbacks.h
index aeae8df..b475539 100644 (file)
@@ -74,11 +74,9 @@ namespace zypp
         _first = false;
       }
 
-      _report->progress(progress);
-      bool value = true;
+      bool value = _report->progress(progress);
       if ( _fnc )
-        value = _fnc(progress);
-
+        value &= _fnc(progress);
 
       if ( progress.finalReport() )
       {
@@ -157,23 +155,6 @@ namespace zypp
       virtual void finishDeltaApply()
       {}
 
-      /** \deprecated Unused since 2008 */
-      virtual ZYPP_DEPRECATED void startPatchDownload( const Pathname & /*filename*/, const ByteCount & /*downloadsize*/ )
-      {}
-
-      /** \deprecated Unused since 2008 */
-      virtual ZYPP_DEPRECATED bool progressPatchDownload( int /*value*/ )
-      { return true; }
-
-      /** \deprecated Unused since 2008 */
-      virtual ZYPP_DEPRECATED void problemPatchDownload( const std::string &/*description*/ )
-      {}
-
-      /** \deprecated Unused since 2008 */
-      virtual ZYPP_DEPRECATED void finishPatchDownload()
-      {}
-
-
       // return false if the download should be aborted right now
       virtual bool progress(int /*value*/, Resolvable::constPtr /*resolvable_ptr*/)
       { return true; }
@@ -645,40 +626,35 @@ namespace zypp
         ) {}
       };
 
+#if LEGACY(17)
       // progress for converting the database
-      struct ConvertDBReport : public callback::ReportBase
+      /// \deprecated Still used by y2-bindings in Code15 (libyzpp major 17)
+      struct ZYPP_DEPRECATED ConvertDBReport : public callback::ReportBase
       {
         enum Action {
           ABORT,  // abort and return error
-          RETRY,       // retry
-         IGNORE        // ignore the failure
+          RETRY,  // retry
+         IGNORE  // ignore the failure
         };
 
         enum Error {
          NO_ERROR,
-         FAILED                // conversion failed
+         FAILED // conversion failed
         };
 
-        virtual void start(
-         Pathname /*path*/
-        ) {}
+        virtual void start( Pathname /*path*/ )
+       {}
 
-        virtual bool progress(int /*value*/, Pathname /*path*/)
+        virtual bool progress( int/*value*/, Pathname/*path*/ )
         { return true; }
 
-        virtual Action problem(
-         Pathname /*path*/
-         , Error /*error*/
-        , const std::string &/*description*/
-        ) { return ABORT; }
+        virtual Action problem( Pathname/*path*/, Error/*error*/, const std::string &/*description*/ )
+       { return ABORT; }
 
-        virtual void finish(
-         Pathname /*path*/
-          , Error /*error*/
-          , const std::string &/*reason*/
-        ) {}
+        virtual void finish( Pathname/*path*/, Error/*error*/, const std::string &/*reason*/ )
+       {}
       };
-
+#endif
       /////////////////////////////////////////////////////////////////
     } // namespace rpm
     ///////////////////////////////////////////////////////////////////
@@ -806,10 +782,10 @@ namespace zypp
   {
   public:
     /** message type (use like 'enum class \ref MsgType') */
-    struct _MsgTypeDef {
+    struct EMsgTypeDef {
       enum Enum { debug, info, warning, error, important, data };
     };
-    typedef base::EnumClass<_MsgTypeDef> MsgType;      ///< 'enum class MsgType'
+    typedef base::EnumClass<EMsgTypeDef> MsgType;      ///< 'enum class MsgType'
 
     /** typsafe map of userdata */
     typedef callback::UserData UserData;
@@ -826,27 +802,27 @@ namespace zypp
     static callback::SendReport<JobReport> & instance();       // impl in ZYppImpl.cc
 
     /** send debug message text */
-    static bool debug( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool debug( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::debug, msg_r, userData_r ); }
 
     /** send message text */
-    static bool info( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool info( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::info, msg_r, userData_r ); }
 
     /** send warning text */
-    static bool warning( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool warning( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::warning, msg_r, userData_r ); }
 
     /** send error text */
-    static bool error( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool error( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::error, msg_r, userData_r ); }
 
     /** send important message text */
-    static bool important( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool important( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::important, msg_r, userData_r ); }
 
     /** send data message */
-    static bool data( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool data( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::data, msg_r, userData_r ); }
     //@}
   };