Fix crash on startup if an LV2 plugin has a bad .ttl file.
[ardour.git] / libs / glibmm2 / gio / giomm / filemonitor.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GIOMM_FILEMONITOR_H
4 #define _GIOMM_FILEMONITOR_H
5
6
7 #include <glibmm.h>
8
9 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
10
11 /* Copyright (C) 2007 The gtkmm Development Team
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 //#include <giomm/file.h>
29 #include <glibmm/object.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GFileMonitor GFileMonitor;
34 typedef struct _GFileMonitorClass GFileMonitorClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gio
39 { class FileMonitor_Class; } // namespace Gio
40 namespace Gio
41 {
42
43 /** @addtogroup giommEnums Enums and Flags */
44
45 /**
46  * @ingroup giommEnums
47  */
48 enum FileMonitorEvent
49 {
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
57 };
58
59
60 class File;
61
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().
65  * 
66  * To get informed about changes to the file or directory you are monitoring, 
67  * connect to signal_changed.
68  *
69  * @newin2p16
70  */
71
72 class FileMonitor : public Glib::Object
73 {
74   
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76
77 public:
78   typedef FileMonitor CppObjectType;
79   typedef FileMonitor_Class CppClassType;
80   typedef GFileMonitor BaseObjectType;
81   typedef GFileMonitorClass BaseClassType;
82
83 private:  friend class FileMonitor_Class;
84   static CppClassType filemonitor_class_;
85
86 private:
87   // noncopyable
88   FileMonitor(const FileMonitor&);
89   FileMonitor& operator=(const FileMonitor&);
90
91 protected:
92   explicit FileMonitor(const Glib::ConstructParams& construct_params);
93   explicit FileMonitor(GFileMonitor* castitem);
94
95 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
96
97 public:
98   virtual ~FileMonitor();
99
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
101   static GType get_type()      G_GNUC_CONST;
102   static GType get_base_type() G_GNUC_CONST;
103 #endif
104
105   ///Provides access to the underlying C GObject.
106   GFileMonitor*       gobj()       { return reinterpret_cast<GFileMonitor*>(gobject_); }
107
108   ///Provides access to the underlying C GObject.
109   const GFileMonitor* gobj() const { return reinterpret_cast<GFileMonitor*>(gobject_); }
110
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();
113
114 private:
115
116 protected:
117
118 public:
119   
120   
121   /** Cancels a file monitor.
122    * @return <tt>true</tt> if monitor was cancelled.
123    */
124   bool cancel();
125   
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.
128    */
129   bool is_cancelled() const;
130   
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 
134    * poll for changes.
135    */
136   void set_rate_limit(int limit_msecs);
137
138   //g_file_monitor_emit_event is for implementations.
139   
140
141   /**
142    * @par Prototype:
143    * <tt>void on_my_%changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type)</tt>
144    */
145
146   Glib::SignalProxy3< void,const Glib::RefPtr<File>&,const Glib::RefPtr<File>&,FileMonitorEvent > signal_changed();
147
148   
149   //_WRAP_VFUNC(bool cancel(), cancel);
150
151   #ifdef GLIBMM_PROPERTIES_ENABLED
152 /** The limit of the monitor to watch for changes
153    *
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.
157    */
158   Glib::PropertyProxy<int> property_rate_limit() ;
159 #endif //#GLIBMM_PROPERTIES_ENABLED
160
161 #ifdef GLIBMM_PROPERTIES_ENABLED
162 /** The limit of the monitor to watch for changes
163    *
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.
167    */
168   Glib::PropertyProxy_ReadOnly<int> property_rate_limit() const;
169 #endif //#GLIBMM_PROPERTIES_ENABLED
170
171   #ifdef GLIBMM_PROPERTIES_ENABLED
172 /** Whether the monitor has been cancelled.
173    *
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.
177    */
178   Glib::PropertyProxy_ReadOnly<bool> property_cancelled() const;
179 #endif //#GLIBMM_PROPERTIES_ENABLED
180
181
182 public:
183
184 public:
185   //C++ methods used to invoke GTK+ virtual functions:
186 #ifdef GLIBMM_VFUNCS_ENABLED
187 #endif //GLIBMM_VFUNCS_ENABLED
188
189 protected:
190   //GTK+ Virtual Functions (override these to change behaviour):
191 #ifdef GLIBMM_VFUNCS_ENABLED
192 #endif //GLIBMM_VFUNCS_ENABLED
193
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
198
199
200 };
201
202 } // namespace Gio
203
204
205 namespace Glib
206 {
207   /** A Glib::wrap() method for this object.
208    * 
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.
212    *
213    * @relates Gio::FileMonitor
214    */
215   Glib::RefPtr<Gio::FileMonitor> wrap(GFileMonitor* object, bool take_copy = false);
216 }
217
218
219 #endif /* _GIOMM_FILEMONITOR_H */
220