KVIrc  4.9.2
DeveloperAPIs
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
KviIrcUserEntry Class Reference

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...
 
KviAvataravatar ()
 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< KviAvatarforgetAvatar ()
 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< KviAvatarm_upAvatar
 

Friends

class KviIrcUserDataBase
 

Detailed Description

A class to handle the entries of the user database.

Member Enumeration Documentation

Defines the gender of the user.

Enumerator
Male 

Male

Female 

Female

Unknown 

Unknown

Defines the user mode in a channel.

Enumerator
UserOp 

the user is a userop of the channel

Voice 

the user is a voice of the channel

HalfOp 

the user is a halfop of the channel

Op 

the user is an operator of the channel

ChanAdmin 

the user is an admin of the channel

ChanOwner 

the user is an owner of the channel

ModeMask 

Constructor & Destructor Documentation

KviIrcUserEntry::KviIrcUserEntry ( const QString &  user,
const QString &  host 
)

Constructs the entry object.

Parameters
userThe user to add
hostThe host of the user
Returns
KviIrcUserEntry

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.

Member Function Documentation

const QString& KviIrcUserEntry::accountName ( )
inline

Returns the account name (if any)

Returns
const QString &

Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListView::nickChange().

KviAvatar* KviIrcUserEntry::avatar ( )
inline
bool KviIrcUserEntry::avatarRequested ( ) const
inline

Returns true if kvirc already made an attempt to download user's avatar.

Returns
bool

Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().

std::unique_ptr< KviAvatar > KviIrcUserEntry::forgetAvatar ( )

Removes the avatar associated to the user.

Returns
KviAvatar *

References m_upAvatar, and KviMemory::move().

Referenced by KviUserListView::nickChange().

Gender KviIrcUserEntry::gender ( )
inline
bool KviIrcUserEntry::hasAccountName ( )
inline

Returns true if the user has an account name.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().

bool KviIrcUserEntry::hasHops ( )
inline

Returns true if the user has hops set.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().

bool KviIrcUserEntry::hasHost ( )
inline

Returns true if the user has the hostname set.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), KviKvsCoreFunctions::KVSCF(), KviIrcUserDataBase::registeredUser(), and KviConsoleWindow::setAvatar().

bool KviIrcUserEntry::hasRealName ( )
inline

Returns true if the user has the realname set.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().

bool KviIrcUserEntry::hasServer ( )
inline

Returns true if the user has the server set.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), and KviConsoleWindow::getUserTipText().

bool KviIrcUserEntry::hasUser ( )
inline

Returns true if the user has the username set.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), KviKvsCoreFunctions::KVSCF(), KviIrcUserDataBase::registeredUser(), and KviConsoleWindow::setAvatar().

int KviIrcUserEntry::hops ( )
inline
const QString& KviIrcUserEntry::host ( )
inline
bool KviIrcUserEntry::isAway ( ) const
inline

Returns true if the user is in away mode.

Returns
bool

Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListViewArea::paintEvent().

bool KviIrcUserEntry::isBot ( )
inline

Returns true if the user is marked as a bot.

Returns
bool

Referenced by KviKvsCoreFunctions::KVSCF(), KviUserListView::nickChange(), and KviUserListViewArea::paintEvent().

bool KviIrcUserEntry::isIrcOp ( ) const
inline
int KviIrcUserEntry::nRefs ( )
inline

Returns the number of references of the user in the database.

Returns
int
const QString& KviIrcUserEntry::realName ( )
inline

Returns the realname of the user.

Returns
const QString &

Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), KviKvsCoreFunctions::KVSCF(), and KviUserListView::nickChange().

const QString& KviIrcUserEntry::server ( )
inline

Returns the server of the user.

Returns
const QString &

Referenced by KviQueryWindow::getInfoLabelText(), KviConsoleWindow::getUserTipText(), and KviUserListView::nickChange().

void KviIrcUserEntry::setAccountName ( const QString &  szAccountName)
inline
void KviIrcUserEntry::setAvatar ( std::unique_ptr< KviAvatar upAvatar = nullptr)
void KviIrcUserEntry::setAvatar ( KviAvatar upAvatar = nullptr)

Sets the avatar of the user.

Parameters
pAvatarThe avatar
Returns
void
Warning
The ownership passes to this class!
This is an overload function for backwards compatibility

References m_upAvatar.

