Content

public class Content : LinphoneObject

The LinphoneContent object holds data that can be embedded in a signaling message.

  • Get the content data buffer, usually a string.

    Declaration

    Swift

    public var buffer: UnsafePointer<UInt8> { get }

    Return Value

    The content data buffer.

  • Get the encoding of the data buffer, for example “gzip”.

    Declaration

    Swift

    public var encoding: String { get set }

    Return Value

    The encoding of the data buffer.

  • Get the file transfer filepath set for this content (replace linphone_chat_message_get_file_transfer_filepath).

    Declaration

    Swift

    public var filePath: String { get set }

    Return Value

    The file path set for this content if it has been set, nil otherwise.

  • Get the file size if content is either a FileContent or a FileTransferContent.

    Declaration

    Swift

    public var fileSize: Int { get }

    Return Value

    The represented file size.

  • Tells whether or not this content contains a file.

    Declaration

    Swift

    public var isFile: Bool { get }

    Return Value

    True if this content contains a file, false otherwise.

  • Tells whether or not this content is a file transfer.

    Declaration

    Swift

    public var isFileTransfer: Bool { get }

    Return Value

    True if this content is a file transfer, false otherwise.

  • Tell whether a content is a multipart content.

    Declaration

    Swift

    public var isMultipart: Bool { get }

    Return Value

    A boolean value telling whether the content is multipart or not.

  • Tells whether or not this content contains text.

    Declaration

    Swift

    public var isText: Bool { get }

    Return Value

    True if this content contains plain text, false otherwise.

  • key

    Get the key associated with a RCS file transfer message if encrypted.

    Declaration

    Swift

    public var key: String { get }

    Return Value

    The key to encrypt/decrypt the file associated to this content.

  • Get the size of key associated with a RCS file transfer message if encrypted.

    Declaration

    Swift

    public var keySize: Int { get }

    Return Value

    The key size in bytes

  • Get the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server.

    Declaration

    Swift

    public var name: String { get set }

    Return Value

    The name of the content.

  • Get all the parts from a multipart content.

    Declaration

    Swift

    public var parts: [Content] { get }

    Return Value

    A A list of Content objects. LinphoneContent The objects inside the list are freshly allocated with a reference counter equal to one, so they need to be freed on list destruction with bctbx_list_free_with_data() for instance. object holding the part if found, nil otherwise.

  • Get the content data buffer size, excluding null character despite null character is always set for convenience.

    Declaration

    Swift

    public var size: Int { get set }

    Return Value

    The content data buffer size.

  • Get the string content data buffer.

    Declaration

    Swift

    public var stringBuffer: String { get set }

    Return Value

    The string content data buffer.

  • Get the mime subtype of the content data.

    Declaration

    Swift

    public var subtype: String { get set }

    Return Value

    The mime subtype of the content data, for example “html”.

  • Get the mime type of the content data.

    Declaration

    Swift

    public var type: String { get set }

    Return Value

    The mime type of the content data, for example “application”.

  • Adds a parameter to the ContentType header.

    Declaration

    Swift

    public func addContentTypeParameter(name: String, value: String)

    Parameters

    name

    the name of the parameter to add.

    value

    the value of the parameter to add.

  • Find a part from a multipart content looking for a part header with a specified value.

    Declaration

    Swift

    public func findPartByHeader(headerName: String, headerValue: String) -> Content?

    Parameters

    headerName

    The name of the header to look for.

    headerValue

    The value of the header to look for.

    Return Value

    A Content object object the part if found, nil otherwise.

  • Get a custom header value of a content.

    Declaration

    Swift

    public func getCustomHeader(headerName: String) -> String

    Parameters

    headerName

    The name of the header to get the value from.

    Return Value

    The value of the header if found, nil otherwise.

  • Get a part from a multipart content according to its index.

    Declaration

    Swift

    public func getPart(idx: Int) -> Content?

    Parameters

    idx

    The index of the part to get.

    Return Value

    A Content object holding the part if found, nil otherwise.

  • Set the content data buffer, usually a string.

    Declaration

    Swift

    public func setBuffer(buffer: UnsafePointer<UInt8>, size: Int)

    Parameters

    buffer

    The content data buffer.

    size

    The size of the content data buffer.

  • Set the key associated with a RCS file transfer message if encrypted.

    Declaration

    Swift

    public func setKey(key: String, keyLength: Int)

    Parameters

    key

    The key to be used to encrypt/decrypt file associated to this content.

    keyLength

    The lengh of the key.