Main Page | Namespace List | Class Hierarchy | Class List | 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 <y2pm/PMCallbacks.h>
00027 #include <y2pm/InstSrcPtr.h>
00028 
00030 namespace InstSrcManagerCallbacks {
00032 
00034   // Reporting need to change media
00036   struct MediaChangeCallback : public RedirectCallback<MediaChangeCallback> {
00040     virtual bool isSet() = 0;
00049     virtual std::string changeMedia( const std::string & error,
00050                                      const std::string & url,
00051                                      const std::string & product,
00052                                      int current,
00053                                      const std::string & currentLabel,
00054                                      int expected,
00055                                      const std::string & expectedLabel,
00056                                      bool doublesided ) = 0;
00057   };
00058 
00059   class MediaChangeReport : public Report<MediaChangeCallback> {
00060     virtual bool isSet() {
00061       return MediaChangeCallback::isSet();
00062     }
00063     virtual std::string changeMedia( const std::string & error,
00064                                      const std::string & url,
00065                                      const std::string & product,
00066                                      int current,
00067                                      const std::string & currentLabel,
00068                                      int expected,
00069                                      const std::string & expectedLabel,
00070                                      bool doublesided ) {
00071       return MediaChangeCallback::changeMedia( error, url, product,
00072                                                current, currentLabel,
00073                                                expected, expectedLabel,
00074                                                doublesided );
00075     }
00076   };
00077 
00078   extern MediaChangeReport mediaChangeReport;
00079 
00080 #if 0
00081 
00082   // Reporting @
00084   struct @Callback : public RedirectCallback<@Callback> {
00085     virtual void start() = 0;
00086     virtual void progress( const ProgressData & prg ) = 0;
00087     virtual void stop( PMError error ) = 0;
00088   };
00089 
00090   class @Report : public Report<@Callback> {
00091     virtual void start() {
00092       @Callback::start();
00093     }
00094     virtual void progress( const ProgressData & prg ) {
00095       @Callback::progress( prg );
00096     }
00097     virtual void stop( PMError error ) {
00098       @Callback::stop( error );
00099     }
00100   };
00101 
00102   extern @Report @Report;
00103 #endif
00104 
00106 } // namespace InstSrcManagerCallbacks
00108 
00109 #endif // InstSrcManagerCallbacks_h

Generated on Fri Nov 9 14:30:31 2007 for yast2-packagemanager by doxygen 1.3.6