1 #ifndef __creaImageIOListener_h_INCLUDED__
2 #define __creaImageIOListener_h_INCLUDED__
4 #include <creaImageIOSystem.h>
8 // Signal/slot mechanism
9 #include <boost/signal.hpp>
10 #include <boost/bind.hpp>
15 class Listener : public wxThread
22 ///Thread method that is executed once create is called
24 ///Thread method called upon exiting
26 ///Sets the new state of adding files
27 void SetAddFilesState(bool addFiles){wxMutexLocker lock(mMutex);mAddFiles=addFiles;}
28 ///Sets the new state of removing files
29 void SetRemoveFilesState(bool removeFiles){wxMutexLocker lock(mMutex);mRemoveFiles=removeFiles;}
30 ///Sets the new monitored drive
31 void SetMonitoredDrive(const std::string& dr){wxMutexLocker lock(mMutex);mDrive=dr;}
32 ///Puts the name of the monitored drive in the given string
33 void GetMonitoredDrive(std::string& drive){drive=mDrive;}
35 ///Related with signals
36 //=============================================
37 typedef boost::signal<void (bool)> MountingSignalType;
38 typedef MountingSignalType::slot_function_type MountingCallbackType;
39 //=============================================
41 //==================================================================
42 void ConnectObserver(MountingCallbackType callback);
43 //==================================================================
45 ///Sends a boost::signal to alert that the drive has changed its state (mounted/unmounted)
46 void SendSignal(bool ivalid);
52 /// Boolean that declares if the files that are read on CD mount should be added
54 /// Boolean that declares if, on CD unmount, the files that were in the drive should be removed
56 ///Boolean that declares if a unit has been mounted
58 ///The monitored drive
60 ///The validation signal
61 MountingSignalType mMountingSignal;