00001
00002
00003 #ifndef _LIBGNOMEVFSMM_DRIVE_H
00004 #define _LIBGNOMEVFSMM_DRIVE_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
00033
00034
00035 namespace Gnome
00036 {
00037
00038 namespace Vfs
00039 { class Drive_Class; }
00040
00041 }
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
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
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
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
00163 #ifdef GLIBMM_VFUNCS_ENABLED
00164 #endif //GLIBMM_VFUNCS_ENABLED
00165
00166 protected:
00167
00168 #ifdef GLIBMM_VFUNCS_ENABLED
00169 #endif //GLIBMM_VFUNCS_ENABLED
00170
00171
00172 virtual void on_mounted(const Glib::RefPtr<Volume>& volume);
00173 virtual void on_pre_unmount(const Glib::RefPtr<Volume>& volume);
00174 virtual void on_unmounted(const Glib::RefPtr<Volume>& volume);
00175
00176
00177 };
00178
00179
00180 }
00181 }
00182
00183
00184 namespace Glib
00185 {
00191 Glib::RefPtr<Gnome::Vfs::Drive> wrap(GnomeVFSDrive* object, bool take_copy = false);
00192 }
00193
00194
00195 #endif
00196