Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

InstSrcManagerCallbacks.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013   File:       InstSrcManagerCallbacks.h
00014 
00015   Author:     Michael Andres <ma@suse.de>
00016   Maintainer: Michael Andres <ma@suse.de>
00017 
00018   Purpose: Callbacks triggered by InstSrcManager
00019 
00020 /-*/
00021 #ifndef InstSrcManagerCallbacks_h
00022 #define InstSrcManagerCallbacks_h
00023 
00024 #include <iosfwd>
00025 
00026 #include <y2util/Url.h>
00027 
00028 #include <y2pm/PMCallbacks.h>
00029 #include <y2pm/InstSrcPtr.h>
00030 #include <y2pm/InstSrcDescrPtr.h>
00031 
00033 namespace InstSrcManagerCallbacks {
00035 
00037   // Reporting need to change media
00039   struct MediaChangeCallback : public RedirectCallback<MediaChangeCallback> {
00043     virtual bool isSet() = 0;
00051     virtual std::string changeMedia( constInstSrcDescrPtr descr,
00052                                      const Url & currentUrl,
00053                                      int expectedMedianr,
00054                                      PMError error ) = 0;
00055 
00067     virtual std::string changeMedia( const std::string & error,
00068                                      const std::string & url,
00069                                      const std::string & product,
00070                                      int current,
00071                                      const std::string & currentLabel,
00072                                      int expected,
00073                                      const std::string & expectedLabel,
00074                                      bool doublesided ) = 0;
00075   };
00076 
00077   class MediaChangeReport : public Report<MediaChangeCallback> {
00078     virtual bool isSet() {
00079       return MediaChangeCallback::isSet();
00080     }
00081     virtual std::string changeMedia( constInstSrcDescrPtr descr,
00082                                      const Url & currentUrl,
00083                                      int expectedMedianr,
00084                                      PMError error ) {
00085       return MediaChangeCallback::changeMedia( descr, currentUrl,
00086                                                expectedMedianr, error );
00087     }
00091     virtual std::string changeMedia( const std::string & error,
00092                                      const std::string & url,
00093                                      const std::string & product,
00094                                      int current,
00095                                      const std::string & currentLabel,
00096                                      int expected,
00097                                      const std::string & expectedLabel,
00098                                      bool doublesided ) {
00099       return MediaChangeCallback::changeMedia( error, url, product,
00100                                                current, currentLabel,
00101                                                expected, expectedLabel,
00102                                                doublesided );
00103     }
00104   };
00105 
00106   extern MediaChangeReport mediaChangeReport;
00107 
00108 #if 0
00109 
00110   // Reporting @
00112   struct @Callback : public RedirectCallback<@Callback> {
00113     virtual void start() = 0;
00114     virtual void progress( const ProgressData & prg ) = 0;
00115     virtual void stop( PMError error ) = 0;
00116   };
00117 
00118   class @Report : public Report<@Callback> {
00119     virtual void start() {
00120       @Callback::start();
00121     }
00122     virtual void progress( const ProgressData & prg ) {
00123       @Callback::progress( prg );
00124     }
00125     virtual void stop( PMError error ) {
00126       @Callback::stop( error );
00127     }
00128   };
00129 
00130   extern @Report @Report;
00131 #endif
00132 
00134 } // namespace InstSrcManagerCallbacks
00136 
00137 #endif // InstSrcManagerCallbacks_h

Generated on Mon Mar 21 22:08:00 2005 for yast2-packagemanager by  doxygen 1.4.1