![]() |
KVIrc 5.2.6
Developer APIs
|
Avatar class. More...
#include <KviAvatar.h>
Public Member Functions | |
KviAnimatedPixmap * | animatedPixmap () const |
Returns original animated pixmap. | |
KviAnimatedPixmap * | forSize (const QSize &size) |
Returns animated pixmap, scaled to the requisted size. | |
KviAnimatedPixmap * | forSize (unsigned int uWidth, unsigned int uHeight) |
Returns animated pixmap, scaled to the requisted size. | |
const QString & | identificationString () |
Returns the string that uniquely identifies this avatar. | |
bool | isAnimated () const |
Returns true, if underlying pixmap contains more then one frame. | |
bool | isRemote () const |
Returns true, if avatar is remote. | |
bool | isValid () const |
Returns true if pixmap has at least one loaded frame. | |
KviAvatar (const QString &szLocalPath, const QString &szName, const QSize &scaleOnLoad=QSize()) | |
Constructs the avatar object. | |
const QString & | localPath () const |
Returns filepath. | |
const QString & | name () const |
Returns fiename. | |
QPixmap * | pixmap () const |
Returns unscaled original frame. | |
const QSize & | size () const |
Returns original pixmap's size. | |
~KviAvatar () | |
Destroys the avatar object. | |
Private Attributes | |
bool | m_bRemote |
KviAnimatedPixmap * | m_pPixmap |
QHash< QSize, KviAnimatedPixmap * > | m_scaledPixmapsCache |
QString | m_szLocalPath |
QString | m_szName |
Avatar class.
KviAvatar::KviAvatar | ( | const QString & | szLocalPath, |
const QString & | szName, | ||
const QSize & | scaleOnLoad = QSize() ) |
Constructs the avatar object.
szLocalPath | The local path of the avatar |
szName | The name of the avatar |
scaleOnLoad | If we want to scale the avatar on load |
References KviQString::equalCIN(), m_bRemote, m_pPixmap, m_scaledPixmapsCache, m_szLocalPath, m_szName, and size().
KviAvatar::~KviAvatar | ( | ) |
Destroys the avatar object.
References m_scaledPixmapsCache.
|
inline |
Returns original animated pixmap.
References m_pPixmap.
Referenced by KviUserListEntry::updateAvatarData().
KviAnimatedPixmap * KviAvatar::forSize | ( | const QSize & | size | ) |
Returns animated pixmap, scaled to the requisted size.
Scaling automagically keeps aspect ratio. Scaled image cached.
KviAvatar takes ownership on it, and will automatically delete it in destructor.
It is safe to connect returned KviAnimatedPixmap signals to external slots.
size | The size of the avatar |
References m_pPixmap, m_scaledPixmapsCache, KviAnimatedPixmap::resize(), and size().
Referenced by KviUserListEntry::updateAvatarData().
|
inline |
Returns animated pixmap, scaled to the requisted size.
Scaling automagically keeps aspect ratio. Scaled image cached.
KviAvatar takes ownership on it, and will automatically delete it in destructor.
It is safe to connect returned KviAnimatedPixmap signals to external slots.
uWidth | The width of the avatar |
uHeight | The height of the avatar |
References forSize().
Referenced by forSize().
|
inline |
Returns the string that uniquely identifies this avatar.
For remote avatars that have name starting with http:// the name is used. For local avatars the localPath is used instead
References m_bRemote, m_szLocalPath, and m_szName.
Referenced by KviConsoleWindow::avatarChanged().
|
inline |
|
inline |
|
inline |
Returns true if pixmap has at least one loaded frame.
Returns false otherwise.
References m_pPixmap.
Referenced by KviConsoleWindow::defaultAvatarFromOptions(), and KviIconManager::getAvatar().
|
inline |
|
inline |
Returns fiename.
For remote avatars, remote address will be returned.
References m_szName.
|
inline |
Returns unscaled original frame.
References m_pPixmap.
Referenced by KviConsoleWindow::defaultAvatarFromOptions(), and KviApplication::notifierMessage().
|
inline |
Returns original pixmap's size.
References m_pPixmap.
Referenced by forSize(), KviAvatar(), and KviUserListEntry::updateAvatarData().
|
private |
Referenced by identificationString(), isRemote(), and KviAvatar().
|
private |
Referenced by animatedPixmap(), forSize(), isAnimated(), isValid(), KviAvatar(), pixmap(), and size().
|
private |
Referenced by forSize(), KviAvatar(), and ~KviAvatar().
|
private |
Referenced by identificationString(), KviAvatar(), and localPath().
|
private |
Referenced by identificationString(), KviAvatar(), and name().