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 
31 namespace Gnome
32 {
33 
34 namespace Vfs
35 {
36 
39 namespace Transfer2
40 {
41 
42 typedef Glib::ListHandle<Glib::ustring> ListHandleStrings;
43 typedef 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.
48 typedef sigc::slot<gint, const ProgressInfo&> SlotProgress;
49 
69 #ifdef GLIBMM_EXCEPTIONS_ENABLED
70 void 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
76 void 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
105 void transfer_list_uris(const ListHandleUris& source_uri_list, const ListHandleUris& target_uri_list,
106  TransferOptions options = XFER_DEFAULT,
107  ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
108  OverwriteMode overwrite_mode = XFER_OVERWRITE_MODE_ABORT,
109  const SlotProgress& progress_callback = SlotProgress());
110 #else
111 void 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
125 void transfer(const Glib::ustring& source_uri, const Glib::ustring& target_uri,
126  TransferOptions options = XFER_DEFAULT,
127  ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
128  OverwriteMode overwrite_mode = XFER_OVERWRITE_MODE_ABORT,
129  const SlotProgress& progress_callback = SlotProgress());
130 #else
131 void 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
145 void transfer(const Glib::RefPtr<const Uri>& source_uri, const Glib::RefPtr<const Uri>& target_uri,
146  TransferOptions options = XFER_DEFAULT,
147  ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
148  OverwriteMode overwrite_mode = XFER_OVERWRITE_MODE_ABORT,
149  const SlotProgress& progress_callback = SlotProgress());
150 #else
151 void 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
171 void remove_list(const Glib::StringArrayHandle& source_uri_list,
172  TransferOptions options,
173  ErrorMode error_mode,
174  const SlotProgress& slot);
175 #else
176 void 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
193 void remove_list_uris(const ListHandleUris& source_uri_list,
194  TransferOptions options = XFER_DEFAULT,
195  ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
196  const SlotProgress& progress_callback = SlotProgress());
197 #else
198 void 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
211 void remove(const Glib::ustring& source_uri,
212  TransferOptions options = XFER_DEFAULT,
213  ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
214  const SlotProgress& progress_callback = SlotProgress());
215 #else
216 void 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
229 void remove(const Glib::RefPtr<const Uri>& source_uri,
230  TransferOptions options = XFER_DEFAULT,
231  ErrorMode error_mode = XFER_ERROR_MODE_ABORT,
232  const SlotProgress& progress_callback = SlotProgress());
233 #else
234 void 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 */