floo::BMXImageAttachment

图片消息附件

#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 ="")
构造函数,构建发送图片消息附件
BMXImageAttachment(const std::string & ratelUrl, const [Size] & size, const std::string & displayName, int64_t fileLength)
构造函数,构建接收图片消息附件
virtual ~BMXImageAttachment()
析构函数
virtual Type type() const
返回图片附件类型
virtual BMXMessageAttachmentPtr clone() const
克隆函数
const [Size] & size() const
图片大小
const std::string & thumbnailUrl() const
远程使用缩略图URL
void setThumbnail(const std::string & path)
设置发送图片消息缩略图
const std::string & thumbnailPath() const
缩略图本地路径
DownloadStatus thumbnailDownloadStatus() const
缩略图下载状态

Friends

Name
class Encoder< BMXImageAttachment >
class Decoder< BMXImageAttachment >

Additional inherited members

Public Functions inherited from floo::BMXFileAttachment

Name
BMXFileAttachment(const std::string & path, const std::string & displayName ="")
构造函数,构建发送文件消息附件
BMXFileAttachment(const std::string & ratelUrl, const std::string & displayName, int64_t fileLength)
构造函数,构建接收文件消息附件
virtual ~BMXFileAttachment()
析构函数
const std::string & path() const
本地路径
const std::string & displayName() const
显示名
const std::string & ratelUrl() const
远程ratel使用URL
const std::string & url() const
远程使用URL
int64_t fileLength() const
文件长度
DownloadStatus downloadStatus() const
附件下载状态

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}
附件类型
enum class DownloadStatus { Downloaing, Successed, Failed, NotStart, Canceled}
附件下载状态

Public Functions inherited from floo::BMXMessageAttachment

Name
BMXMessageAttachment()
构造函数
virtual ~BMXMessageAttachment()
析构函数

Public Functions Documentation

function BMXImageAttachment

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

构造函数,构建发送图片消息附件

Parameters:

  • path 本地路径
  • size 图片的大小,宽度和高度
  • displayName 展示名

Example:

function BMXImageAttachment

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

构造函数,构建接收图片消息附件

Parameters:

  • url 图片ratel服务器地址
  • size 图片的大小,宽度和高度
  • displayName 展示名
  • fileLength 文件大小

Example:

function ~BMXImageAttachment

inline virtual ~BMXImageAttachment()

析构函数

Example:

function type

inline virtual Type type() const

返回图片附件类型

Return: Type

Reimplements: floo::BMXFileAttachment::type

Example:

function clone

virtual BMXMessageAttachmentPtr clone() const

克隆函数

Return: BMXMessageAttachmentPtr

Reimplements: floo::BMXFileAttachment::clone

Example:

function size

const Size & size() const

图片大小

Return: Size

Example:

size_t count() const { return mResult.size();
const size_t __words = __b.size() / _S_word_bit;
const size_t __extrabits = __b.size() % _S_word_bit;

function thumbnailUrl

const std::string & thumbnailUrl() const

远程使用缩略图URL

Return: std::string

Example:

function setThumbnail

void setThumbnail(
    const std::string & path
)

设置发送图片消息缩略图

Parameters:

  • path 本地路径

Example:

function thumbnailPath

const std::string & thumbnailPath() const

缩略图本地路径

Return: std::string

Example:

function thumbnailDownloadStatus

DownloadStatus thumbnailDownloadStatus() const

缩略图下载状态

Return: DownloadStatus

Friends

friend Encoder< BMXImageAttachment >

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

friend Decoder< BMXImageAttachment >

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

Example:


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

© 2019-2024 美信拓扑 | 官网 | 网站地图 该文件修订时间: 2024-12-07 06:49:06