LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
LC::Azoth::IHaveAvatars Class Referenceabstract

Describes an entry that can have an associated avatar. More...

#include "ihaveavatars.h"

Public Types

enum  Size { Size::Full, Size::Thumbnail }
 The size of the avatar. More...
 

Public Member Functions

virtual QFuture< QImage > RefreshAvatar (Size size)=0
 Requests the avatar of the given size. More...
 
virtual bool HasAvatar () const =0
 Returns whether this exact entry has any avatar. More...
 
virtual bool SupportsSize (Size size) const =0
 Whether this entry has an avatar of the given size. More...
 

Protected Member Functions

virtual ~IHaveAvatars ()
 
virtual void avatarChanged (QObject *thisObject)=0
 Notifies that the avatar of the entry has been changed. More...
 

Detailed Description

Describes an entry that can have an associated avatar.

Definition at line 33 of file ihaveavatars.h.

Member Enumeration Documentation

◆ Size

The size of the avatar.

Enumerator
Full 

Full-size avatar.

Thumbnail 

Thumbnail avatar, possibly cropped.

Definition at line 46 of file ihaveavatars.h.

Constructor & Destructor Documentation

◆ ~IHaveAvatars()

virtual LC::Azoth::IHaveAvatars::~IHaveAvatars ( )
inlineprotectedvirtual

Definition at line 42 of file ihaveavatars.h.

Member Function Documentation

◆ avatarChanged()

virtual void LC::Azoth::IHaveAvatars::avatarChanged ( QObject *  thisObject)
protectedpure virtual

Notifies that the avatar of the entry has been changed.

This signal should be emitted when the entry detects that the avatar has been changed.

If possible, the new avatar should not be fetched unless RefreshAvatar() is called.

Note
This function is expected to be a signal.
Parameters
[out]thisObjectThe this pointer.

◆ HasAvatar()

virtual bool LC::Azoth::IHaveAvatars::HasAvatar ( ) const
pure virtual

Returns whether this exact entry has any avatar.

Returns
Whether there is an avatar.

◆ RefreshAvatar()

virtual QFuture<QImage> LC::Azoth::IHaveAvatars::RefreshAvatar ( Size  size)
pure virtual

Requests the avatar of the given size.

This function should schedule fetching the avatar and return a future that will become ready once the avatar is fetched.

If there is no avatar, a null QImage should be returned.

No cached copies should be returned, the avatar information should be rerequested from scratch (hence refrech in the method name).

If size is not supported, an empty, cancelled future should be returned.

Parameters
[in]sizeThe required size of the avatar.
Returns
A future providing the avatar's image.

◆ SupportsSize()

virtual bool LC::Azoth::IHaveAvatars::SupportsSize ( Size  size) const
pure virtual

Whether this entry has an avatar of the given size.

Parameters
[in]sizeThe desired size of the avatar.
Returns
Whether the entry has this size.

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