libgnomevfsmm 2.26.0
transfer-2.h
Go to the documentation of this file.
1/* Copyright 2006 gnome-vfsmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free
15 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 */
17
18
19#ifndef _LIBGNOMEVFSMM_TRANSFER_2_H
20#define _LIBGNOMEVFSMM_TRANSFER_2_H
21
22#include <glibmm.h>
23
24#include <libgnomevfsmm/enums.h>
26#include <libgnomevfsmm/uri.h>
28
29#include <libgnomevfs/gnome-vfs-xfer.h> //For GnomeVFSXferProgressInfo
30
31namespace Gnome
32{
33
34namespace Vfs
35{
36
39namespace Transfer2
40{
41
42typedef Glib::ListHandle<Glib::ustring> ListHandleStrings;
43typedef Glib::ListHandle< Glib::RefPtr<const Uri> > ListHandleUris;
44
46// Essentially, this line, a different definition of SlotProgress,
47// is the main change forcing the introduction of the Transfer2 namespace.
48typedef sigc::slot<gint, const ProgressInfo&> SlotProgress;
49
69#ifdef GLIBMM_EXCEPTIONS_ENABLED
70void transfer_list(const Glib::StringArrayHandle& source_uri_list, const Glib::StringArrayHandle& target_uri_list,
71 TransferOptions options,
72 ErrorMode error_mode,
73 OverwriteMode overwrite_mode,
74 const SlotProgress& slot);
75#else
76void transfer_list(const Glib::StringArrayHandle& source_uri_list, const Glib::StringArrayHandle& target_uri_list,
77 TransferOptions options,
78 ErrorMode error_mode,
79 OverwriteMode overwrite_mode,
80 const SlotProgress& slot,
81 std::auto_ptr<Gnome::Vfs::exception> error);
82#endif //GLIBMM_EXCEPTIONS_ENABLED
83
104#ifdef GLIBMM_EXCEPTIONS_ENABLED
105void transfer_list_uris(const ListHandleUris& source_uri_list, const ListHandleUris& target_uri_list,
107 ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
109 const SlotProgress& progress_callback = SlotProgress());
110#else
111void transfer_list_uris(const ListHandleUris& source_uri_list, const ListHandleUris& target_uri_list,
112 TransferOptions options,
113 ErrorMode error_mode,
114 OverwriteMode overwrite_mode,
115 const SlotProgress& progress_callback,
116 std::auto_ptr<Gnome::Vfs::exception>& error);
117#endif //GLIBMM_EXCEPTIONS_ENABLED
118
124#ifdef GLIBMM_EXCEPTIONS_ENABLED
125void transfer(const Glib::ustring& source_uri, const Glib::ustring& target_uri,
127 ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
129 const SlotProgress& progress_callback = SlotProgress());
130#else
131void transfer(const Glib::ustring& source_uri, const Glib::ustring& target_uri,
132 TransferOptions options,
133 ErrorMode error_mode,
134 OverwriteMode overwrite_mode,
135 const SlotProgress& progress_callback,
136 std::auto_ptr<Gnome::Vfs::exception>& error);
137#endif //GLIBMM_EXCEPTIONS_ENABLED
138
144#ifdef GLIBMM_EXCEPTIONS_ENABLED
145void transfer(const Glib::RefPtr<const Uri>& source_uri, const Glib::RefPtr<const Uri>& target_uri,
147 ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
149 const SlotProgress& progress_callback = SlotProgress());
150#else
151void transfer(const Glib::RefPtr<const Uri>& source_uri, const Glib::RefPtr<const Uri>& target_uri,
152 TransferOptions options,
153 ErrorMode error_mode,
154 OverwriteMode overwrite_mode,
155 const SlotProgress& progress_callback,
156 std::auto_ptr<Gnome::Vfs::exception>& error);
157#endif //GLIBMM_EXCEPTIONS_ENABLED
158
159//TODO: Add a string-based version of gnome_vfs_xfer_delete() to gnome-vfs.
160
170#ifdef GLIBMM_EXCEPTIONS_ENABLED
171void remove_list(const Glib::StringArrayHandle& source_uri_list,
172 TransferOptions options,
173 ErrorMode error_mode,
174 const SlotProgress& slot);
175#else
176void remove_list(const Glib::StringArrayHandle& source_uri_list,
177 TransferOptions options,
178 ErrorMode error_mode,
179 const SlotProgress& slot,
180 std::auto_ptr<Gnome::Vfs::exception>& error);
181#endif //GLIBMM_EXCEPTIONS_ENABLED
182
192#ifdef GLIBMM_EXCEPTIONS_ENABLED
193void remove_list_uris(const ListHandleUris& source_uri_list,
195 ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
196 const SlotProgress& progress_callback = SlotProgress());
197#else
198void remove_list_uris(const ListHandleUris& source_uri_list,
199 TransferOptions options,
200 ErrorMode error_mode,
201 const SlotProgress& progress_callbacki,
202 std::auto_ptr<Gnome::Vfs::exception>& error);
203#endif //GLIBMM_EXCEPTIONS_ENABLED
204
210#ifdef GLIBMM_EXCEPTIONS_ENABLED
211void remove(const Glib::ustring& source_uri,
213 ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
214 const SlotProgress& progress_callback = SlotProgress());
215#else
216void remove(const Glib::ustring& source_uri,
217 TransferOptions options,
218 ErrorMode error_mode,
219 const SlotProgress& progress_callback,
220 std::auto_ptr<Gnome::Vfs::exception>& error);
221#endif //GLIBMM_EXCEPTIONS_ENABLED
222
228#ifdef GLIBMM_EXCEPTIONS_ENABLED
229void remove(const Glib::RefPtr<const Uri>& source_uri,
231 ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
232 const SlotProgress& progress_callback = SlotProgress());
233#else
234void remove(const Glib::RefPtr<const Uri>& source_uri,
235 TransferOptions options,
236 ErrorMode error_mode,
237 const SlotProgress& progress_callback,
238 std::auto_ptr<Gnome::Vfs::exception>& error);
239#endif //GLIBMM_EXCEPTIONS_ENABLED
240
241} // namespace Transfer2
242} // namespace Vfs
243} // namespace Gnome
244
245#endif /* _LIBGNOMEVFSMM_TRANSFER_2_H */
ErrorMode
Definition enums.h:685
OverwriteMode
Definition enums.h:660
TransferOptions
Definition enums.h:599
@ XFER_ERROR_MODE_ABORT
Definition enums.h:686
@ XFER_OVERWRITE_MODE_ABORT
Definition enums.h:661
@ XFER_DEFAULT
Definition enums.h:600
Glib::ListHandle< Glib::RefPtr< const Uri > > ListHandleUris
Definition transfer-2.h:43
void transfer_list_uris(const ListHandleUris &source_uri_list, const ListHandleUris &target_uri_list, TransferOptions options=XFER_DEFAULT, ErrorMode error_mode=XFER_ERROR_MODE_ABORT, OverwriteMode overwrite_mode=XFER_OVERWRITE_MODE_ABORT, const SlotProgress &progress_callback=SlotProgress())
This function will transfer multiple files to multiple targets, given source URIs and destination URI...
void remove_list(const Glib::StringArrayHandle &source_uri_list, TransferOptions options, ErrorMode error_mode, const SlotProgress &slot)
Unlinks items in the source_uri_list from their filesystems.
void remove_list_uris(const ListHandleUris &source_uri_list, TransferOptions options=XFER_DEFAULT, ErrorMode error_mode=XFER_ERROR_MODE_ABORT, const SlotProgress &progress_callback=SlotProgress())
Unlinks items in the source_uri_list from their filesystems.
Glib::ListHandle< Glib::ustring > ListHandleStrings
Definition transfer-2.h:42
void remove(const Glib::ustring &source_uri, TransferOptions options=XFER_DEFAULT, ErrorMode error_mode=XFER_ERROR_MODE_ABORT, const SlotProgress &progress_callback=SlotProgress())
This function works exactly like remove_list(), and is a convenience wrapper for only acting on one s...
sigc::slot< gint, const ProgressInfo & > SlotProgress
For instance, gint on_transfer_progress(const Gnome::Vfs::Transfer::ProgressInfo& info);.
Definition transfer-2.h:48
void transfer_list(const Glib::StringArrayHandle &source_uri_list, const Glib::StringArrayHandle &target_uri_list, TransferOptions options, ErrorMode error_mode, OverwriteMode overwrite_mode, const SlotProgress &slot)
This function will transfer multiple files to multiple targets, given source URIs and destination URI...
void transfer(const Glib::ustring &source_uri, const Glib::ustring &target_uri, TransferOptions options=XFER_DEFAULT, ErrorMode error_mode=XFER_ERROR_MODE_ABORT, OverwriteMode overwrite_mode=XFER_OVERWRITE_MODE_ABORT, const SlotProgress &progress_callback=SlotProgress())
This function works exactly like transfer_list(), and is a convenience wrapper for only acting on one...
Definition address.h:37