This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
A channel type for files offered for transferring. The actual transmission of the data is done by reading or writing a socket, the type of socket (local Unix, IPv4, etc.) when the File channel is created.
The Telepathy client should connect to the socket or address that the connection manager has set up and provided back to the clients through the two methods.
If something goes wrong with the transfer, you should call Close on the channel.
The File channel type may be requested for handles of type HANDLE_TYPE_CONTACT. If the channel is requested for any other handle type then the behviour is undefined.
The state of the file transfer as described by the File_Transfer_State enum.
The file's MIME type. This cannot change once the channel has been created.
This property is mandatory when requesting the channel with the CreateChannels requests method. Protocols which do not have a content-type property with file transfers should set this value to application/octet-stream.
The name of the file on the sender's side. This is therefore given as a suggested filename for the receiver. This cannot change once the channel has been created.
This property should be the basename of the file being sent. For example, if the sender sends the file /home/user/monkey.pdf then this property should be set to monkey.pdf.
This property is mandatory when requesting the channel with the CreateChannels requests method. This property cannot be empty and must be set to a sensible value.
The size of the file. If this property is set, then the file transfer is guaranteed to be this size. This cannot change once the channel has been created.
When you are creating a channel with this property, its value MUST be accurate and in bytes. However, when receiving a file, this property still must be in bytes but might not be entirely accurate to the byte.
This property is mandatory when requesting the channel with the CreateChannels requests method. If this property is UINT64_MAX, then its value is unspecified.
The type of the ContentHash property from values of the File_Hash_Type enum.
This property is optional when requesting the channel with the CreateChannels requests method. However, if you wish to include the ContentHash property you MUST also include this property. If you omit this property from a CreateChannels method call then its value will be assumed to be File_Hash_Type_None.
Hash of the contents of the file transfer, of type described in the value of the ContentHashType property.
This property is optional when requesting the channel with the CreateChannels requests method. Its value MUST correspond to the appropriate type of the ContentHashType property. If the ContentHashType property is not set, or set to File_Hash_Type_None, then this property will not even be looked at.
Description of the file transfer. This cannot change once the channel has been created.
This property is optional when requesting the channel with the CreateChannel requests method. If this property is an empty string, then its value is unspecified.
A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for sockets with that address type. For simplicity, if a CM supports offering a particular type of file transfer, it is assumed to support accepting it.
A typical value for a host that supports only Unix sockets:
{ Socket_Address_Type_Unix: [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials] Socket_Address_Type_Abstract_Unix: [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials] }
The number of bytes that have been transferred at the time of requesting the property. This will be updated as the file transfer continues.
The offset from the beginning of the file that the transfer should start from. This should be checked by the receiver after the transfer changes state from Accepted to Open.
Before setting the State property to Open, the connection manager MUST set the InitialOffset property. If there is no offset then this value MUST be set to 0.
This property MUST NOT change after the state of the transfer has changed to Open.