TelepathyGLib.FileTransferChannel¶
- Subclasses:
None
Methods¶
- Inherited:
TelepathyGLib.Channel (44), TelepathyGLib.Proxy (11), GObject.Object (37)
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
The Date property of this channel |
||
r |
The Description property of this channel |
||
r |
A |
||
r |
The Filename property of this channel |
||
r |
The InitialOffset property of this channel |
||
r |
The ContentType property of this channel |
||
r |
The Metadata.ServiceName property of this channel |
||
r |
The Size property of this channel |
||
r |
The |
||
r |
The TransferredBytes property of this channel |
Signals¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class TelepathyGLib.FileTransferChannel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Data structure representing a
TelepathyGLib.FileTransferChannel.Added in version 0.15.5.
- classmethod new(conn, object_path, immutable_properties)¶
- Parameters:
conn (
TelepathyGLib.Connection) – aTelepathyGLib.Connection; may not beNoneobject_path (
str) – the object path of the channel; may not beNoneimmutable_properties ({
str:GObject.Value}) – the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + “.” + property name) toGObject.Valueinstances
- Raises:
- Returns:
a newly created
TelepathyGLib.FileTransferChannel- Return type:
Convenient function to create a new
TelepathyGLib.FileTransferChannelAdded in version 0.15.5.
Deprecated since version ???: Use
TelepathyGLib.SimpleClientFactory.ensure_channel() instead.
- accept_file_async(file, offset, callback, *user_data)¶
- Parameters:
Accept an incoming file transfer in the
TelepathyGLib.FileTransferState.PENDINGstate. Once the accept has been processed, callback will be called. You can then callTelepathyGLib.FileTransferChannel.accept_file_finish() to get the result of the operation.Added in version 0.17.1.
- accept_file_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
- Return type:
Finishes a call to
TelepathyGLib.FileTransferChannel.accept_file_async().Added in version 0.17.1.
- get_date()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:dateproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:datepropertyAdded in version 0.15.5.
- get_description()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:descriptionproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:descriptionpropertyAdded in version 0.15.5.
- get_filename()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:filenameproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:filenamepropertyAdded in version 0.15.5.
- get_metadata()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:metadataproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:metadatapropertyAdded in version 0.17.1.
- get_mime_type()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:mime-typeproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:mime-typepropertyAdded in version 0.15.5.
- get_service_name()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:service-nameproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:service-namepropertyAdded in version 0.17.1.
- get_size()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:sizeproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:sizepropertyAdded in version 0.15.5.
- get_state()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:stateproperty- reason:
- Return type:
(
TelepathyGLib.FileTransferState, reason:TelepathyGLib.FileTransferStateChangeReason)
Returns the
TelepathyGLib.FileTransferChannel:stateproperty.If reason is not
Noneit is set to the reason whyTelepathyGLib.FileTransferChannel:statechanged to its current value.Added in version 0.17.1.
- get_transferred_bytes()¶
- Returns:
the value of the
TelepathyGLib.FileTransferChannel:transferred-bytesproperty- Return type:
Return the
TelepathyGLib.FileTransferChannel:transferred-bytespropertyAdded in version 0.15.5.
- provide_file_async(file, callback, *user_data)¶
- Parameters:
Provide a file transfer. This should be called when the file transfer state changes (
TelepathyGLib.FileTransferChannel.get_state() and the “notify::state” signal) toTelepathyGLib.FileTransferState.ACCEPTEDorTelepathyGLib.FileTransferState.PENDING. Once the file has been provided, the channelTelepathyGLib.FileTransferChannel:statewill change toTelepathyGLib.FileTransferState.OPEN.Once the file has been provided, callback will be called. You should then call
TelepathyGLib.FileTransferChannel.provide_file_finish() to get the result of the operation.Added in version 0.17.1.
- provide_file_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
- Return type:
Finishes a call to
TelepathyGLib.FileTransferChannel.provide_file_async().Successful return from this function does not mean that the file transfer has completed or has even started at all. The state of the file transfer should be monitored with the “notify::state” signal.
Added in version 0.17.1.
Property Details¶
- TelepathyGLib.FileTransferChannel.props.date¶
- Name:
date- Type:
- Default Value:
- Flags:
A
GLib.DateTimerepresenting the last modification time of the file to be transferred.Added in version 0.15.5.
- TelepathyGLib.FileTransferChannel.props.description¶
-
The description of the file transfer, defined by the sender when sending the file transfer offer.
Added in version 0.15.5.
- TelepathyGLib.FileTransferChannel.props.file¶
-
For incoming file transfers, this property will be set to a
Gio.Filefor the location where the file will be saved (given byTelepathyGLib.FileTransferChannel.accept_file_async()) when the transfer starts. The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE must already be prepared for this property to have a meaningful value, and to receive change notification. Once the initial value is set, this property will not be changed.For outgoing file transfers, this property is a
Gio.Filefor the location of the file being sent (given byTelepathyGLib.FileTransferChannel.provide_file_async()). The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE does not have to be prepared and there is no change notification.Added in version 0.17.1.
- TelepathyGLib.FileTransferChannel.props.filename¶
-
The name of the file on the sender’s side. This is therefore given as a suggested filename for the receiver.
Added in version 0.15.5.
- TelepathyGLib.FileTransferChannel.props.initial_offset¶
-
The offset in bytes from where the file should be sent.
The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.
Added in version 0.17.1.
- TelepathyGLib.FileTransferChannel.props.mime_type¶
-
The MIME type of the file to be transferred.
Added in version 0.15.5.
- TelepathyGLib.FileTransferChannel.props.service_name¶
-
A string representing the name of the service suggested to handle this file transfer channel, or
Noneif the initiator did not provide one.This is a useful way of requesting file transfer channels with a hint of what handler they should be handled by on the remote side. If a channel request is made with this property set (to a contact who also supports the metadata extension; see the requestable channel classes for said contact), this property will be set to the same value on the remote incoming channel and handlers can match on this in their handler filter. For example, a remote handler could call the following:
tp_base_client_take_handler_filter (handler, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME, G_TYPE_STRING, "service.name", NULL));
The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful.
Added in version 0.17.1.
- TelepathyGLib.FileTransferChannel.props.size¶
-
The size of the file to be transferred, or
GObject.G_MAXUINT64if not known.Added in version 0.15.5.
- TelepathyGLib.FileTransferChannel.props.state¶
-
A
TelepathyGLib.FileTransferStateholding the state of the file transfer.The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.
Added in version 0.17.1.
- TelepathyGLib.FileTransferChannel.props.transferred_bytes¶
-
The number of bytes transferred so far in this file transfer.
The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.
Added in version 0.15.5.