void KviIrcUserEntry::setAvatarRequested ( )
inline

Mark that kvirc is trying (already tried) to get user's avatar.

Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().

void KviIrcUserEntry::setAway ( bool  bAway)
inline
void KviIrcUserEntry::setBot ( bool  bIsBot)
inline

Sets the user as a bot.

Parameters
bIsBotIf the user is a bot
Returns
void

Referenced by setRealName().

void KviIrcUserEntry::setGender ( Gender  g)
inline

Sets the gender of the user.

Parameters
gThe gender
Returns
void

References g.

Referenced by KviIrcConnection::loginToIrcServer(), KviIrcServerParser::parseCtcpReplyAvatar(), KviIrcServerParser::parseCtcpReplyUserinfo(), and setRealName().

void KviIrcUserEntry::setHops ( int  iHops)
inline

Sets the number of hops of the user.

Parameters
iHopsThe number of hops
Returns
void

Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().

void KviIrcUserEntry::setHost ( const QString &  szHost)
inline
void KviIrcUserEntry::setIrcOp ( bool  bIrcOp)
inline

Sets the irc operator state of the user.

Parameters
bIrcOpThe ircop state
Returns
void

Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().

void KviIrcUserEntry::setRealName ( const QString &  szReal)
void KviIrcUserEntry::setServer ( const QString &  szServ)
inline

Sets the server of the user.

Parameters
szServThe server
Returns
void

Referenced by KviIrcServerParser::parseNumericWhoisServer(), KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().

void KviIrcUserEntry::setSmartNickColor ( const int  iColor)
inline

Sets the ircview smart nick color of the user.

Parameters
iColorThe color value
Returns
void

Referenced by KviConsoleWindow::outputPrivmsg(), KviIrcServerParser::parseLiteralNick(), and setRealName().

void KviIrcUserEntry::setUser ( const QString &  szUser)
inline
void KviIrcUserEntry::setUserFlags ( const QString &  szFlags)
inline

Sets the user global flags (eg: "G*")

Parameters
szFlags
Returns
void

Referenced by KviIrcServerParser::parseNumericWhoReply(), and KviIrcServerParser::parseNumericWhospcrpl().

int KviIrcUserEntry::smartNickColor ( )
inline

Returns the ircview smart nick color of the user.

Returns
int

Referenced by KviConsoleWindow::outputPrivmsg().

const QString& KviIrcUserEntry::user ( )
inline
const QString& KviIrcUserEntry::userFlags ( )
inline

Returns the user flags.

Returns
const QString &

Referenced by KviKvsCoreFunctions::KVSCF().

Friends And Related Function Documentation

friend class KviIrcUserDataBase
friend

Member Data Documentation

bool KviIrcUserEntry::m_bAvatarRequested
protected

Referenced by KviIrcUserEntry().

bool KviIrcUserEntry::m_bAway
protected

Referenced by KviIrcUserEntry().

bool KviIrcUserEntry::m_bBot
protected

Referenced by KviIrcUserEntry().

bool KviIrcUserEntry::m_bIrcOp
protected

Referenced by KviIrcUserEntry().

bool KviIrcUserEntry::m_bNotFoundRegUserLookup
protected
bool KviIrcUserEntry::m_bUseCustomColor
protected
QColor KviIrcUserEntry::m_cachedColor
protected
Gender KviIrcUserEntry::m_eGender
protected

Referenced by KviIrcUserEntry().

int KviIrcUserEntry::m_iHops
protected

Referenced by KviIrcUserEntry().

int KviIrcUserEntry::m_iSmartNickColor
protected

Referenced by KviIrcUserEntry().

int KviIrcUserEntry::m_nRefs
protected
QString KviIrcUserEntry::m_szAccountName
protected

Referenced by KviIrcUserEntry().

QString KviIrcUserEntry::m_szHost
protected
QString KviIrcUserEntry::m_szLastRegisteredMatchNick
protected
QString KviIrcUserEntry::m_szRealName
protected

Referenced by setRealName().

QString KviIrcUserEntry::m_szRegisteredUserName
protected
QString KviIrcUserEntry::m_szServer
protected
QString KviIrcUserEntry::m_szUser
protected
QString KviIrcUserEntry::m_szUserFlags
protected
std::unique_ptr<KviAvatar> KviIrcUserEntry::m_upAvatar
protected

Referenced by forgetAvatar(), and setAvatar().


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