Class Content
This object holds data that can be embedded in a signaling message.
Use CreateContent() to create it, and then you should set at least it's type and subtype and fill the buffer with your data. A Content can be multipart (contain other contents), have file information (name, path, size), be encrypted, have custom headers, etc... It is mainly used to send information through a ChatMessage.
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class Content : LinphoneObject
Properties
Buffer
Get the content data buffer, usually a string.
Declaration
public uint Buffer { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | The content data buffer. |
Encoding
Get the encoding of the data buffer, for example "gzip".
Declaration
public string Encoding { get; set; }
Property Value
Type | Description |
---|---|
System.String | The encoding of the data buffer. |
FilePath
Get the file transfer filepath set for this content (replace linphone_chat_message_get_file_transfer_filepath).
Declaration
public string FilePath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The file path set for this content if it has been set, null otherwise. |
FileSize
Get the file size if content is either a FileContent or a FileTransferContent.
Declaration
public long FileSize { get; }
Property Value
Type | Description |
---|---|
System.Int64 | The represented file size. |
IsFile
Tells whether or not this content contains a file.
Declaration
public bool IsFile { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if this content contains a file, false otherwise. |
IsFileEncrypted
Tells whether or not this content contains an encrypted file.
Declaration
public bool IsFileEncrypted { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True is this content contains a file and this file is encrypted, false otherwise. |
IsFileTransfer
Tells whether or not this content is a file transfer.
Declaration
public bool IsFileTransfer { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if this content is a file transfer, false otherwise. |
IsMultipart
Tell whether a content is a multipart content.
Declaration
public bool IsMultipart { get; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean value telling whether the content is multipart or not. |
IsText
Tells whether or not this content contains text.
Declaration
public bool IsText { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if this content contains plain text, false otherwise. |
Key
Get the key associated with a RCS file transfer message if encrypted.
Declaration
public string Key { get; }
Property Value
Type | Description |
---|---|
System.String | The key to encrypt/decrypt the file associated to this content. |
KeySize
Get the size of key associated with a RCS file transfer message if encrypted.
Declaration
public long KeySize { get; }
Property Value
Type | Description |
---|---|
System.Int64 | The key size in bytes |
Name
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
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the content. |
Parts
Get all the parts from a multipart content.
Declaration
public IEnumerable<Content> Parts { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Content> | A object holding the part if found, null otherwise. |
PlainFilePath
If the content is an encrypted file, generate a temporary plain copy of the file and returns its paths The caller is responsible to then delete this temporary copy and the returned string.
Declaration
public string PlainFilePath { get; }
Property Value
Type | Description |
---|---|
System.String | The file path set for this content if it has been set, null otherwise. |
Size
Get the content data buffer size, excluding null character despite null character is always set for convenience.
Declaration
public long Size { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 | The content data buffer size. |
StringBuffer
Get the string content data buffer.
Declaration
public string StringBuffer { get; set; }
Property Value
Type | Description |
---|---|
System.String | The string content data buffer. |
Subtype
Get the mime subtype of the content data.
Declaration
public string Subtype { get; set; }
Property Value
Type | Description |
---|---|
System.String | The mime subtype of the content data, for example "html". |
Type
Get the mime type of the content data.
Declaration
public string Type { get; set; }
Property Value
Type | Description |
---|---|
System.String | The mime type of the content data, for example "application". |
Utf8Text
Get the string content data buffer.
Introduced in 01/07/2020
Declaration
public string Utf8Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | The string content data buffer in UTF8. |
Methods
AddContentTypeParameter(String, String)
Adds a parameter to the ContentType header.
Declaration
public void AddContentTypeParameter(string name, string val)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name of the parameter to add. |
System.String | val | the value of the parameter to add. |
FindPartByHeader(String, String)
Find a part from a multipart content looking for a part header with a specified value.
Declaration
public Content FindPartByHeader(string headerName, string headerValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | The name of the header to look for. |
System.String | headerValue | The value of the header to look for. |
Returns
Type | Description |
---|---|
Content | A Content object object the part if found, null otherwise. |
GetCustomHeader(String)
Get a custom header value of a content.
Declaration
public string GetCustomHeader(string headerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | The name of the header to get the value from. |
Returns
Type | Description |
---|---|
System.String | The value of the header if found, null otherwise. |
GetPart(Int32)
Get a part from a multipart content according to its index.
Declaration
public Content GetPart(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the part to get. |
Returns
Type | Description |
---|---|
Content | A Content object holding the part if found, null otherwise. |
SetBuffer(UInt32, Int64)
Set the content data buffer, usually a string.
Declaration
public void SetBuffer(uint buffer, long size)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | buffer | The content data buffer. |
System.Int64 | size | The size of the content data buffer. |
SetKey(String, Int64)
Set the key associated with a RCS file transfer message if encrypted.
Declaration
public void SetKey(string key, long keyLength)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to be used to encrypt/decrypt file associated to this content. |
System.Int64 | keyLength | The lengh of the key. |