4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
11 * FileMonitor monitors a file and informs a listener when that file has
18 // TODO: Remove FileMonitor
19 #include "support/FileMonitor2.h"
21 #include <boost/signals2.hpp>
31 /** Once monitoring begins, the file will be monitored every
34 * This is now obsoleted by FileMonitor2 based on QFileSystemWatcher.
35 * FIXME: Remove FileMonitor
37 FileMonitor(FileName const & file_with_path, int interval);
43 void reset(FileName const & file_with_path) const;
46 FileName const & filename() const;
48 /// Begin monitoring the file
53 bool monitoring() const;
55 /** The checksum is recomputed whenever the file is modified.
56 * If the file is not being monitored, then the checksum will be
57 * recomputed each time this function is called.
59 unsigned long checksum() const;
61 /// Connect and you'll be informed when the file has changed.
62 typedef boost::signals2::signal<void()> FileChangedSig;
63 typedef FileChangedSig::slot_type slot_type;
65 boost::signals2::connection connect(slot_type const &) const;
69 FileMonitor(FileMonitor const &);
70 void operator=(FileMonitor const &);
72 /// Use the Pimpl idiom to hide the internals.
74 /// The pointer never changes although *pimpl_'s contents may.
78 } // namespace support
81 #endif // FILEMONITOR_H