Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

async-handle.h

Go to the documentation of this file.
00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEVFSMM_ASYNC_HANDLE_H 00004 #define _LIBGNOMEVFSMM_ASYNC_HANDLE_H 00005 00006 #include <glibmm.h> 00007 00008 /* Copyright 2003 gnome-vfsmm Development Team 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Library General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Library General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Library General Public 00021 * License along with this library; if not, write to the Free 00022 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00023 */ 00024 00025 #include <libgnomevfs/gnome-vfs-async-ops.h> 00026 #include <libgnomevfs/gnome-vfs-file-info.h> 00027 00028 #include <libgnomevfsmm/enums.h> 00029 #include <libgnomevfsmm/file-info.h> 00030 #include <libgnomevfsmm/uri.h> 00031 #include <libgnomevfsmm/transfer.h> 00032 00033 00034 namespace Gnome 00035 { 00036 00037 namespace Vfs 00038 { 00039 00040 class FileInfoResult 00041 { 00042 public: 00043 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00044 typedef FileInfoResult CppObjectType; 00045 typedef GnomeVFSGetFileInfoResult BaseObjectType; 00046 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00047 00048 FileInfoResult(); 00049 00050 // Use make_a_copy=true when getting it directly from a struct. 00051 explicit FileInfoResult(GnomeVFSGetFileInfoResult* castitem, bool make_a_copy = false); 00052 00053 FileInfoResult(const FileInfoResult& src); 00054 FileInfoResult& operator=(const FileInfoResult& src); 00055 00056 ~FileInfoResult(); 00057 00058 GnomeVFSGetFileInfoResult* gobj() { return gobject_; } 00059 const GnomeVFSGetFileInfoResult* gobj() const { return gobject_; } 00060 00062 GnomeVFSGetFileInfoResult* gobj_copy() const; 00063 00064 protected: 00065 GnomeVFSGetFileInfoResult* gobject_; 00066 00067 private: 00068 00069 00070 public: 00071 00072 Glib::RefPtr<Uri> get_uri() const; 00073 Result get_result() const; 00074 Glib::RefPtr<FileInfo> get_file_info() const; 00075 00076 00077 }; 00078 00079 00080 class FindDirectoryResult 00081 { 00082 public: 00083 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00084 typedef FindDirectoryResult CppObjectType; 00085 typedef GnomeVFSFindDirectoryResult BaseObjectType; 00086 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00087 00088 FindDirectoryResult(); 00089 00090 // Use make_a_copy=true when getting it directly from a struct. 00091 explicit FindDirectoryResult(GnomeVFSFindDirectoryResult* castitem, bool make_a_copy = false); 00092 00093 FindDirectoryResult(const FindDirectoryResult& src); 00094 FindDirectoryResult& operator=(const FindDirectoryResult& src); 00095 00096 ~FindDirectoryResult(); 00097 00098 GnomeVFSFindDirectoryResult* gobj() { return gobject_; } 00099 const GnomeVFSFindDirectoryResult* gobj() const { return gobject_; } 00100 00102 GnomeVFSFindDirectoryResult* gobj_copy() const; 00103 00104 protected: 00105 GnomeVFSFindDirectoryResult* gobject_; 00106 00107 private: 00108 00109 00110 Glib::RefPtr<Uri> get_uri() const; 00111 Result get_result() const; 00112 00113 00114 }; 00115 00116 00122 enum FindDirectoryKind 00123 { 00124 DIRECTORY_KIND_DESKTOP = 1000, 00125 DIRECTORY_KIND_TRASH 00126 }; 00127 00128 00129 namespace Async 00130 { 00131 00132 typedef Glib::ListHandle< Glib::RefPtr<const Uri> > ListHandleUris; 00133 00134 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00135 struct FileInfoResultTraits 00136 { 00137 typedef FileInfoResult CppType; 00138 typedef const GnomeVFSGetFileInfoResult* CType; 00139 typedef GnomeVFSGetFileInfoResult* CTypeNonConst; 00140 00141 static CType to_c_type (const CppType& obj) { return obj.gobj(); } 00142 static CType to_c_type (const CType& obj) { return obj; } 00143 static CppType to_cpp_type (const CType& obj) { return CppType(const_cast<CTypeNonConst>(obj), true); } 00144 static void release_c_type (const CType&) {} 00145 }; 00146 #endif //DOXYGEN_SHOULD_SKIP_THIS 00147 00148 typedef Glib::ListHandle< FileInfoResult, FileInfoResultTraits > ListHandleFileInfoResults; 00149 00150 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00151 struct FindDirectoryResultTraits 00152 { 00153 typedef FindDirectoryResult CppType; 00154 typedef const GnomeVFSFindDirectoryResult* CType; 00155 typedef GnomeVFSFindDirectoryResult* CTypeNonConst; 00156 00157 static CType to_c_type (const CppType& obj) { return obj.gobj(); } 00158 static CType to_c_type (const CType& obj) { return obj; } 00159 static CppType to_cpp_type (const CType& obj) { return CppType(const_cast<CTypeNonConst>(obj), true); } 00160 static void release_c_type (const CType&) {} 00161 }; 00162 #endif //DOXYGEN_SHOULD_SKIP_THIS 00163 00164 typedef Glib::ListHandle< FindDirectoryResult, FindDirectoryResultTraits > ListHandleFindDirectoryResult; 00165 00166 00167 //The default constructor creates a null handle. Use an open*() method before anything else. 00168 class Handle 00169 { 00170 public: 00171 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00172 typedef Handle CppObjectType; 00173 typedef GnomeVFSAsyncHandle BaseObjectType; 00174 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00175 00176 private: 00177 00178 00179 public: 00180 Handle(); 00181 ~Handle(); 00182 00183 typedef sigc::slot<void, const Async::Handle&, Result> SlotOpen; 00184 typedef SlotOpen SlotClose; 00185 00186 void open(const Glib::ustring& text_uri, OpenMode open_mode, int priority, const SlotOpen& slot); 00187 void open(const Glib::RefPtr<Uri>& uri, OpenMode open_mode, int priority, const SlotOpen& slot); 00188 00189 typedef sigc::slot<void, const Async::Handle&, const Glib::RefPtr<Glib::IOChannel>&, Result> SlotOpenAsChannel; 00190 void open_as_channel(const Glib::ustring& text_uri, OpenMode open_mode, guint advised_block_size, int priority, const SlotOpenAsChannel& slot); 00191 void open_as_channel(const Glib::RefPtr<Uri>& uri, OpenMode open_mode, guint advised_block_size, int priority, const SlotOpenAsChannel& slot); 00192 00193 void create(const Glib::ustring& text_uri, OpenMode open_mode, bool exclusive, guint perm, int priority, const SlotOpen& slot); 00194 void create(const Glib::RefPtr<Uri>& uri, OpenMode open_mode, bool exclusive, guint perm, int priority, const SlotOpen& slot); 00195 00196 void create_symbolic_link(const Glib::RefPtr<Uri>& uri, const Glib::ustring& uri_reference, int priority, const SlotOpen& slot); 00197 00198 typedef SlotOpenAsChannel SlotCreateAsChannel; 00199 void create_as_channel(const Glib::ustring& text_uri, OpenMode open_mode, bool exclusive, guint perm, int priority, const SlotCreateAsChannel& slot); 00200 //gnome_vfs_async_create_uri_as_channel() is declared, but not defined in gnome-vfs. 00201 //void create_as_channel(const Glib::RefPtr<Uri> uri, OpenMode open_mode, bool exclusive, guint perm, int priority, const SlotCreateAsChannel& slot); 00202 00203 void close(const SlotClose& slot); 00204 00205 typedef sigc::slot<void, const Async::Handle&, Result, gpointer, FileSize, FileSize> SlotRead; 00206 void read(gpointer buffer, guint bytes, const SlotRead& slot); 00207 00208 typedef sigc::slot<void, const Async::Handle&, Result, gconstpointer, FileSize, FileSize> SlotWrite; 00209 void write(gconstpointer buffer, guint bytes, const SlotWrite& slot); 00210 00211 typedef sigc::slot<void, const Async::Handle&, ListHandleFileInfoResults > SlotGetFileInfo; 00212 void get_file_info(const ListHandleUris& uri_list, FileInfoOptions options, int priority, const SlotGetFileInfo& slot) const; 00213 00214 typedef sigc::slot<void, const Async::Handle&, Result, const Glib::RefPtr<FileInfo>& > SlotSetFileInfo; 00215 void set_file_info(const Glib::RefPtr<Uri>& uri, const Glib::RefPtr<FileInfo>& info, SetFileInfoMask mask, FileInfoOptions options, int priority, const SlotSetFileInfo& slot); 00216 00217 typedef sigc::slot<void, const Async::Handle&, Result, Glib::ListHandle<Glib::RefPtr<FileInfo> >, int> SlotLoadDirectory; 00218 void load_directory(const Glib::ustring& text_uri, FileInfoOptions options, guint items_per_notification, int priority, const SlotLoadDirectory& slot); 00219 void load_directory(const Glib::RefPtr<Uri>& uri, FileInfoOptions options, guint items_per_notification, int priority, const SlotLoadDirectory& slot); 00220 00221 typedef sigc::slot<int, const Async::Handle&, Transfer::ProgressInfo&> SlotTransferProgress; 00222 void transfer(const ListHandleUris& source_uri_list, const ListHandleUris& target_uri_list, TransferOptions xfer_options, ErrorMode error_mode, OverwriteMode overwrite_mode, int priority, const SlotTransferProgress& progress_update_callback, const Transfer::SlotProgress& progress_sync_callback); 00223 00224 typedef sigc::slot<void, const Async::Handle&, ListHandleFindDirectoryResult > SlotFindDirectory; 00225 void find_directory(const ListHandleUris& near_uri_list, FindDirectoryKind kind, bool create_if_needed, bool find_if_needed, guint permissions, int priority, const SlotFindDirectory& slot); 00226 00227 typedef sigc::slot<void, const Async::Handle&, Result, gpointer> SlotFileControl; 00228 void file_control(const Glib::ustring& operation, gpointer operation_data, const SlotFileControl& slot); 00229 00230 00235 void cancel(); 00236 00237 GnomeVFSAsyncHandle* gobj() { return gobject_; } 00238 const GnomeVFSAsyncHandle* gobj() const { return gobject_; } 00239 GnomeVFSAsyncHandle** gobj_addr() { return &gobject_; } 00240 00241 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00242 void assign_gobj(GnomeVFSAsyncHandle* src); 00243 #endif 00244 00245 protected: 00246 GnomeVFSAsyncHandle* gobject_; 00247 00248 private: 00249 Handle(const Handle&); 00250 Handle& operator=(const Handle&); 00251 00252 00253 }; 00254 00255 } // namespace Async 00256 } // namespace Vfs 00257 } // namespace Gnome 00258 00259 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00260 namespace Glib 00261 { 00262 00263 template <> 00264 class Value<Gnome::Vfs::FindDirectoryKind> : public Glib::Value_Flags<Gnome::Vfs::FindDirectoryKind> 00265 { 00266 public: 00267 static GType value_type() G_GNUC_CONST; 00268 }; 00269 00270 } // namespace Glib 00271 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00272 00273 00274 namespace Glib 00275 { 00276 00282 Gnome::Vfs::FileInfoResult wrap(GnomeVFSGetFileInfoResult* object, bool take_copy = false); 00283 00284 } // namespace Glib 00285 00286 00287 namespace Glib 00288 { 00289 00295 Gnome::Vfs::FindDirectoryResult wrap(GnomeVFSFindDirectoryResult* object, bool take_copy = false); 00296 00297 } // namespace Glib 00298 00299 #endif /* _LIBGNOMEVFSMM_ASYNC_HANDLE_H */ 00300

Generated on Sun Jun 20 21:46:19 2004 for libgnomevfsmm by doxygen 1.3.7