2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GIOMM_FILEMONITOR_H
4 #define _GIOMM_FILEMONITOR_H
9 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
11 /* Copyright (C) 2007 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 //#include <giomm/file.h>
29 #include <glibmm/object.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GFileMonitor GFileMonitor;
34 typedef struct _GFileMonitorClass GFileMonitorClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class FileMonitor_Class; } // namespace Gio
43 /** @addtogroup giommEnums Enums and Flags */
50 FILE_MONITOR_EVENT_CHANGED,
51 FILE_MONITOR_EVENT_CHANGES_DONE_HINT,
52 FILE_MONITOR_EVENT_DELETED,
53 FILE_MONITOR_EVENT_CREATED,
54 FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED,
55 FILE_MONITOR_EVENT_PRE_UNMOUNT,
56 FILE_MONITOR_EVENT_UNMOUNTED
62 /** Monitors a file or directory for changes.
63 * To obtain a FileMonitor for a file or directory, use File::monitor_file() or
64 * File::monitor_directory().
66 * To get informed about changes to the file or directory you are monitoring,
67 * connect to signal_changed.
72 class FileMonitor : public Glib::Object
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78 typedef FileMonitor CppObjectType;
79 typedef FileMonitor_Class CppClassType;
80 typedef GFileMonitor BaseObjectType;
81 typedef GFileMonitorClass BaseClassType;
83 private: friend class FileMonitor_Class;
84 static CppClassType filemonitor_class_;
88 FileMonitor(const FileMonitor&);
89 FileMonitor& operator=(const FileMonitor&);
92 explicit FileMonitor(const Glib::ConstructParams& construct_params);
93 explicit FileMonitor(GFileMonitor* castitem);
95 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
98 virtual ~FileMonitor();
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
101 static GType get_type() G_GNUC_CONST;
102 static GType get_base_type() G_GNUC_CONST;
105 ///Provides access to the underlying C GObject.
106 GFileMonitor* gobj() { return reinterpret_cast<GFileMonitor*>(gobject_); }
108 ///Provides access to the underlying C GObject.
109 const GFileMonitor* gobj() const { return reinterpret_cast<GFileMonitor*>(gobject_); }
111 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
112 GFileMonitor* gobj_copy();
121 /** Cancels a file monitor.
122 * @return <tt>true</tt> if monitor was cancelled.
126 /** Returns: <tt>true</tt> if monitor is canceled. <tt>false</tt> otherwise.
127 * @return <tt>true</tt> if monitor is canceled. <tt>false</tt> otherwise.
129 bool is_cancelled() const;
131 /** Sets the rate limit to which the @a monitor will report
132 * consecutive change events to the same file.
133 * @param limit_msecs A integer with the limit in milliseconds to
136 void set_rate_limit(int limit_msecs);
138 //g_file_monitor_emit_event is for implementations.
143 * <tt>void on_my_%changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type)</tt>
146 Glib::SignalProxy3< void,const Glib::RefPtr<File>&,const Glib::RefPtr<File>&,FileMonitorEvent > signal_changed();
149 //_WRAP_VFUNC(bool cancel(), cancel);
151 #ifdef GLIBMM_PROPERTIES_ENABLED
152 /** The limit of the monitor to watch for changes
154 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
155 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
156 * the value of the property changes.
158 Glib::PropertyProxy<int> property_rate_limit() ;
159 #endif //#GLIBMM_PROPERTIES_ENABLED
161 #ifdef GLIBMM_PROPERTIES_ENABLED
162 /** The limit of the monitor to watch for changes
164 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
165 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
166 * the value of the property changes.
168 Glib::PropertyProxy_ReadOnly<int> property_rate_limit() const;
169 #endif //#GLIBMM_PROPERTIES_ENABLED
171 #ifdef GLIBMM_PROPERTIES_ENABLED
172 /** Whether the monitor has been cancelled.
174 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
175 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
176 * the value of the property changes.
178 Glib::PropertyProxy_ReadOnly<bool> property_cancelled() const;
179 #endif //#GLIBMM_PROPERTIES_ENABLED
185 //C++ methods used to invoke GTK+ virtual functions:
186 #ifdef GLIBMM_VFUNCS_ENABLED
187 #endif //GLIBMM_VFUNCS_ENABLED
190 //GTK+ Virtual Functions (override these to change behaviour):
191 #ifdef GLIBMM_VFUNCS_ENABLED
192 #endif //GLIBMM_VFUNCS_ENABLED
194 //Default Signal Handlers::
195 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
196 virtual void on_changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type);
197 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
207 /** A Glib::wrap() method for this object.
209 * @param object The C instance.
210 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
211 * @result A C++ instance that wraps this C instance.
213 * @relates Gio::FileMonitor
215 Glib::RefPtr<Gio::FileMonitor> wrap(GFileMonitor* object, bool take_copy = false);
219 #endif /* _GIOMM_FILEMONITOR_H */