Home · Modules · All Classes · All Namespaces
Public Member Functions | List of all members
Tp::FileTransferChannelCreationProperties Class Reference

The FileTransferChannelCreationProperties class represents the properties of a file transfer channel request. More...

#include <TelepathyQt/FileTransferChannelCreationProperties>

Public Member Functions

 FileTransferChannelCreationProperties ()
 
 FileTransferChannelCreationProperties (const QString &suggestedFileName, const QString &contentType, qulonglong size)
 
 FileTransferChannelCreationProperties (const QString &path, const QString &contentType)
 
 FileTransferChannelCreationProperties (const FileTransferChannelCreationProperties &other)
 
 ~FileTransferChannelCreationProperties ()
 
bool isValid () const
 
FileTransferChannelCreationPropertiesoperator= (const FileTransferChannelCreationProperties &other)
 
bool operator== (const FileTransferChannelCreationProperties &other) const
 
FileTransferChannelCreationPropertiessetContentHash (FileHashType contentHashType, const QString &contentHash)
 
FileTransferChannelCreationPropertiessetDescription (const QString &description)
 
FileTransferChannelCreationPropertiessetLastModificationTime (const QDateTime &lastModificationTime)
 
FileTransferChannelCreationPropertiessetUri (const QString &uri)
 
QString suggestedFileName () const
 
QString contentType () const
 
qulonglong size () const
 
bool hasContentHash () const
 
FileHashType contentHashType () const
 
QString contentHash () const
 
bool hasDescription () const
 
QString description () const
 
bool hasLastModificationTime () const
 
QDateTime lastModificationTime () const
 
bool hasUri () const
 
QString uri () const
 
QVariantMap createRequest () const
 
QVariantMap createRequest (const QString &contactIdentifier) const
 
QVariantMap createRequest (uint handle) const
 

Detailed Description

The FileTransferChannelCreationProperties class represents the properties of a file transfer channel request.

Constructor & Destructor Documentation

◆ FileTransferChannelCreationProperties() [1/4]

Tp::FileTransferChannelCreationProperties::FileTransferChannelCreationProperties ( )

◆ FileTransferChannelCreationProperties() [2/4]

Tp::FileTransferChannelCreationProperties::FileTransferChannelCreationProperties ( const QString &  suggestedFileName,
const QString &  contentType,
qulonglong  size 
)

Create a FileTransferChannelCreationProperties.

If suggestedFileName or contentType are empty or if size is equal to zero, the channel request will fail. suggestedFileName will be cleaned of any path.

Parameters
suggestedFileNameThe name of the file on the sender's side. This is therefore given as a suggested filename for the receiver.
contentTypeThe content type (MIME) of the file.
sizeThe size of the content of the file.
See also
setUri()

◆ FileTransferChannelCreationProperties() [3/4]

Tp::FileTransferChannelCreationProperties::FileTransferChannelCreationProperties ( const QString &  path,
const QString &  contentType 
)

Create a FileTransferChannelCreationProperties.

This constructor accepts the path to a local file and sets the properties that can be deducted from the file. If path is not a local file the FileTransferChannelCreationProperties will be invalid.

Parameters
pathThe path to the local file to be sent.

◆ FileTransferChannelCreationProperties() [4/4]

Tp::FileTransferChannelCreationProperties::FileTransferChannelCreationProperties ( const FileTransferChannelCreationProperties other)

Copy constructor.

◆ ~FileTransferChannelCreationProperties()

Tp::FileTransferChannelCreationProperties::~FileTransferChannelCreationProperties ( )

Class destructor.

Member Function Documentation

◆ isValid()

bool Tp::FileTransferChannelCreationProperties::isValid ( ) const
inline

◆ operator=()

FileTransferChannelCreationProperties & Tp::FileTransferChannelCreationProperties::operator= ( const FileTransferChannelCreationProperties other)

◆ operator==()

bool Tp::FileTransferChannelCreationProperties::operator== ( const FileTransferChannelCreationProperties other) const

◆ setContentHash()

FileTransferChannelCreationProperties & Tp::FileTransferChannelCreationProperties::setContentHash ( FileHashType  contentHashType,
const QString &  contentHash 
)

Set the content hash of the file and its type for the request.

Parameters
contentHashTypeThe type of content hash.
contentHashThe hash of the file, of type contentHashType.
Returns
This FileTransferChannelCreationProperties.
See also
hasContentHash(), contentHash(), contentHashType()

