Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File 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 ;
00236   void cancel();
00237 
00238   GnomeVFSAsyncHandle*       gobj()       { return gobject_; }
00239   const GnomeVFSAsyncHandle* gobj() const { return gobject_; }
00240   GnomeVFSAsyncHandle**      gobj_addr()  { return &gobject_; }
00241   
00242 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00243   void assign_gobj(GnomeVFSAsyncHandle* src);
00244 #endif
00245 
00246 protected:
00247   GnomeVFSAsyncHandle* gobject_;
00248   
00249 private:
00250   Handle(const Handle&);
00251   Handle& operator=(const Handle&);
00252 
00253 
00254 };
00255 
00256 } // namespace Async
00257 } // namespace Vfs
00258 } // namespace Gnome
00259 
00260 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00261 namespace Glib
00262 {
00263 
00264 template <>
00265 class Value<Gnome::Vfs::FindDirectoryKind> : public Glib::Value_Flags<Gnome::Vfs::FindDirectoryKind>
00266 {
00267 public:
00268   static GType value_type() G_GNUC_CONST;
00269 };
00270 
00271 } // namespace Glib
00272 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00273 
00274 
00275 namespace Glib
00276 {
00277 
00283 Gnome::Vfs::FileInfoResult wrap(GnomeVFSGetFileInfoResult* object, bool take_copy = false);
00284 
00285 } // namespace Glib
00286 
00287 
00288 namespace Glib
00289 {
00290 
00296 Gnome::Vfs::FindDirectoryResult wrap(GnomeVFSFindDirectoryResult* object, bool take_copy = false);
00297 
00298 } // namespace Glib
00299 
00300 #endif /* _LIBGNOMEVFSMM_ASYNC_HANDLE_H */
00301 

Generated on Wed Aug 17 17:31:33 2005 for libgnomevfsmm by  doxygen 1.3.9.1