File Transfer Task

File Transfer Task — Monitoring file transfers

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <spice-client.h>

struct              SpiceFileTransferTask;
struct              SpiceFileTransferTaskClass;

double              spice_file_transfer_task_get_progress
                                                        (SpiceFileTransferTask *self);
char *              spice_file_transfer_task_get_filename
                                                        (SpiceFileTransferTask *self);
void                spice_file_transfer_task_cancel     (SpiceFileTransferTask *self);

Object Hierarchy

  GObject
   +----SpiceFileTransferTask

Properties

  "cancellable"              GCancellable*         : Read / Write / Construct Only
  "channel"                  SpiceMainChannel*     : Read / Write / Construct Only
  "file"                     GFile*                : Read / Write / Construct Only
  "id"                       guint                 : Read / Write / Construct Only
  "progress"                 gdouble               : Read

Signals

  "finished"                                       : Run First

Description

SpiceFileTransferTask is an object that represents a particular file transfer between the client and the guest. The properties and signals of the object can be used to monitor the status and result of the transfer. The Main Channel's "new-file-transfer" signal will be emitted whenever a new file transfer task is initiated.

Details

struct SpiceFileTransferTask

struct SpiceFileTransferTask;

The FileTransferTask struct is opaque and should not be accessed directly.


struct SpiceFileTransferTaskClass

struct SpiceFileTransferTaskClass {
    GObjectClass parent_class;
};

Class structure for SpiceFileTransferTask.

GObjectClass parent_class;

Parent class.

spice_file_transfer_task_get_progress ()

double              spice_file_transfer_task_get_progress
                                                        (SpiceFileTransferTask *self);

Convenience function for retrieving the current progress of this file transfer task.

self :

a file transfer task

Returns :

A percentage value between 0 and 100

Since 0.31


spice_file_transfer_task_get_filename ()

char *              spice_file_transfer_task_get_filename
                                                        (SpiceFileTransferTask *self);

Gets the name of the file being transferred in this task

self :

a file transfer task

Returns :

The basename of the file. [transfer none]

Since 0.31


spice_file_transfer_task_cancel ()

void                spice_file_transfer_task_cancel     (SpiceFileTransferTask *self);

Cancels the file transfer task. Note that depending on how the file transfer was initiated, multiple file transfer tasks may share a single "cancellable" object, so canceling one task may result in the cancellation of other tasks.

self :

a file transfer task

Since 0.31

Property Details

The "cancellable" property

  "cancellable"              GCancellable*         : Read / Write / Construct Only

A cancellable object used to cancel the file transfer

Since 0.31


The "channel" property

  "channel"                  SpiceMainChannel*     : Read / Write / Construct Only

The main channel that owns the file transfer task

Since 0.31


The "file" property

  "file"                     GFile*                : Read / Write / Construct Only

The file that is being transferred in this file transfer task

Since 0.31


The "id" property

  "id"                       guint                 : Read / Write / Construct Only

The ID of the file transfer task

Default value: 0

Since 0.31


The "progress" property

  "progress"                 gdouble               : Read

The current state of the file transfer. This value indicates a percentage, and ranges from 0 to 100. Listen for change notifications on this property to be updated whenever the file transfer progress changes.

Allowed values: [0,100]

Default value: 0

Since 0.31

Signal Details

The "finished" signal

void                user_function                      (SpiceFileTransferTask *task,
                                                        GError                *error,
                                                        gpointer               user_data)      : Run First

The "finished" signal is emitted when the file transfer has completed transferring to the guest.

task :

the file transfer task that emitted the signal

error :

the error state of the transfer. Will be NULL if the file transfer was successful. [transfer none]

user_data :

user data set when the signal handler was connected.

Since 0.31

See Also

SpiceMainChannel