00001
00002
00003 #ifndef _LIBGNOMEVFSMM_DRIVE_H
00004 #define _LIBGNOMEVFSMM_DRIVE_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <libgnomevfsmm/enums.h>
00027
00028 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00029 typedef struct _GnomeVFSDrive GnomeVFSDrive;
00030 typedef struct _GnomeVFSDriveClass GnomeVFSDriveClass;
00031 #endif
00032
00033
00034 namespace Gnome
00035 {
00036
00037 namespace Vfs
00038 { class Drive_Class; }
00039
00040 }
00041 namespace Gnome
00042 {
00043
00044 namespace Vfs
00045 {
00046
00047 class Volume;
00048
00049
00050 class Drive : public Glib::Object
00051 {
00052
00053 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00054
00055 public:
00056 typedef Drive CppObjectType;
00057 typedef Drive_Class CppClassType;
00058 typedef GnomeVFSDrive BaseObjectType;
00059 typedef GnomeVFSDriveClass BaseClassType;
00060
00061 private: friend class Drive_Class;
00062 static CppClassType drive_class_;
00063
00064 private:
00065
00066 Drive(const Drive&);
00067 Drive& operator=(const Drive&);
00068
00069 protected:
00070 explicit Drive(const Glib::ConstructParams& construct_params);
00071 explicit Drive(GnomeVFSDrive* castitem);
00072
00073 #endif
00074
00075 public:
00076 virtual ~Drive();
00077
00078 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00079 static GType get_type() G_GNUC_CONST;
00080 static GType get_base_type() G_GNUC_CONST;
00081 #endif
00082
00084 GnomeVFSDrive* gobj() { return reinterpret_cast<GnomeVFSDrive*>(gobject_); }
00085
00087 const GnomeVFSDrive* gobj() const { return reinterpret_cast<GnomeVFSDrive*>(gobject_); }
00088
00090 GnomeVFSDrive* gobj_copy();
00091
00092 private:
00093
00094
00095 public:
00096
00100 typedef sigc::slot<void, bool, const Glib::ustring&, const Glib::ustring&> OpSlot;
00101
00102
00103 gulong get_id() const;
00104
00105 DeviceType get_device_type() const;
00106
00110 Glib::RefPtr<Volume> get_mounted_volume();
00111
00115 Glib::RefPtr<const Volume> get_mounted_volume() const;
00116
00117
00118 Glib::ListHandle< Glib::RefPtr<Volume> > get_mounted_volumes();
00119
00120 Glib::ListHandle< Glib::RefPtr<const Volume> > get_mounted_volumes() const;
00121
00122
00123 Glib::ustring get_device_path() const;
00124
00125 Glib::ustring get_activation_uri() const;
00126
00127 Glib::ustring get_display_name() const;
00128
00129 Glib::ustring get_icon() const;
00130
00131 Glib::ustring get_hal_udi() const;
00132
00133 bool is_user_visible() const;
00134
00135 bool is_connected() const;
00136
00137 bool is_mounted() const;
00138
00139
00140
00141 static int compare(const Glib::RefPtr<const Drive>& a, const Glib::RefPtr<const Drive>& b);
00142
00143
00144 void mount(const OpSlot& slot);
00145 void unmount(const OpSlot& slot);
00146 void eject(const OpSlot& slot);
00147
00148
00149 Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_mounted();
00150
00151
00152 Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_pre_unmount();
00153
00154
00155 Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_unmounted();
00156
00157
00158 public:
00159
00160 public:
00161
00162
00163 protected:
00164
00165
00166
00167 virtual void on_mounted(const Glib::RefPtr<Volume>& volume);
00168 virtual void on_pre_unmount(const Glib::RefPtr<Volume>& volume);
00169 virtual void on_unmounted(const Glib::RefPtr<Volume>& volume);
00170
00171
00172 };
00173
00174
00175 }
00176 }
00177
00178
00179 namespace Glib
00180 {
00186 Glib::RefPtr<Gnome::Vfs::Drive> wrap(GnomeVFSDrive* object, bool take_copy = false);
00187 }
00188
00189
00190 #endif
00191