libQuotient
A Qt library for building matrix clients
Quotient::Avatar Class Reference

#include <avatar.h>

Public Types

using get_callback_t = std::function< void()>
 
using upload_callback_t = std::function< void(QUrl)>
 

Public Member Functions

 Avatar (Connection *parent, const QUrl &url={})
 
QImage get (int dimension, get_callback_t callback) const
 
QImage get (int width, int height, get_callback_t callback) const
 
bool upload (const QString &fileName, upload_callback_t callback) const
 
bool upload (QIODevice *source, upload_callback_t callback) const
 
QFuture< QUrl > upload (const QString &fileName) const
 
QFuture< QUrl > upload (QIODevice *source) const
 
bool isEmpty () const
 
QString mediaId () const
 
QUrl url () const
 
bool updateUrl (const QUrl &newUrl)
 

Static Public Member Functions

static bool isUrlValid (const QUrl &u)
 

Detailed Description

Definition at line 17 of file avatar.h.

Member Typedef Documentation

◆ get_callback_t

using Quotient::Avatar::get_callback_t = std::function<void()>

Definition at line 25 of file avatar.h.

◆ upload_callback_t

using Quotient::Avatar::upload_callback_t = std::function<void(QUrl)>

Definition at line 26 of file avatar.h.

Constructor & Destructor Documentation

◆ Avatar()

Quotient::Avatar::Avatar ( Connection parent,
const QUrl &  url = {} 
)
explicit

Member Function Documentation

◆ get() [1/2]

QImage Quotient::Avatar::get ( int  dimension,
get_callback_t  callback 
) const

◆ get() [2/2]

QImage Quotient::Avatar::get ( int  width,
int  height,
get_callback_t  callback 
) const

◆ isEmpty()

bool Quotient::Avatar::isEmpty ( ) const

◆ isUrlValid()

static bool Quotient::Avatar::isUrlValid ( const QUrl &  u)
static

◆ mediaId()

QString Quotient::Avatar::mediaId ( ) const

◆ updateUrl()

bool Quotient::Avatar::updateUrl ( const QUrl &  newUrl)

◆ upload() [1/4]

QFuture<QUrl> Quotient::Avatar::upload ( const QString &  fileName) const

◆ upload() [2/4]

bool Quotient::Avatar::upload ( const QString &  fileName,
upload_callback_t  callback 
) const

◆ upload() [3/4]

QFuture<QUrl> Quotient::Avatar::upload ( QIODevice *  source) const

◆ upload() [4/4]

bool Quotient::Avatar::upload ( QIODevice *  source,
upload_callback_t  callback 
) const

◆ url()

QUrl Quotient::Avatar::url ( ) const

The documentation for this class was generated from the following file: