KVIrc
4.9.2
DeveloperAPIs
|
A class to handle the entries of the user database. More...
#include <KviIrcUserEntry.h>
Public Types | |
enum | Gender { Male = 0, Female = 1, Unknown = 3 } |
Defines the gender of the user. More... | |
enum | UserMode { UserOp = 1, Voice = 2, HalfOp = 4, Op = 8, ChanAdmin = 16, ChanOwner = 32, ModeMask = UserOp | Voice | HalfOp | Op | ChanAdmin | ChanOwner } |
Defines the user mode in a channel. More... | |
Public Member Functions | |
const QString & | accountName () |
Returns the account name (if any) More... | |
KviAvatar * | avatar () |
Returns the avatar of the user. More... | |
bool | avatarRequested () const |
Returns true if kvirc already made an attempt to download user's avatar. More... | |
std::unique_ptr< KviAvatar > | forgetAvatar () |
Removes the avatar associated to the user. More... | |
Gender | gender () |
Returns the gender of the user. More... | |
bool | hasAccountName () |
Returns true if the user has an account name. More... | |
bool | hasHops () |
Returns true if the user has hops set. More... | |
bool | hasHost () |
Returns true if the user has the hostname set. More... | |
bool | hasRealName () |
Returns true if the user has the realname set. More... | |
bool | hasServer () |
Returns true if the user has the server set. More... | |
bool | hasUser () |
Returns true if the user has the username set. More... | |
int | hops () |
Returns the number of hops. More... | |
const QString & | host () |
Returns the hostname of the user. More... | |
bool | isAway () const |
Returns true if the user is in away mode. More... | |
bool | isBot () |
Returns true if the user is marked as a bot. More... | |
bool | isIrcOp () const |
Returns true if the user is an irc operator. More... | |
KviIrcUserEntry (const QString &user, const QString &host) | |
Constructs the entry object. More... | |
int | nRefs () |
Returns the number of references of the user in the database. More... | |
const QString & | realName () |
Returns the realname of the user. More... | |
const QString & | server () |
Returns the server of the user. More... | |
void | setAccountName (const QString &szAccountName) |
Sets the account name for the user. More... | |
void | setAvatar (std::unique_ptr< KviAvatar > upAvatar=nullptr) |
Sets the avatar of the user. More... | |
void | setAvatar (KviAvatar *upAvatar=nullptr) |
Sets the avatar of the user. More... | |
void | setAvatarRequested () |
Mark that kvirc is trying (already tried) to get user's avatar. More... | |
void | setAway (bool bAway) |
Sets the away state of the user. More... | |
void | setBot (bool bIsBot) |
Sets the user as a bot. More... | |
void | setGender (Gender g) |
Sets the gender of the user. More... | |
void | setHops (int iHops) |
Sets the number of hops of the user. More... | |
void | setHost (const QString &szHost) |
Sets the hostname of the user. More... | |
void | setIrcOp (bool bIrcOp) |
Sets the irc operator state of the user. More... | |
void | setRealName (const QString &szReal) |
Sets the realname of the user. More... | |
void | setServer (const QString &szServ) |
Sets the server of the user. More... | |
void | setSmartNickColor (const int iColor) |
Sets the ircview smart nick color of the user. More... | |
void | setUser (const QString &szUser) |
Sets the username of the user. More... | |
void | setUserFlags (const QString &szFlags) |
Sets the user global flags (eg: "G*") More... | |
int | smartNickColor () |
Returns the ircview smart nick color of the user. More... | |
const QString & | user () |
Returns the username of the user. More... | |
const QString & | userFlags () |
Returns the user flags. More... | |
Protected Attributes | |
bool | m_bAvatarRequested |
bool | m_bAway |
bool | m_bBot |
bool | m_bIrcOp |
bool | m_bNotFoundRegUserLookup |
bool | m_bUseCustomColor |
QColor | m_cachedColor |
Gender | m_eGender |
int | m_iHops |
int | m_iSmartNickColor |
int | m_nRefs |
QString | m_szAccountName |
QString | m_szHost |
QString | m_szLastRegisteredMatchNick |
QString | m_szRealName |
QString | m_szRegisteredUserName |
QString | m_szServer |
QString | m_szUser |
QString | m_szUserFlags |
std::unique_ptr< KviAvatar > | m_upAvatar |
Friends | |
class | KviIrcUserDataBase |
A class to handle the entries of the user database.
Defines the user mode in a channel.
KviIrcUserEntry::KviIrcUserEntry | ( | const QString & | user, |
const QString & | host | ||
) |
Constructs the entry object.
user | The user to add |
host | The host of the user |
References m_bAvatarRequested, m_bAway, m_bBot, m_bIrcOp, m_bNotFoundRegUserLookup, m_bUseCustomColor, m_eGender, m_iHops, m_iSmartNickColor, m_nRefs, m_szAccountName, m_szHost, m_szUser, szHost, and Unknown.
|
inline |
Returns the account name (if any)
Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListView::nickChange().
|
inline |
Returns the avatar of the user.
Referenced by avatar_kvs_cmd_notify(), avatar_kvs_fnc_name(), avatar_kvs_fnc_path(), KviConsoleWindow::currentAvatar(), KviConsoleWindow::getUserTipText(), KviIrcConnection::loginToIrcServer(), KviApplication::notifierMessage(), KviIrcServerParser::parseLiteralJoin(), KviIrcServerParser::parseNumericWhoisUser(), KviIrcServerParser::parseNumericWhoReply(), KviIrcServerParser::parseNumericWhospcrpl(), KviQueryWindow::setTarget(), and KviUserListEntry::updateAvatarData().
|
inline |
Returns true if kvirc already made an attempt to download user's avatar.
Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
std::unique_ptr< KviAvatar > KviIrcUserEntry::forgetAvatar | ( | ) |
Removes the avatar associated to the user.
References m_upAvatar, and KviMemory::move().
Referenced by KviUserListView::nickChange().
|
inline |
Returns the gender of the user.
Referenced by KviConsoleWindow::getUserTipText(), KviKvsCoreFunctions::KVSCF(), KviUserListView::nickChange(), KviUserListViewArea::paintEvent(), and KviIrcServerParser::parseNumericWhoisUser().
|
inline |
Returns true if the user has an account name.
Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().
|
inline |
Returns true if the user has hops set.
Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().
|
inline |
Returns true if the user has the hostname set.
Referenced by KviQueryWindow::getInfoLabelText(), KviKvsCoreFunctions::KVSCF(), KviIrcUserDataBase::registeredUser(), and KviConsoleWindow::setAvatar().
|
inline |
Returns true if the user has the realname set.
Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().
|
inline |
Returns true if the user has the server set.
Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().
|
inline |
Returns true if the user has the username set.
Referenced by KviQueryWindow::getInfoLabelText(), KviKvsCoreFunctions::KVSCF(), KviIrcUserDataBase::registeredUser(), and KviConsoleWindow::setAvatar().
|
inline |
Returns the number of hops.
Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListView::nickChange().
|
inline |
Returns the hostname of the user.
Referenced by chan_kvs_fnc_users(), KviUserListView::completeNickBashLike(), KviUserListView::completeNickStandard(), KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), KviIrcConnection::loginComplete(), KviUserListView::nickChange(), KviIrcServerParser::parseLiteralKick(), KviIrcUserDataBase::registeredUser(), KviQueryWindow::setAliveQuery(), KviConsoleWindow::setAvatar(), and KviUserListView::userActionVerifyMask().
|
inline |
Returns true if the user is in away mode.
Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListViewArea::paintEvent().
|
inline |
Returns true if the user is marked as a bot.
Referenced by KviKvsCoreFunctions::KVSCF(), KviUserListView::nickChange(), and KviUserListViewArea::paintEvent().
|
inline |
Returns true if the user is an irc operator.
Referenced by KviUserListView::insertUserEntry(), KviUserListView::maybeTip(), KviUserListView::nickChange(), KviUserListViewArea::paintEvent(), KviUserListView::partInternal(), and KviUserListView::userStats().
|
inline |
Returns the number of references of the user in the database.
|
inline |
Returns the realname of the user.
Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), KviKvsCoreFunctions::KVSCF(), and KviUserListView::nickChange().
|
inline |
Returns the server of the user.
Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListView::nickChange().
|
inline |
Sets the account name for the user.
Referenced by KviIrcServerParser::parseLiteralAccount(), KviIrcServerParser::parseLiteralJoin(), and KviIrcServerParser::parseNumericWhospcrpl().
void KviIrcUserEntry::setAvatar | ( | std::unique_ptr< KviAvatar > | upAvatar = nullptr | ) |
Sets the avatar of the user.
upAvatar | The avatar |
References m_upAvatar, and KviMemory::move().
Referenced by avatar_kvs_cmd_set(), avatar_kvs_cmd_unset(), KviConsoleWindow::checkDefaultAvatar(), KviConsoleWindow::currentAvatar(), KviIrcConnection::loginToIrcServer(), KviIrcServerParser::parseCtcpReplyAvatar(), KviIrcServerParser::parseLiteralJoin(), KviConsoleWindow::setAvatar(), and KviConsoleWindow::setAvatarFromOptions().
void KviIrcUserEntry::setAvatar | ( | KviAvatar * | upAvatar = nullptr | ) |
Sets the avatar of the user.
pAvatar | The avatar |
References m_upAvatar.
|
inline |
Mark that kvirc is trying (already tried) to get user's avatar.
Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
|
inline |
Sets the away state of the user.
bAway | The away state |
Referenced by KviIrcServerParser::parseLiteralAway(), KviIrcServerParser::parseNumericWhoisAway(), KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
|
inline |
Sets the user as a bot.
bIsBot | If the user is a bot |
Referenced by setRealName().
|
inline |
Sets the gender of the user.
g | The gender |
References g.
Referenced by KviIrcConnection::loginToIrcServer(), KviIrcServerParser::parseCtcpReplyAvatar(), KviIrcServerParser::parseCtcpReplyUserinfo(), and setRealName().
|
inline |
Sets the number of hops of the user.
iHops | The number of hops |
Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
|
inline |
Sets the hostname of the user.
szHost | The hostname |
References szHost.
Referenced by KviIrcServerParser::parseLiteralChghost(), KviIrcServerParser::parseNumericWhoisUser(), KviIrcServerParser::parseNumericWhoReply(), KviIrcServerParser::parseNumericWhospcrpl(), KviUserListView::userAction(), KviUserListView::userActionVerifyMask(), and KviIrcConnection::userInfoReceived().
|
inline |
Sets the irc operator state of the user.
bIrcOp | The ircop state |
Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
void KviIrcUserEntry::setRealName | ( | const QString & | szReal | ) |
Sets the realname of the user.
szReal | The realname |
References Female, KviNickColors::getSmartColorIntByMircColor(), KviControlCodes::getUnicodeColorBytes(), m_szRealName, Male, KviControlCodes::Reset, setBot(), setGender(), and setSmartNickColor().
Referenced by KviIrcServerParser::parseLiteralJoin(), KviIrcServerParser::parseNumericWhoisUser(), KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
|
inline |
Sets the server of the user.
szServ | The server |
Referenced by KviIrcServerParser::parseNumericWhoisServer(), KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
|
inline |
Sets the ircview smart nick color of the user.
iColor | The color value |
Referenced by KviConsoleWindow::outputPrivmsg(), KviIrcServerParser::parseLiteralNick(), and setRealName().
|
inline |
Sets the username of the user.
szUser | The username |
Referenced by KviIrcServerParser::parseLiteralChghost(), KviIrcServerParser::parseNumericWhoisUser(), KviIrcServerParser::parseNumericWhoReply(), KviIrcServerParser::parseNumericWhospcrpl(), KviUserListView::userAction(), KviUserListView::userActionVerifyMask(), and KviIrcConnection::userInfoReceived().
|
inline |
Sets the user global flags (eg: "G*")
szFlags |
Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().
|
inline |
Returns the ircview smart nick color of the user.
Referenced by KviConsoleWindow::outputPrivmsg().
|
inline |
Returns the username of the user.
Referenced by chan_kvs_fnc_users(), KviUserListView::completeNickBashLike(), KviUserListView::completeNickStandard(), KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), KviIrcConnection::loginComplete(), KviUserListView::nickChange(), KviIrcServerParser::parseLiteralKick(), KviIrcUserDataBase::registeredUser(), KviQueryWindow::setAliveQuery(), KviConsoleWindow::setAvatar(), and KviUserListView::userActionVerifyMask().
|
inline |
|
friend |
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
|
protected |
Referenced by KviIrcUserDataBase::haveCustomColor(), KviIrcUserEntry(), and KviIrcUserDataBase::registeredUser().
|
protected |
Referenced by KviIrcUserDataBase::customColor(), and KviIrcUserDataBase::registeredUser().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserDataBase::insertUser(), KviIrcUserEntry(), and KviIrcUserDataBase::removeUser().
|
protected |
Referenced by KviIrcUserEntry().
|
protected |
Referenced by KviIrcUserDataBase::insertUser(), and KviIrcUserEntry().
|
protected |
|
protected |
Referenced by setRealName().
|
protected |
|
protected |
|
protected |
Referenced by KviIrcUserDataBase::insertUser(), and KviIrcUserEntry().
|
protected |
|
protected |
Referenced by forgetAvatar(), and setAvatar().