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
00107 Glib::RefPtr<
Volume> get_mounted_volume();
00108
00109 Glib::RefPtr<const
Volume> get_mounted_volume() const;
00110
00111 Glib::ustring get_device_path() const;
00112
00113 Glib::ustring get_activation_uri() const;
00114
00115 Glib::ustring get_display_name() const;
00116
00117 Glib::ustring get_icon() const;
00118
00119
bool is_user_visible() const;
00120
00121
bool is_connected() const;
00122
00123
bool is_mounted() const;
00124
00125
00126
00127 static
int compare(const Glib::RefPtr<const
Drive>& a, const Glib::RefPtr<const
Drive>& b);
00128
00129
00130
void mount(const OpSlot& slot);
00131
void unmount(const OpSlot& slot);
00132
void eject(const OpSlot& slot);
00133
00134
00135 Glib::SignalProxy1<
void,const Glib::RefPtr<
Volume>& > signal_mounted();
00136
00137
00138 Glib::SignalProxy1<
void,const Glib::RefPtr<
Volume>& > signal_pre_unmount();
00139
00140
00141 Glib::SignalProxy1<
void,const Glib::RefPtr<
Volume>& > signal_unmounted();
00142
00143
00144 public:
00145
00146 public:
00147
00148
00149 protected:
00150
00151
00152
00153 virtual
void on_mounted(const Glib::RefPtr<
Volume>& volume);
00154 virtual
void on_pre_unmount(const Glib::RefPtr<
Volume>& volume);
00155 virtual
void on_unmounted(const Glib::RefPtr<
Volume>& volume);
00156
00157
00158 };
00159
00160
00161 }
00162 }
00163
00164
00165 namespace Glib
00166 {
00172 Glib::RefPtr<Gnome::Vfs::Drive>
wrap(GnomeVFSDrive* object,
bool take_copy =
false);
00173 }
00174
00175
00176
#endif
00177