00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: MediaCD.h 00014 00015 Author: Klaus Kaempf <kkaempf@suse.de> 00016 Maintainer: Klaus Kaempf <kkaempf@suse.de> 00017 00018 Purpose: Implementation class for CD/DVD MediaHandler 00019 00020 /-*/ 00021 #ifndef MediaCD_h 00022 #define MediaCD_h 00023 00024 #include <y2pm/MediaHandler.h> 00025 00027 // 00028 // CLASS NAME : MediaCD 00033 class MediaCD : public MediaHandler { 00034 00035 private: 00036 00037 unsigned long _mountflags; 00038 00039 typedef std::list<std::string> DeviceList; 00041 DeviceList _devices; 00042 00044 std::string _mounteddevice; 00045 00047 int _lastdev; 00048 00049 static bool openTray( const std::string & device_r ); 00050 static bool closeTray( const std::string & device_r ); 00051 00052 protected: 00053 00054 MEDIA_HANDLER_API; 00055 00056 virtual void forceEject(); 00057 00058 public: 00059 00060 MediaCD( const Url & url_r, 00061 const Pathname & attach_point_hint_r ); 00062 00063 virtual ~MediaCD() { release(); } 00064 }; 00065 00067 00068 #endif // MediaCD_h