1 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 /* Copyright (C) 2007 The gtkmm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <glibmm/error.h>
22 #include <glibmm/exceptionhandler.h>
23 #include <giomm/file.h>
24 #include <giomm/drive.h>
26 #include "slot_async.h"
31 Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
33 // Create a copy of the slot.
34 // A pointer to it will be passed through the callback's data parameter
35 // and deleted in the callback.
36 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
38 g_volume_mount(gobj(),
39 static_cast<GMountMountFlags>(flags),
40 mount_operation->gobj(),
42 &SignalProxy_async_callback,
48 Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags)
50 // Create a copy of the slot.
51 // A pointer to it will be passed through the callback's data parameter
52 // and deleted in the callback.
53 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
55 g_volume_mount(gobj(),
56 static_cast<GMountMountFlags>(flags),
57 mount_operation->gobj(),
59 &SignalProxy_async_callback,
64 Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, MountMountFlags flags)
66 g_volume_mount(gobj(),
67 static_cast<GMountMountFlags>(flags),
68 mount_operation->gobj(),
75 Volume::mount(MountMountFlags flags)
77 g_volume_mount(gobj(),
78 static_cast<GMountMountFlags>(flags),
86 void Volume::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
88 // Create a copy of the slot.
89 // A pointer to it will be passed through the callback's data parameter
90 // and deleted in the callback.
91 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
93 g_volume_eject(gobj(),
94 static_cast<GMountUnmountFlags>(flags),
96 &SignalProxy_async_callback,
100 void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
102 // Create a copy of the slot.
103 // A pointer to it will be passed through the callback's data parameter
104 // and deleted in the callback.
105 SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
107 g_volume_eject(gobj(),
108 static_cast<GMountUnmountFlags>(flags),
110 &SignalProxy_async_callback,
114 void Volume::eject(MountUnmountFlags flags)
116 g_volume_eject(gobj(),
117 static_cast<GMountUnmountFlags>(flags),