00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _MEDIANOTIFIER_H_
00021 #define _MEDIANOTIFIER_H_
00022
00023 #include <kdedmodule.h>
00024 #include <kfileitem.h>
00025 #include <kio/job.h>
00026 #include <kmessagebox.h>
00027
00028 #include <tqstring.h>
00029 #include <tqmap.h>
00030
00031 class KDialogBase;
00032
00033 class MediaNotifier: public KDEDModule
00034 {
00035 Q_OBJECT
00036 K_DCOP
00037
00038 public:
00039 MediaNotifier( const TQCString &name );
00040 virtual ~MediaNotifier();
00041
00042 k_dcop:
00043 void onMediumChange( const TQString &name, bool allowNotification );
00044
00045 private slots:
00046 void slotStatResult( KIO::Job *job );
00047 void checkFreeDiskSpace();
00048 void slotFreeFinished( KMessageBox::ButtonCode );
00049 void slotFreeContinue();
00050 void slotFreeCancel();
00051
00052 private:
00053 bool autostart( const KFileItem &medium );
00054 void notify( KFileItem &medium );
00055
00056 bool execAutorun( const KFileItem &medium, const TQString &path,
00057 const TQString &autorunFile );
00058 bool execAutoopen( const KFileItem &medium, const TQString &path,
00059 const TQString &autoopenFile );
00060
00061 TQMap<KIO::Job*,bool> m_allowNotificationMap;
00062 TQTimer * m_freeTimer;
00063 KDialogBase * m_freeDialog;
00064 };
00065 #endif
00066