Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / glibmm2 / gio / src / mount.ccg
1 // -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
3 /* Copyright (C) 2007 The gtkmm Development Team
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 #include <giomm/drive.h>
21 #include <giomm/volume.h>
22 #include <gio/gio.h>
23 #include "slot_async.h"
24
25 namespace Gio
26 {
27
28 void Mount::unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
29 {
30   // Create a copy of the slot.
31   // A pointer to it will be passed through the callback's data parameter
32   // and deleted in the callback.
33   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
34
35   g_mount_unmount(gobj(),
36                   GMountUnmountFlags(flags),
37                   cancellable->gobj(), 
38                   &SignalProxy_async_callback,
39                   slot_copy);
40 }
41
42 void Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags)
43 {
44   // Create a copy of the slot.
45   // A pointer to it will be passed through the callback's data parameter
46   // and deleted in the callback.
47   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
48
49   g_mount_unmount(gobj(),
50                   GMountUnmountFlags(flags),
51                   NULL, 
52                   &SignalProxy_async_callback,
53                   slot_copy);
54 }
55
56 void Mount::unmount(MountUnmountFlags flags)
57 {
58   g_mount_unmount(gobj(),
59                   GMountUnmountFlags(flags),
60                   NULL, 
61                   NULL,
62                   NULL);
63 }
64
65
66 void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
67 {
68   // Create a copy of the slot.
69   // A pointer to it will be passed through the callback's data parameter
70   // and deleted in the callback.
71   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
72
73   g_mount_remount(gobj(),
74                   static_cast<GMountMountFlags>(flags),
75                   operation->gobj(),
76                   cancellable->gobj(), 
77                   &SignalProxy_async_callback,
78                   slot_copy);
79 }
80
81 void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountMountFlags flags)
82 {
83   // Create a copy of the slot.
84   // A pointer to it will be passed through the callback's data parameter
85   // and deleted in the callback.
86   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
87
88   g_mount_remount(gobj(),
89                   static_cast<GMountMountFlags>(flags),
90                   operation->gobj(),
91                   NULL, 
92                   &SignalProxy_async_callback,
93                   slot_copy);
94 }
95
96 void Mount::remount(const Glib::RefPtr<MountOperation>& operation, MountMountFlags flags)
97 {
98   g_mount_remount(gobj(),
99                   static_cast<GMountMountFlags>(flags),
100                   operation->gobj(),
101                   NULL, 
102                   NULL,
103                   NULL);
104 }
105
106 void Mount::remount(MountMountFlags flags)
107 {
108   g_mount_remount(gobj(),
109                   static_cast<GMountMountFlags>(flags),
110                   NULL,
111                   NULL, 
112                   NULL,
113                   NULL);
114 }
115
116 void Mount::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
117 {
118   // Create a copy of the slot.
119   // A pointer to it will be passed through the callback's data parameter
120   // and deleted in the callback.
121   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
122
123   g_mount_eject(gobj(),
124                   GMountUnmountFlags(flags),
125                   cancellable->gobj(), 
126                   &SignalProxy_async_callback,
127                   slot_copy);
128 }
129
130 void Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
131 {
132   // Create a copy of the slot.
133   // A pointer to it will be passed through the callback's data parameter
134   // and deleted in the callback.
135   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
136
137   g_mount_eject(gobj(),
138                   GMountUnmountFlags(flags),
139                   NULL, 
140                   &SignalProxy_async_callback,
141                   slot_copy);
142 }
143
144 void Mount::eject(MountUnmountFlags flags)
145 {
146   g_mount_eject(gobj(),
147                   GMountUnmountFlags(flags),
148                   NULL, 
149                   NULL,
150                   NULL);
151 }
152
153
154 void Mount::guess_content_type(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, bool force_rescan)
155 {
156   // Create a copy of the slot.
157   // A pointer to it will be passed through the callback's data parameter
158   // and deleted in the callback.
159   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
160
161   g_mount_guess_content_type(gobj(),
162                   force_rescan,
163                   cancellable->gobj(), 
164                   &SignalProxy_async_callback,
165                   slot_copy);
166 }
167
168 void Mount::guess_content_type(const SlotAsyncReady& slot, bool force_rescan)
169 {
170   // Create a copy of the slot.
171   // A pointer to it will be passed through the callback's data parameter
172   // and deleted in the callback.
173   SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
174
175   g_mount_guess_content_type(gobj(),
176                   force_rescan,
177                   NULL, 
178                   &SignalProxy_async_callback,
179                   slot_copy);
180 }
181
182 void Mount::guess_content_type(bool force_rescan)
183 {
184   g_mount_guess_content_type(gobj(),
185                   force_rescan,
186                   NULL, 
187                   NULL,
188                   NULL);
189 }
190
191
192 } // namespace Gio
193