![]() |
![]() |
![]() |
libempathy Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <libempathy/empathy-tp-file.h> #define EMPATHY_TP_FILE_UNKNOWN_SIZE EmpathyTpFilePriv; EmpathyTpFile; EmpathyTpFile * empathy_tp_file_new (TpChannel *channel); TpChannel * empathy_tp_file_get_channel (EmpathyTpFile *tp_file); void empathy_tp_file_accept (EmpathyTpFile *tp_file, guint64 offset, GFile *gfile, GError **error); void empathy_tp_file_cancel (EmpathyTpFile *tp_file); void empathy_tp_file_offer (EmpathyTpFile *tp_file, GFile *gfile, GError **error); EmpathyContact * empathy_tp_file_get_contact (EmpathyTpFile *tp_file); const gchar * empathy_tp_file_get_filename (EmpathyTpFile *tp_file); gboolean empathy_tp_file_is_incoming (EmpathyTpFile *tp_file); TpFileTransferState empathy_tp_file_get_state (EmpathyTpFile *tp_file, TpFileTransferStateChangeReason *reason); guint64 empathy_tp_file_get_size (EmpathyTpFile *tp_file); guint64 empathy_tp_file_get_transferred_bytes (EmpathyTpFile *tp_file); gint empathy_tp_file_get_remaining_time (EmpathyTpFile *tp_file); gdouble empathy_tp_file_get_speed (EmpathyTpFile *tp_file); const gchar * empathy_tp_file_get_content_type (EmpathyTpFile *tp_file); gboolean empathy_tp_file_is_ready (EmpathyTpFile *tp_file);
"channel" TpChannel* : Read / Write / Construct Only "content-hash" gchar* : Read / Write "content-hash-type" guint : Read / Write "content-type" gchar* : Read / Write "filename" gchar* : Read / Write "incoming" gboolean : Read / Write / Construct "ready" gboolean : Read "size" guint64 : Read / Write "state" guint : Read / Write / Construct "transferred-bytes" guint64 : Read / Write
#define EMPATHY_TP_FILE_UNKNOWN_SIZE G_MAXUINT64
Value used for the "size" or "estimated-size" properties when the size of the transferred file is unknown.
typedef struct _EmpathyTpFile EmpathyTpFile;
Object which represents a Telepathy file channel.
EmpathyTpFile * empathy_tp_file_new (TpChannel *channel);
Creates a new EmpathyTpFile wrapping channel
, or return a new ref to an
existing EmpathyTpFile for that channel. The returned EmpathyTpFile
should be unrefed with g_object_unref()
when finished with.
|
a TpChannel |
Returns : |
a new EmpathyTpFile |
TpChannel * empathy_tp_file_get_channel (EmpathyTpFile *tp_file);
Returns the TpChannel associated with tp_file
.
|
an EmpathyTpFile |
Returns : |
the TpChannel associated with tp_file
|
void empathy_tp_file_accept (EmpathyTpFile *tp_file, guint64 offset, GFile *gfile, GError **error);
Accepts a file transfer that's in the "local pending" state (i.e.
TP_FILE_TRANSFER_STATE_LOCAL_PENDING
).
|
an EmpathyTpFile |
|
position where to start the transfer |
|
a GFile where to write transfered data |
|
a GError set if there is an error when opening gfile
|
void empathy_tp_file_cancel (EmpathyTpFile *tp_file);
Cancels the file transfer, tp_file
.
|
an EmpathyTpFile |
void empathy_tp_file_offer (EmpathyTpFile *tp_file, GFile *gfile, GError **error);
Offers a file transfer that's in the "not offered" state (i.e.
TP_FILE_TRANSFER_STATE_NOT_OFFERED
).
|
an EmpathyTpFile |
|
a GFile where to read the data to transfer |
|
a GError set if there is an error when opening gfile
|
EmpathyContact * empathy_tp_file_get_contact (EmpathyTpFile *tp_file);
Returns the EmpathyContact that tp_file
is open with.
|
an EmpathyTpFile |
Returns : |
the EmpathyContact that tp_file is open with.
|
const gchar * empathy_tp_file_get_filename (EmpathyTpFile *tp_file);
|
|
Returns : |
gboolean empathy_tp_file_is_incoming (EmpathyTpFile *tp_file);
Returns whether tp_file
is incoming.
|
an EmpathyTpFile |
Returns : |
TRUE if the tp_file is incoming, otherwise FALSE
|
TpFileTransferState empathy_tp_file_get_state (EmpathyTpFile *tp_file, TpFileTransferStateChangeReason *reason);
Gets the current state of tp_file
. If reason
is not NULL
, then
it is set to the reason of the last state change.
|
an EmpathyTpFile |
|
return location for state change reason, or NULL
|
Returns : |
a TpFileTransferState |
guint64 empathy_tp_file_get_size (EmpathyTpFile *tp_file);
Gets the size of the file being transferred over tp_file
, in bytes.
|
an EmpathyTpFile |
Returns : |
the size of the file being transferred, in bytes |
guint64 empathy_tp_file_get_transferred_bytes (EmpathyTpFile *tp_file);
Gets the number of transferred bytes of tp_file
so far, in bytes.
|
an EmpathyTpFile |
Returns : |
number of transferred bytes of tp_file , in bytes
|
gint empathy_tp_file_get_remaining_time (EmpathyTpFile *tp_file);
Gets the estimated time remaining of tp_file
, in seconds.
|
a EmpathyTpFile |
Returns : |
the estimated time remaining of tp_file , in seconds
|
gdouble empathy_tp_file_get_speed (EmpathyTpFile *tp_file);
Gets the current speed of the transfer tp_file
, in bytes per
second.
|
an EmpathyTpFile |
Returns : |
the current speed of the transfer tp_file , in
bytes per second
|
const gchar * empathy_tp_file_get_content_type (EmpathyTpFile *tp_file);
|
|
Returns : |
gboolean empathy_tp_file_is_ready (EmpathyTpFile *tp_file);
Returns whether the file channel tp_file
is ready for use.
tp_file
is classed as ready if its state is no longer
TP_FILE_TRANSFER_STATE_NONE
, or if details about the remote
contact have been fully received.
|
an EmpathyTpFile |
Returns : |
TRUE if tp_file is ready for use
|
"channel"
property"channel" TpChannel* : Read / Write / Construct Only
The TpChannel associated with the EmpathyTpFile.
"content-hash"
property"content-hash" gchar* : Read / Write
A hash of the contents of the file being transferred.
Default value: ""
"content-hash-type"
property"content-hash-type" guint : Read / Write
The type of hash type stored in "content-hash", from TpFileHashType.
Default value: 0
"content-type"
property"content-type" gchar* : Read / Write
The content-type of the file being transferred.
Default value: ""
"filename"
property"filename" gchar* : Read / Write
The name of the file being transferred.
Default value: ""
"incoming"
property"incoming" gboolean : Read / Write / Construct
Whether the EmpathyTpFile is incoming.
Default value: FALSE
"ready"
property"ready" gboolean : Read
Whether the EmpathyTpFile is ready to use. This property returns
the same as empathy_tp_file_is_ready()
.
Default value: FALSE
"size"
property"size" guint64 : Read / Write
The size of the file being transferred.
Default value: 18446744073709551615
"state"
property"state" guint : Read / Write / Construct
The TpFileTransferState of the EmpathyTpFile.
Default value: 4294967295
"transferred-bytes"
property"transferred-bytes" guint64 : Read / Write
The number of bytes transferred in the EmpathyTpFile.
Default value: 0
"refresh"
signalvoid user_function (EmpathyTpFile *tp_file, gpointer user_data) : Run Last
The progress of tp_file
has changed. This can either be an update
in the number of bytes transferred, or it can be to inform of the
transfer stalling.
This signal is designed for clients to provide more user feedback
when something to do with tp_file
changes. To avoid emitting this
signal too much, it is guaranteed that it will only ever be fired
at least every two seconds.
|
the EmpathyTpFile |
|
user data set when the signal handler was connected. |