libgnomevfsmm  2.26.0
drive.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _LIBGNOMEVFSMM_DRIVE_H
4 #define _LIBGNOMEVFSMM_DRIVE_H
5 
6 
7 #include <glibmm.h>
8 
9 /* Copyright 2003 gnome-vfsmm Development Team
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 
27 #include <libgnomevfsmm/enums.h>
28 
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 typedef struct _GnomeVFSDrive GnomeVFSDrive;
31 typedef struct _GnomeVFSDriveClass GnomeVFSDriveClass;
32 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
33 
34 
35 namespace Gnome
36 {
37 
38 namespace Vfs
39 { class Drive_Class; } // namespace Vfs
40 
41 } // namespace Gnome
42 namespace Gnome
43 {
44 
45 namespace Vfs
46 {
47 
48 class Volume;
49 
50 
51 class Drive : public Glib::Object
52 {
53 
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 
56 public:
57  typedef Drive CppObjectType;
58  typedef Drive_Class CppClassType;
59  typedef GnomeVFSDrive BaseObjectType;
60  typedef GnomeVFSDriveClass BaseClassType;
61 
62 private: friend class Drive_Class;
63  static CppClassType drive_class_;
64 
65 private:
66  // noncopyable
67  Drive(const Drive&);
68  Drive& operator=(const Drive&);
69 
70 protected:
71  explicit Drive(const Glib::ConstructParams& construct_params);
72  explicit Drive(GnomeVFSDrive* castitem);
73 
74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
75 
76 public:
77  virtual ~Drive();
78 
79 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80  static GType get_type() G_GNUC_CONST;
81  static GType get_base_type() G_GNUC_CONST;
82 #endif
83 
85  GnomeVFSDrive* gobj() { return reinterpret_cast<GnomeVFSDrive*>(gobject_); }
86 
88  const GnomeVFSDrive* gobj() const { return reinterpret_cast<GnomeVFSDrive*>(gobject_); }
89 
91  GnomeVFSDrive* gobj_copy();
92 
93 private:
94 
95 
96 public:
97 
101  typedef sigc::slot<void, bool, const Glib::ustring&, const Glib::ustring&> OpSlot;
102 
103 
104  gulong get_id() const;
105 
106  DeviceType get_device_type() const;
107 
111  Glib::RefPtr<Volume> get_mounted_volume();
112 
116  Glib::RefPtr<const Volume> get_mounted_volume() const;
117 
118 
119  Glib::ListHandle< Glib::RefPtr<Volume> > get_mounted_volumes();
120 
121  Glib::ListHandle< Glib::RefPtr<const Volume> > get_mounted_volumes() const;
122 
123 
124  Glib::ustring get_device_path() const;
125 
126  Glib::ustring get_activation_uri() const;
127 
128  Glib::ustring get_display_name() const;
129 
130  Glib::ustring get_icon() const;
131 
132  Glib::ustring get_hal_udi() const;
133 
134  bool is_user_visible() const;
135 
136  bool is_connected() const;
137 
138  bool is_mounted() const;
139 
140  //We could wrap this as operator==() instead, but that would need RefPtr::operator*. murrayc.
141 
142  static int compare(const Glib::RefPtr<const Drive>& a, const Glib::RefPtr<const Drive>& b);
143 
144 
145  // These methods are not available in gnome-vfs on WIN32
146 #ifndef G_OS_WIN32
147 
148  void mount(const OpSlot& slot);
149  void unmount(const OpSlot& slot);
150  void eject(const OpSlot& slot);
151 #endif // G_OS_WIN32
152 
153 
159  Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_mounted();
160 
161 
167  Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_pre_unmount();
168 
169 
175  Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_unmounted();
176 
177 
178 public:
179 
180 public:
181  //C++ methods used to invoke GTK+ virtual functions:
182 #ifdef GLIBMM_VFUNCS_ENABLED
183 #endif //GLIBMM_VFUNCS_ENABLED
184 
185 protected:
186  //GTK+ Virtual Functions (override these to change behaviour):
187 #ifdef GLIBMM_VFUNCS_ENABLED
188 #endif //GLIBMM_VFUNCS_ENABLED
189 
190  //Default Signal Handlers::
191 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
192  virtual void on_mounted(const Glib::RefPtr<Volume>& volume);
193  virtual void on_pre_unmount(const Glib::RefPtr<Volume>& volume);
194  virtual void on_unmounted(const Glib::RefPtr<Volume>& volume);
195 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
196 
197 
198 };
199 
200 
201 } // namespace Vfs
202 } // namespace Gnome
203 
204 
205 namespace Glib
206 {
215  Glib::RefPtr<Gnome::Vfs::Drive> wrap(GnomeVFSDrive* object, bool take_copy = false);
216 }
217 
218 
219 #endif /* _LIBGNOMEVFSMM_DRIVE_H */
220 
Definition: address.h:119
DeviceType
Definition: enums.h:742
Definition: address.h:36
const GnomeVFSDrive * gobj() const
Provides access to the underlying C GObject.
Definition: drive.h:88
sigc::slot< void, bool, const Glib::ustring &, const Glib::ustring & > OpSlot
For instance, void on_operation(bool succeeded, const Glib::ustring& error, const Glib::ustring& deta...
Definition: drive.h:101
Glib::ustring get_icon(const Glib::ustring &mime_type)
Query the MIME database for an icon representing the specified MIME type.
GnomeVFSDrive * gobj()
Provides access to the underlying C GObject.
Definition: drive.h:85
Definition: drive.h:51