◆ setDescription()

FileTransferChannelCreationProperties & Tp::FileTransferChannelCreationProperties::setDescription ( const QString &  description)

Set a description of the file for the request.

Parameters
descriptionThe description of the file.
Returns
This FileTransferChannelCreationProperties.
See also
hasDescription(), description()

◆ setLastModificationTime()

FileTransferChannelCreationProperties & Tp::FileTransferChannelCreationProperties::setLastModificationTime ( const QDateTime &  lastModificationTime)

Set the last modification time of the file for the request.

Parameters
lastModificationTimeThe last modification time of the file.
Returns
This FileTransferChannelCreationProperties.
See also
hasLastModificationTime(), lastModificationTime()

◆ setUri()

FileTransferChannelCreationProperties & Tp::FileTransferChannelCreationProperties::setUri ( const QString &  uri)

Set the URI of the file for the request.

Parameters
uriThe URI of the file.
Returns
This FileTransferChannelCreationProperties.
See also
uri()

◆ suggestedFileName()

QString Tp::FileTransferChannelCreationProperties::suggestedFileName ( ) const

Return the suggested file name for the request. If the suggested file name is empty, the channel request will fail.

Returns
The suggested file name for the request.

◆ contentType()

QString Tp::FileTransferChannelCreationProperties::contentType ( ) const

Return the content type (MIME) of the file for the request. If the content type is empty, the channel request will fail.

Returns
The content type of the file.

◆ size()

qulonglong Tp::FileTransferChannelCreationProperties::size ( ) const

Return the size of the contents of the file for the request. If size is zero, the channel request will fail.

Returns
The size of the contents of file.

◆ hasContentHash()

bool Tp::FileTransferChannelCreationProperties::hasContentHash ( ) const

Return whether the request will have a content hash.

Returns
true whether it will have a content hash, false otherwise.
See also
contentHash(), contentHashType(), setContentHash()

◆ contentHashType()

FileHashType Tp::FileTransferChannelCreationProperties::contentHashType ( ) const

Return the type of the content hash for the request.

Returns
The type of the content hash.
See also
hasContentHash(), contentHash(), setContentHash()

◆ contentHash()

QString Tp::FileTransferChannelCreationProperties::contentHash ( ) const

Return the content hash of the file for the request.

Returns
The hash of the contents of the file transfer, of type returned by contentHashType().
See also
hasContentHash(), contentHashType(), setContentHash()

◆ hasDescription()

bool Tp::FileTransferChannelCreationProperties::hasDescription ( ) const

Return whether the request will have a descriprion.

Returns
true whether it will have description, false otherwise.
See also
description(), setDescription()

◆ description()

QString Tp::FileTransferChannelCreationProperties::description ( ) const

Return the description of the file for the request.

Returns
The description of the file.
See also
hasDescription(), setDescription()

◆ hasLastModificationTime()

bool Tp::FileTransferChannelCreationProperties::hasLastModificationTime ( ) const

Return whether the request will have a last modification time.

Returns
true whether it will have a last modification time, false otherwise.
See also
lastModificationTime(), setLastModificationTime()

◆ lastModificationTime()

QDateTime Tp::FileTransferChannelCreationProperties::lastModificationTime ( ) const

Return the last modification time of the file for the request.

Returns
The last modification time of the file.
See also
hasLastModificationTime(), setLastModificationTime()

◆ hasUri()

bool Tp::FileTransferChannelCreationProperties::hasUri ( ) const

Return whether the request will have an URI.

Returns
true whether it will have URI, false otherwise.
See also
uri(), setUri()

◆ uri()

QString Tp::FileTransferChannelCreationProperties::uri ( ) const

Return the URI of the file for the request. If the URI property is empty and the file transfer is handled by an handler that is not this process, then it won't be able to initiate the file transfer.

Returns
The URI of the file.
See also
setUri()

◆ createRequest() [1/3]

QVariantMap Tp::FileTransferChannelCreationProperties::createRequest ( ) const

◆ createRequest() [2/3]

QVariantMap Tp::FileTransferChannelCreationProperties::createRequest ( const QString &  contactIdentifier) const

◆ createRequest() [3/3]

QVariantMap Tp::FileTransferChannelCreationProperties::createRequest ( uint  handle) const