logo top
Main Page   Widgets   glibmm Namespaces   Book  

Gio::Volume Class Reference

The Volume interface represents user-visible objects that can be mounted. More...

Inheritance diagram for Gio::Volume:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~Volume ()
GVolume* gobj ()
 Provides access to the underlying C GObject.
const GVolume* gobj () const
 Provides access to the underlying C GObject.
std::string get_name () const
 Gets the name of volume .
std::string get_uuid () const
 Gets the UUID for the volume .
Glib::RefPtr<Iconget_icon ()
 Gets the icon for volume .
Glib::RefPtr<const Iconget_icon () const
 Gets the icon for volume .
Glib::RefPtr<Driveget_drive ()
 Gets the drive for the volume .
Glib::RefPtr<const Driveget_drive () const
 Gets the drive for the volume .
bool can_mount () const
 Checks if a volume can be mounted.
bool can_eject () const
 Checks if a volume can be ejected.
void mount (const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
 Mounts a volume.
void mount (const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot)
 Mounts a volume.
void mount (const Glib::RefPtr<MountOperation>& mount_operation)
 Mounts a volume.
void mount ()
 Mounts a volume.
bool mount_finish (const Glib::RefPtr<AsyncResult>& result)
 Finishes mounting a volume.
void eject (const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags=MOUNT_UNMOUNT_NONE)
 Ejects a volume.
void eject (const SlotAsyncReady& slot, MountUnmountFlags flags=MOUNT_UNMOUNT_NONE)
 Ejects a volume.
void eject (MountUnmountFlags flags=MOUNT_UNMOUNT_NONE)
 Ejects a volume.
bool eject_finish (const Glib::RefPtr<AsyncResult>& result)
 Finishes ejecting a volume.

Static Public Member Functions

static void add_interface (GType gtype_implementer)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gio::Volumewrap (GVolume* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

The Volume interface represents user-visible objects that can be mounted.

Mounting a Volume instance is an asynchronous operation. For more information about asynchronous operations, see AsyncReady and SimpleAsyncReady. To mount a GVolume, first call mount(), optionally providing a MountOperation object and a SlotAsyncReady callback.

Typically, you will not want to provide a MountOperation if automounting all volumes when a desktop session starts since it's not desirable to put up a lot of dialogs asking for credentials.

The callback will be fired when the operation has resolved (either with success or failure), and a AsyncReady structure will be passed to the callback. That callback should then call g_volume_mount_finish() with the GVolume instance and the GAsyncReady data to see if the operation was completed successfully. If an error is present when finish() is called, then it will be filled with any error information.

Since glibmm 2.16:


Constructor & Destructor Documentation

virtual Gio::Volume::~Volume (  )  [virtual]


Member Function Documentation

static void Gio::Volume::add_interface ( GType  gtype_implementer  )  [static]

GVolume* Gio::Volume::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

const GVolume* Gio::Volume::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

std::string Gio::Volume::get_name (  )  const

Gets the name of volume .

Returns:
The name for the given volume . The returned string should be freed when no longer needed.

std::string Gio::Volume::get_uuid (  )  const

Gets the UUID for the volume .

The reference is typically based on the file system UUID for the volume in question and should be considered an opaque string. Returns 0 if there is no UUID available.

Returns:
The UUID for volume or 0 if no UUID can be computed.

Glib::RefPtr<Icon> Gio::Volume::get_icon (  ) 

Gets the icon for volume .

Returns:
A G::Icon.

Glib::RefPtr<const Icon> Gio::Volume::get_icon (  )  const

Gets the icon for volume .

Returns:
A G::Icon.

Glib::RefPtr<Drive> Gio::Volume::get_drive (  ) 

Gets the drive for the volume .

Returns:
A G::Drive or 0 if volume is not associated with a drive.

Glib::RefPtr<const Drive> Gio::Volume::get_drive (  )  const

Gets the drive for the volume .

Returns:
A G::Drive or 0 if volume is not associated with a drive.

bool Gio::Volume::can_mount (  )  const

Checks if a volume can be mounted.

Returns:
true if the volume can be mounted. false otherwise.

bool Gio::Volume::can_eject (  )  const

Checks if a volume can be ejected.

Returns:
true if the volume can be ejected. false otherwise.

void Gio::Volume::mount ( const Glib::RefPtr<MountOperation>&  mount_operation,
const SlotAsyncReady slot,
const Glib::RefPtr<Cancellable>&  cancellable 
)

Mounts a volume.

This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.

Parameters:
slot A callback which will be called when the operation is completed or canceled.
cancellable A cancellable object which can be used to cancel the operation.
mount_operation A mount operation.

void Gio::Volume::mount ( const Glib::RefPtr<MountOperation>&  mount_operation,
const SlotAsyncReady slot 
)

Mounts a volume.

This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.

Parameters:
slot A callback which will be called when the operation is completed or canceled.
mount_operation A mount operation.

void Gio::Volume::mount ( const Glib::RefPtr<MountOperation>&  mount_operation  ) 

Mounts a volume.

Parameters:
mount_operation A mount operation.

void Gio::Volume::mount (  ) 

Mounts a volume.

bool Gio::Volume::mount_finish ( const Glib::RefPtr<AsyncResult>&  result  ) 

Finishes mounting a volume.

Parameters:
result A G::AsyncResult.
error A G::Error.
Returns:
true, false if operation failed.

void Gio::Volume::eject ( const SlotAsyncReady slot,
const Glib::RefPtr<Cancellable>&  cancellable,
MountUnmountFlags  flags = MOUNT_UNMOUNT_NONE 
)

Ejects a volume.

This is an asynchronous operation, and is finished by calling eject_finish() with the AsyncResult data returned in the callback slot.

Parameters:
slot A callback which will be called when the operation is completed or canceled.
cancellable A cancellable object which can be used to cancel the operation.
flags Flags affecting the unmount if required for eject.

void Gio::Volume::eject ( const SlotAsyncReady slot,
MountUnmountFlags  flags = MOUNT_UNMOUNT_NONE 
)

Ejects a volume.

This is an asynchronous operation, and is finished by calling eject_finish() with the AsyncResult data returned in the callback slot.

Parameters:
slot A callback which will be called when the operation is completed or canceled.
flags Flags affecting the unmount if required for eject.

void Gio::Volume::eject ( MountUnmountFlags  flags = MOUNT_UNMOUNT_NONE  ) 

Ejects a volume.

This is an asynchronous operation, and is finished by calling eject_finish() with the AsyncResult data returned in the callback slot.

Parameters:
flags Flags affecting the unmount if required for eject.

bool Gio::Volume::eject_finish ( const Glib::RefPtr<AsyncResult>&  result  ) 

Finishes ejecting a volume.

Parameters:
result A G::AsyncResult.
error A G::Error.
Returns:
true, false if operation failed.


Friends And Related Function Documentation

Glib::RefPtr<Gio::Volume> wrap ( GVolume *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:

Generated for glibmm 2.4 by Doxygen 1.5.1 © 1997-2001