00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEVFSMM_DRIVE_H 00004 #define _LIBGNOMEVFSMM_DRIVE_H 00005 00006 00007 #include <glibmm.h> 00008 00009 /* Copyright 2003 gnome-vfsmm Development Team 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Library General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Library General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Library General Public 00022 * License along with this library; if not, write to the Free 00023 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 */ 00025 00026 00027 #include <libgnomevfsmm/enums.h> 00028 00029 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00030 typedef struct _GnomeVFSDrive GnomeVFSDrive; 00031 typedef struct _GnomeVFSDriveClass GnomeVFSDriveClass; 00032 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00033 00034 00035 namespace Gnome 00036 { 00037 00038 namespace Vfs 00039 { class Drive_Class; } // namespace Vfs 00040 00041 } // namespace Gnome 00042 namespace Gnome 00043 { 00044 00045 namespace Vfs 00046 { 00047 00048 class Volume; 00049 00050 00051 class Drive : public Glib::Object 00052 { 00053 00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00055 00056 public: 00057 typedef Drive CppObjectType; 00058 typedef Drive_Class CppClassType; 00059 typedef GnomeVFSDrive BaseObjectType; 00060 typedef GnomeVFSDriveClass BaseClassType; 00061 00062 private: friend class Drive_Class; 00063 static CppClassType drive_class_; 00064 00065 private: 00066 // noncopyable 00067 Drive(const Drive&); 00068 Drive& operator=(const Drive&); 00069 00070 protected: 00071 explicit Drive(const Glib::ConstructParams& construct_params); 00072 explicit Drive(GnomeVFSDrive* castitem); 00073 00074 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00075 00076 public: 00077 virtual ~Drive(); 00078 00079 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00080 static GType get_type() G_GNUC_CONST; 00081 static GType get_base_type() G_GNUC_CONST; 00082 #endif 00083 00085 GnomeVFSDrive* gobj() { return reinterpret_cast<GnomeVFSDrive*>(gobject_); } 00086 00088 const GnomeVFSDrive* gobj() const { return reinterpret_cast<GnomeVFSDrive*>(gobject_); } 00089 00091 GnomeVFSDrive* gobj_copy(); 00092 00093 private: 00094 00095 00096 public: 00097 00101 typedef sigc::slot<void, bool, const Glib::ustring&, const Glib::ustring&> OpSlot; 00102 00103 00104 gulong get_id() const; 00105 00106 DeviceType get_device_type() const; 00107 00111 Glib::RefPtr<Volume> get_mounted_volume(); 00112 00116 Glib::RefPtr<const Volume> get_mounted_volume() const; 00117 00118 00119 Glib::ListHandle< Glib::RefPtr<Volume> > get_mounted_volumes(); 00120 00121 Glib::ListHandle< Glib::RefPtr<const Volume> > get_mounted_volumes() const; 00122 00123 00124 Glib::ustring get_device_path() const; 00125 00126 Glib::ustring get_activation_uri() const; 00127 00128 Glib::ustring get_display_name() const; 00129 00130 Glib::ustring get_icon() const; 00131 00132 Glib::ustring get_hal_udi() const; 00133 00134 bool is_user_visible() const; 00135 00136 bool is_connected() const; 00137 00138 bool is_mounted() const; 00139 00140 //We could wrap this as operator==() instead, but that would need RefPtr::operator*. murrayc. 00141 00142 static int compare(const Glib::RefPtr<const Drive>& a, const Glib::RefPtr<const Drive>& b); 00143 00144 00145 void mount(const OpSlot& slot); 00146 void unmount(const OpSlot& slot); 00147 void eject(const OpSlot& slot); 00148 00149 00150 Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_mounted(); 00151 00152 00153 Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_pre_unmount(); 00154 00155 00156 Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_unmounted(); 00157 00158 00159 public: 00160 00161 public: 00162 //C++ methods used to invoke GTK+ virtual functions: 00163 00164 protected: 00165 //GTK+ Virtual Functions (override these to change behaviour): 00166 00167 //Default Signal Handlers:: 00168 virtual void on_mounted(const Glib::RefPtr<Volume>& volume); 00169 virtual void on_pre_unmount(const Glib::RefPtr<Volume>& volume); 00170 virtual void on_unmounted(const Glib::RefPtr<Volume>& volume); 00171 00172 00173 }; 00174 00175 00176 } // namespace Vfs 00177 } // namespace Gnome 00178 00179 00180 namespace Glib 00181 { 00187 Glib::RefPtr<Gnome::Vfs::Drive> wrap(GnomeVFSDrive* object, bool take_copy = false); 00188 } 00189 00190 00191 #endif /* _LIBGNOMEVFSMM_DRIVE_H */ 00192