1/* Copyright (C) 2007 The gtkmm Development Team 2 * 3 * This library is free software; you can redistribute it and/or 4 * modify it under the terms of the GNU Lesser General Public 5 * License as published by the Free Software Foundation; either 6 * version 2.1 of the License, or (at your option) any later version. 7 * 8 * This library is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public 14 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17_CONFIGINCLUDE(giommconfig.h) 18 19//#include <giomm/file.h> 20#include <glibmm/object.h> 21 22_DEFS(giomm,gio) 23_PINCLUDE(glibmm/private/object_p.h) 24_PINCLUDE(gio/gio.h) 25 26namespace Gio 27{ 28 29_WRAP_ENUM(FileMonitorEvent, GFileMonitorEvent, NO_GTYPE) 30 31class GIOMM_API File; 32 33/** Monitors a file or directory for changes. 34 * To obtain a FileMonitor for a file or directory, use File::monitor_file() or 35 * File::monitor_directory(). 36 * 37 * To get informed about changes to the file or directory you are monitoring, 38 * connect to signal_changed(). 39 * 40 * @newin{2,16} 41 */ 42class GIOMM_API FileMonitor : public Glib::Object 43{ 44 _CLASS_GOBJECT(FileMonitor, GFileMonitor, G_FILE_MONITOR, Glib::Object, GObject, , , GIOMM_API) 45protected: 46 47public: 48 49 _WRAP_METHOD(bool cancel(), g_file_monitor_cancel) 50 _WRAP_METHOD(bool is_cancelled() const, g_file_monitor_is_cancelled) 51 _WRAP_METHOD(void set_rate_limit(int limit_msecs), g_file_monitor_set_rate_limit) 52 53 //g_file_monitor_emit_event is for implementations. 54 _IGNORE(g_file_monitor_emit_event) 55 56#m4 _CONVERSION(`GFile*',`const Glib::RefPtr<File>&',`Glib::wrap($3, true)') 57 _WRAP_SIGNAL(void changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type), "changed") 58 59 //_WRAP_VFUNC(bool cancel(), cancel); 60 61 _WRAP_PROPERTY("rate-limit", int) 62 _WRAP_PROPERTY("cancelled", bool) 63}; 64 65} // namespace Gio 66 67