KVIrc
4.9.2
DeveloperAPIs
|
Avatar class. More...
#include <KviAvatar.h>
Public Member Functions | |
KviAnimatedPixmap * | animatedPixmap () |
Returns original animated pixmap. More... | |
KviAnimatedPixmap * | forSize (const QSize &size) |
Returns animated pixmap, scaled to the requisted size. More... | |
KviAnimatedPixmap * | forSize (unsigned int uWidth, unsigned int uHeight) |
Returns animated pixmap, scaled to the requisted size. More... | |
const QString & | identificationString () |
Returns the string that uniquely identifies this avatar. More... | |
bool | isAnimated () |
Returns true, if underlying pixmap contains more then one frame. More... | |
bool | isRemote () |
Returns true, if avatar is remote. More... | |
bool | isValid () |
Returns true if pixmap has at least one loaded frame. More... | |
KviAvatar (const QString &szLocalPath, const QString &szName, const QSize &scaleOnLoad=QSize()) | |
Constructs the avatar object. More... | |
const QString & | localPath () |
Returns filepath. More... | |
const QString & | name () |
Returns fiename. More... | |
QPixmap * | pixmap () |
Returns unscaled original frame. More... | |
const QSize & | size () |
Returns original pixmap's size. More... | |
~KviAvatar () | |
Destroys the avatar object. More... | |
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, KviAnimatedPixmap::resize(), size(), and KviAnimatedPixmap::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, and KviAnimatedPixmap::resize().
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
Referenced by KviConsoleWindow::avatarChanged().
|
inline |
|
inline |
Returns true, if avatar is remote.
Referenced by KviIrcServerParser::parseCtcpRequestAvatar().
|
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 |
Returns filepath.
Referenced by avatar_kvs_cmd_notify(), avatar_kvs_fnc_path(), OptionsWidget_identityAvatar::chooseAvatar(), KviConsoleWindow::getUserTipText(), and KviIrcServerParser::parseCtcpRequestAvatar().
|
inline |
Returns fiename.
For remote avatars, remote address will be returned.
Referenced by avatar_kvs_cmd_notify(), avatar_kvs_fnc_name(), and KviIrcServerParser::parseCtcpRequestAvatar().
|
inline |
Returns unscaled original frame.
References m_pPixmap.
Referenced by OptionsWidget_identityAvatar::chooseAvatar(), RegisteredUsersDialog::exportClicked(), and KviApplication::notifierMessage().
|
inline |
Returns original pixmap's size.
References m_pPixmap.
Referenced by KviConsoleWindow::getUserTipText(), KviAvatar(), and KviUserListEntry::updateAvatarData().
|
private |
Referenced by KviAvatar().
|
private |
Referenced by forSize(), and KviAvatar().
|
private |
Referenced by forSize(), KviAvatar(), and ~KviAvatar().
|
private |
Referenced by KviAvatar().
|
private |
Referenced by KviAvatar().