LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXImageAttachment#

Message picture attachment

#include <bmx_image_attachment.h>

Inherits from floo::BMXFileAttachment, floo::BMXMessageAttachment, BMXBaseObject

Public Functions#

Name
BMXImageAttachment(const std::string & path, const [Size] & size, const std::string & displayName ="")
Constructor, to build the message attachment of sent picture
BMXImageAttachment(const std::string & ratelUrl, const [Size] & size, const std::string & displayName, int64_t fileLength)
Constructor, to build the message attachment of received picture
virtual~BMXImageAttachment()
Destructor
virtual Typetype() const
Return the type of picture attachment
virtual BMXMessageAttachmentPtrclone() const
Cloning function
const [Size] &size() const
Picture size
const std::string &thumbnailUrl() const
Thumbnail url for remote use
voidsetThumbnail(const std::string & path)
Set a thumbnail for sent picture
const std::string &thumbnailPath() const
Local path of thumbnail
DownloadStatusthumbnailDownloadStatus() const
Thumbnail downloading state

Friends#

Additional inherited members#

Public Functions inherited from floo::BMXFileAttachment

Name
BMXFileAttachment(const std::string & path, const std::string & displayName ="")
Constructor to build the message attachment of sent file
BMXFileAttachment(const std::string & ratelUrl, const std::string & displayName, int64_t fileLength)
Constructor to build the message attachment of received file
virtual~BMXFileAttachment()
Destructor
const std::string &path() const
Local path
const std::string &displayName() const
Display name
const std::string &ratelUrl() const
URL for remote ratel
const std::string &url() const
URL for remote
int64_tfileLength() const
File length
DownloadStatusdownloadStatus() const
Attachment download state

Protected Attributes inherited from floo::BMXFileAttachment

Name
std::stringmPath
std::stringmDisplayName
std::stringmRatelUrl
std::stringmUrl
int64_tmFileLength
DownloadStatusmDownloadStatus

Friends inherited from floo::BMXFileAttachment

Public Types inherited from floo::BMXMessageAttachment

Name
enum classType { Image, Voice, Video, File, Location, Command, Forward}
Attachment type
enum classDownloadStatus { Downloaing, Successed, Failed, NotStart, Canceled}
Attachment download state

Public Functions inherited from floo::BMXMessageAttachment

Name
BMXMessageAttachment()
Constructor
virtual~BMXMessageAttachment()
Destructor

Public Functions Documentation#

function BMXImageAttachment#

BMXImageAttachment(
    const std::string & path,
    const Size & size,
    const std::string & displayName =""
)

Constructor, to build the message attachment of sent picture

Parameters:

  • path Local path
  • size Size, width, and height of image
  • displayName Display name

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="BMXImageAttachment" %}{% endlanying_code_snippet %}

function BMXImageAttachment#

BMXImageAttachment(
    const std::string & ratelUrl,
    const Size & size,
    const std::string & displayName,
    int64_t fileLength
)

Constructor, to build the message attachment of received picture

Parameters:

  • url Address of image ratel server
  • size Size, width, and height of image
  • displayName Display name
  • fileLength File size

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="BMXImageAttachment" %}{% endlanying_code_snippet %}

function ~BMXImageAttachment#

inline virtual ~BMXImageAttachment()

Destructor

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="~BMXImageAttachment" %}{% endlanying_code_snippet %}

function type#

inline virtual Type type() const

Return the type of picture attachment

Return: Type

Reimplements: floo::BMXFileAttachment::type

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="type" %}{% endlanying_code_snippet %}

function clone#

virtual BMXMessageAttachmentPtr clone() const

Cloning function

Return: BMXMessageAttachmentPtr

Reimplements: floo::BMXFileAttachment::clone

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="clone" %}{% endlanying_code_snippet %}

function size#

const Size & size() const

Picture size

Return: Size

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="size" %}{% endlanying_code_snippet %}

function thumbnailUrl#

const std::string & thumbnailUrl() const

Thumbnail url for remote use

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="thumbnailUrl" %}{% endlanying_code_snippet %}

function setThumbnail#

void setThumbnail(
    const std::string & path
)

Set a thumbnail for sent picture

Parameters:

  • path Local path

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="setThumbnail" %}{% endlanying_code_snippet %}

function thumbnailPath#

const std::string & thumbnailPath() const

Local path of thumbnail

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="thumbnailPath" %}{% endlanying_code_snippet %}

function thumbnailDownloadStatus#

DownloadStatus thumbnailDownloadStatus() const

Thumbnail downloading state

Return: DownloadStatus

Friends#

friend Encoder< BMXImageAttachment >#

friend class Encoder< BMXImageAttachment >(
    Encoder< BMXImageAttachment > 
);

friend Decoder< BMXImageAttachment >#

friend class Decoder< BMXImageAttachment >(
    Decoder< BMXImageAttachment > 
);

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXImageAttachment",function="thumbnailDownloadStatus" %}{% endlanying_code_snippet %}

Updated on 2022-01-26 at 17:20:40 +0800

Generated API content with concise AI notes where context helps.