KVIrc
4.9.2
DeveloperAPIs
|
The class which manages the user database. More...
#include <KviIrcUserDataBase.h>
Public Member Functions | |
void | clear () |
Clears the database. More... | |
QColor * | customColor (const QString &szNick) |
Returns the custom color of the user. More... | |
KviPointerHashTable< QString, KviIrcUserEntry > * | dict () |
Returns the database dictionary. More... | |
KviIrcUserEntry * | find (const QString &szNick) |
Searches for a user in the database. More... | |
bool | haveCustomColor (const QString &szNick) |
Returns true if the user has custom colors set. More... | |
KviIrcUserEntry * | insertUser (const QString &szNick, const QString &szUser, const QString &szHost) |
Adds the user to the database. More... | |
KviIrcUserDataBase () | |
Constructs the Irc user database object. More... | |
KviRegisteredUser * | registeredUser (const QString &szNick) |
Returns the registered user, if any, or 0. More... | |
KviRegisteredUser * | registeredUser (const QString &szNick, const QString &szUser, const QString &szHost) |
Returns the registered user, if any, or 0. More... | |
bool | removeUser (const QString &szNick, KviIrcUserEntry *pEntry) |
Decrements the user reference count and if it reaches 0 then deletes the user from the database. More... | |
void | setupConnectionWithReguserDb () |
Initialize the database by connecting signals and slots. More... | |
~KviIrcUserDataBase () | |
Destoys the object. More... | |
Protected Slots | |
void | registeredDatabaseCleared () |
Slot called when the database is cleared. More... | |
void | registeredUserAdded (const QString &szUser) |
Slot called when a registered user is added. More... | |
void | registeredUserChanged (const QString &szUser) |
Slot called when a registered user is changed or removed. More... | |
Private Attributes | |
KviPointerHashTable< QString, KviIrcUserEntry > * | m_pDict |
The class which manages the user database.
KviIrcUserDataBase::KviIrcUserDataBase | ( | ) |
Constructs the Irc user database object.
References m_pDict, KviPointerHashTable< Key, T >::setAutoDelete(), and setupConnectionWithReguserDb().
KviIrcUserDataBase::~KviIrcUserDataBase | ( | ) |
Destoys the object.
References m_pDict.
void KviIrcUserDataBase::clear | ( | ) |
Clears the database.
References m_pDict, and KviPointerHashTable< Key, T >::setAutoDelete().
QColor * KviIrcUserDataBase::customColor | ( | const QString & | szNick | ) |
Returns the custom color of the user.
szNick | The nickname of the user |
References find(), KviIrcUserEntry::m_bNotFoundRegUserLookup, KviIrcUserEntry::m_cachedColor, KviIrcUserEntry::m_szLastRegisteredMatchNick, and registeredUser().
Referenced by KviUserListEntry::color(), and KviUserListViewArea::paintEvent().
|
inline |
Returns the database dictionary.
|
inline |
Searches for a user in the database.
szNick | The nickname of the user to find |
Referenced by avatar_kvs_cmd_notify(), avatar_kvs_cmd_set(), avatar_kvs_cmd_unset(), avatar_kvs_fnc_name(), avatar_kvs_fnc_path(), KviConsoleWindow::currentAvatar(), customColor(), KviIrcView::doLinkToolTip(), KviQueryWindow::getInfoLabelText(), KviQueryWindow::getWindowListTipText(), KviIsOnNotifyListManager::handleIsOn(), haveCustomColor(), KviKvsCoreSimpleCommands::KVSCSC(), KviIrcConnection::loginComplete(), KviIrcConnection::loginToIrcServer(), KviConsoleWindow::outputPrivmsg(), KviIrcServerParser::parseCtcpReplyAvatar(), KviIrcServerParser::parseCtcpReplyUserinfo(), KviIrcServerParser::parseLiteralAccount(), KviIrcServerParser::parseLiteralAway(), KviIrcServerParser::parseLiteralChghost(), KviIrcServerParser::parseLiteralJoin(), KviIrcServerParser::parseLiteralKick(), KviIrcServerParser::parseLiteralNick(), KviIrcServerParser::parseNumericWhoisAway(), KviIrcServerParser::parseNumericWhoisServer(), KviIrcServerParser::parseNumericWhoisUser(), KviIrcServerParser::parseNumericWhoReply(), KviIrcServerParser::parseNumericWhospcrpl(), registeredUser(), KviQueryWindow::setAliveQuery(), KviConsoleWindow::setAvatar(), KviConsoleWindow::setAvatarFromOptions(), and KviIrcConnection::userInfoReceived().
bool KviIrcUserDataBase::haveCustomColor | ( | const QString & | szNick | ) |
Returns true if the user has custom colors set.
szNick | The nickname of the user |
References find(), KviIrcUserEntry::m_bNotFoundRegUserLookup, KviIrcUserEntry::m_bUseCustomColor, KviIrcUserEntry::m_szLastRegisteredMatchNick, and registeredUser().
Referenced by KviUserListEntry::color(), and KviUserListViewArea::paintEvent().
KviIrcUserEntry * KviIrcUserDataBase::insertUser | ( | const QString & | szNick, |
const QString & | szUser, | ||
const QString & | szHost | ||
) |
Adds the user to the database.
szNick | The nickname of the user |
szUser | The username of the user |
szHost | The hostname of the user |
References KviPointerHashTable< Key, T >::find(), KviPointerHashTable< Key, T >::insert(), KviIrcUserEntry::m_nRefs, m_pDict, KviIrcUserEntry::m_szHost, KviIrcUserEntry::m_szUser, and szHost.
Referenced by KviUserListView::join().
|
protectedslot |
Slot called when the database is cleared.
References KviPointerHashTableIterator< Key, T >::current(), KviIrcUserEntry::m_bNotFoundRegUserLookup, m_pDict, and KviIrcUserEntry::m_szRegisteredUserName.
Referenced by setupConnectionWithReguserDb().
KviRegisteredUser * KviIrcUserDataBase::registeredUser | ( | const QString & | szNick | ) |
Returns the registered user, if any, or 0.
szNick | The nickname of the user |
References find(), KviIrcUserEntry::host(), and KviIrcUserEntry::user().
Referenced by KviConsoleWindow::applyHighlighting(), KviConsoleWindow::avatarChanged(), KviConsoleWindow::checkDefaultAvatar(), KviUserListEntry::color(), customColor(), haveCustomColor(), KviIrcServerParser::parseCtcpRequest(), KviIrcServerParser::parseCtcpRequestDcc(), KviIrcServerParser::parseLiteralInvite(), KviIrcServerParser::parseLiteralNotice(), KviIrcServerParser::parseLiteralPrivmsg(), and KviConsoleWindow::triggerOnHighlight().
KviRegisteredUser * KviIrcUserDataBase::registeredUser | ( | const QString & | szNick, |
const QString & | szUser, | ||
const QString & | szHost | ||
) |
Returns the registered user, if any, or 0.
szNick | The nickname of the user |
szUser | The username of the user |
szHost | The hostname of the user |
References find(), KviRegisteredUserDataBase::findMatchingUser(), KviStringConversion::fromString(), g_pRegisteredUserDataBase, KviRegisteredUser::getBoolProperty(), KviRegisteredUser::getProperty(), KviRegisteredUserDataBase::getUser(), KviIrcUserEntry::hasHost(), KviIrcUserEntry::hasUser(), KviIrcUserEntry::host(), KviIrcUserEntry::m_bNotFoundRegUserLookup, KviIrcUserEntry::m_bUseCustomColor, KviIrcUserEntry::m_cachedColor, KviIrcUserEntry::m_szLastRegisteredMatchNick, KviIrcUserEntry::m_szRegisteredUserName, KviRegisteredUser::name(), and KviIrcUserEntry::user().
|
protectedslot |
Slot called when a registered user is added.
szUser | The user added |
References KviPointerHashTableIterator< Key, T >::current(), KviIrcUserEntry::m_bNotFoundRegUserLookup, m_pDict, and KviIrcUserEntry::m_szRegisteredUserName.
Referenced by setupConnectionWithReguserDb().
|
protectedslot |
Slot called when a registered user is changed or removed.
szUser | The user changed |
References KviPointerHashTableIterator< Key, T >::current(), KviIrcUserEntry::m_bNotFoundRegUserLookup, m_pDict, and KviIrcUserEntry::m_szRegisteredUserName.
Referenced by setupConnectionWithReguserDb().
bool KviIrcUserDataBase::removeUser | ( | const QString & | szNick, |
KviIrcUserEntry * | pEntry | ||
) |
Decrements the user reference count and if it reaches 0 then deletes the user from the database.
szNick | The nickname of the user |
pEntry | The entry of the user |
References KviIrcUserEntry::m_nRefs, m_pDict, and KviPointerHashTable< Key, T >::remove().
Referenced by KviUserListView::partInternal(), and KviUserListView::removeAllEntries().
void KviIrcUserDataBase::setupConnectionWithReguserDb | ( | ) |
Initialize the database by connecting signals and slots.
References connect(), g_pRegisteredUserDataBase, registeredDatabaseCleared(), registeredUserAdded(), and registeredUserChanged().
Referenced by KviIrcUserDataBase().
|
private |