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 Type | type() const Return the type of picture attachment |
| virtual BMXMessageAttachmentPtr | clone() const Cloning function |
| const [Size] & | size() const Picture size |
| const std::string & | thumbnailUrl() const Thumbnail url for remote use |
| void | setThumbnail(const std::string & path) Set a thumbnail for sent picture |
| const std::string & | thumbnailPath() const Local path of thumbnail |
| DownloadStatus | thumbnailDownloadStatus() 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_t | fileLength() const File length |
| DownloadStatus | downloadStatus() const Attachment download state |
Protected Attributes inherited from floo::BMXFileAttachment
| Name | |
|---|---|
| std::string | mPath |
| std::string | mDisplayName |
| std::string | mRatelUrl |
| std::string | mUrl |
| int64_t | mFileLength |
| DownloadStatus | mDownloadStatus |
Friends inherited from floo::BMXFileAttachment
| Name | |
|---|---|
| class | Encoder< BMXFileAttachment > |
| class | Decoder< BMXFileAttachment > |
Public Types inherited from floo::BMXMessageAttachment
| Name | |
|---|---|
| enum class | Type { Image, Voice, Video, File, Location, Command, Forward} Attachment type |
| enum class | DownloadStatus { 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