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
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 ="") 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:
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:
function ~BMXImageAttachment
inline virtual ~BMXImageAttachment()
Destructor
Example:
function type
inline virtual Type type() const
Return the type of picture attachment
Return: Type
Reimplements: floo::BMXFileAttachment::type
Example:
function clone
virtual BMXMessageAttachmentPtr clone() const
Cloning function
Return: BMXMessageAttachmentPtr
Reimplements: floo::BMXFileAttachment::clone
Example:
function size
const Size & size() const
Picture size
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
Thumbnail url for remote use
Return: std::string
Example:
function setThumbnail
void setThumbnail(
const std::string & path
)
Set a thumbnail for sent picture
Parameters:
- path Local path
Example:
function thumbnailPath
const std::string & thumbnailPath() const
Local path of thumbnail
Return: std::string
Example:
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:
Updated on 2022-01-26 at 17:20:40 +0800