[glibmm] Gio::File: Wrap some new methods.



commit 25ecb65351e2b7d631e71d0de3eb573607726b2f
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jul 31 11:10:24 2013 +0200

    Gio::File: Wrap some new methods.
    
    * gio/src/file.[hg|ccg]: Add trash_async(), trash_finish(),
      make_directory_async() and make_directory_finish().

 gio/src/file.ccg |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gio/src/file.hg  |   45 ++++++++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+), 0 deletions(-)
---
diff --git a/gio/src/file.ccg b/gio/src/file.ccg
index 1216ff0..0e7548a 100644
--- a/gio/src/file.ccg
+++ b/gio/src/file.ccg
@@ -1873,5 +1873,71 @@ File::remove_async(const SlotAsyncReady& slot_ready,
 }
 
 
+void
+File::trash_async(const SlotAsyncReady& slot_ready,
+  const Glib::RefPtr<Cancellable>& cancellable,
+  int io_priority)
+{
+  // Create copies of slots.
+  // Pointers to them will be passed through the callbacks' data parameter
+  // and deleted in the corresponding callback.
+  SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready);
+
+  g_file_trash_async(gobj(),
+                    io_priority,
+                    Glib::unwrap(cancellable),
+                    &SignalProxy_async_callback,
+                    slot_ready_copy);
+}
+
+void
+File::trash_async(const SlotAsyncReady& slot_ready,
+  int io_priority)
+{
+  // Create copies of slots.
+  // Pointers to them will be passed through the callbacks' data parameter
+  // and deleted in the corresponding callback.
+  SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready);
+
+  g_file_trash_async(gobj(),
+                    io_priority,
+                    0,
+                    &SignalProxy_async_callback,
+                    slot_ready_copy);
+}
+
+void
+File::make_directory_async(const SlotAsyncReady& slot_ready,
+  const Glib::RefPtr<Cancellable>& cancellable,
+  int io_priority)
+{
+  // Create copies of slots.
+  // Pointers to them will be passed through the callbacks' data parameter
+  // and deleted in the corresponding callback.
+  SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready);
+
+  g_file_make_directory_async(gobj(),
+                    io_priority,
+                    Glib::unwrap(cancellable),
+                    &SignalProxy_async_callback,
+                    slot_ready_copy);
+}
+
+void
+File::make_directory_async(const SlotAsyncReady& slot_ready,
+  int io_priority)
+{
+  // Create copies of slots.
+  // Pointers to them will be passed through the callbacks' data parameter
+  // and deleted in the corresponding callback.
+  SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready);
+
+  g_file_make_directory_async(gobj(),
+                    io_priority,
+                    0,
+                    &SignalProxy_async_callback,
+                    slot_ready_copy);
+}
+
 
 } // namespace Gio
diff --git a/gio/src/file.hg b/gio/src/file.hg
index da5118c..2281ed0 100644
--- a/gio/src/file.hg
+++ b/gio/src/file.hg
@@ -1095,6 +1095,28 @@ public:
                g_file_trash,
                errthrow)
 
+   /** Asynchronously sends @file to the Trash location, if possible.
+    *
+    * @param slot_ready A SlotAsyncReady to call when the request is satisfied
+    * @param cancellable A Cancellable object which can be used to cancel the operation
+    * @param io_priority The I/O priority of the request
+    * @newin{2,38}
+    */
+  void trash_async(const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, int 
io_priority = Glib::PRIORITY_DEFAULT);
+
+   /** Asynchronously sends @file to the Trash location, if possible.
+    *
+    * @param slot_ready A SlotAsyncReady to call when the request is satisfied
+    * @param io_priority The I/O priority of the request
+    * @newin{2,38}
+    */
+  void trash_async(const SlotAsyncReady& slot_ready, int io_priority = Glib::PRIORITY_DEFAULT);
+  _IGNORE(g_file_trash_async)
+
+  _WRAP_METHOD(bool trash_finish(const Glib::RefPtr<AsyncResult>& result),
+               g_file_trash_finish,
+               errthrow)
+
 
   /** A signal handler would be, for instance:
    * void on_file_progress(goffset current_num_bytes, goffset total_num_bytes);
@@ -1262,6 +1284,29 @@ public:
                g_file_make_directory,
                errthrow)
 
+   /** Asynchronously creates a directory.
+    *
+    * @param slot_ready A SlotAsyncReady to call when the request is satisfied
+    * @param cancellable A Cancellable object which can be used to cancel the operation
+    * @param io_priority The I/O priority of the request
+    * @newin{2,38}
+    */
+  void make_directory_async(const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, 
int io_priority = Glib::PRIORITY_DEFAULT);
+
+   /** Asynchronously creates a directory.
+    *
+    * @param slot_ready A SlotAsyncReady to call when the request is satisfied
+    * @param io_priority The I/O priority of the request
+    * @newin{2,38}
+    */
+  void make_directory_async(const SlotAsyncReady& slot_ready, int io_priority = Glib::PRIORITY_DEFAULT);
+  _IGNORE(g_file_make_directory_async)
+
+  _WRAP_METHOD(bool make_directory_finish(const Glib::RefPtr<AsyncResult>& result),
+               g_file_make_directory_finish,
+               errthrow)
+
+
   _WRAP_METHOD(bool make_directory_with_parents(const Glib::RefPtr<Cancellable>& cancellable{?}),
                g_file_make_directory_with_parents,
                errthrow)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]