![]() |
KVIrc 5.2.6
Developer APIs
|
The class that manages the icons. More...
#include <KviTextIconManager.h>
Signals | |
void | changed () |
Called when the default associations change. | |
Public Member Functions | |
void | applyOptions () |
Applies the options. | |
void | checkDefaultAssociations () |
Checks and updates the default associations. | |
void | clear () |
Clears the dictionary. | |
void | insert (const QString &szName, int iId) |
Inserts an icon in the dictionary. | |
void | insert (const QString &szName, KviTextIcon &icon) |
Inserts an icon in the dictionary. | |
KviTextIconManager () | |
Constructs the icon manager object. | |
void | load () |
Loads the dictionary. | |
KviTextIcon * | lookupTextIcon (const QString &szName) |
Returns the text of the icon. | |
void | save () |
Saves the dictionary. | |
KviPointerHashTable< QString, KviTextIcon > * | textIconDict () const |
Returns the dictionary of the icons. | |
~KviTextIconManager () | |
Destroys the icon manager object. | |
Protected Member Functions | |
int | load (const QString &szFileName, bool bMerge=false) |
Loads the dictionary from a file. | |
void | save (const QString &szFileName) |
Saves the dictionary to a file. | |
Private Attributes | |
KviPointerHashTable< QString, KviTextIcon > * | m_pTextIconDict |
Friends | |
class | KviTextIconsOptionsWidget |
class | KviTextIconWindow |
The class that manages the icons.
KviTextIconManager::KviTextIconManager | ( | ) |
Constructs the icon manager object.
References m_pTextIconDict, and KviPointerHashTable< Key, T >::setAutoDelete().
KviTextIconManager::~KviTextIconManager | ( | ) |
Destroys the icon manager object.
References m_pTextIconDict.
void KviTextIconManager::applyOptions | ( | ) |
Applies the options.
References KviPointerHashTable< Key, T >::first(), KVI_OPTION_BOOL, KviOption_boolEnableAnimatedSmiles, m_pTextIconDict, and KviPointerHashTable< Key, T >::next().
Referenced by KviMainWindow::applyOptions().
|
signal |
Called when the default associations change.
Referenced by checkDefaultAssociations(), insert(), insert(), KviTextIconWindow::KviTextIconWindow(), and load().
void KviTextIconManager::checkDefaultAssociations | ( | ) |
Checks and updates the default associations.
References changed(), default_associations, KviPointerHashTable< Key, T >::find(), i, insert(), m_pTextIconDict, and KviTextIconAssocEntry::name.
Referenced by OptionsWidget_textIcons::restoreClicked().
void KviTextIconManager::clear | ( | ) |
Clears the dictionary.
References KviPointerHashTable< Key, T >::clear(), and m_pTextIconDict.
Referenced by OptionsWidget_textIcons::commit().
void KviTextIconManager::insert | ( | const QString & | szName, |
int | iId ) |
Inserts an icon in the dictionary.
szName | The name of the icon |
iId | The id of the icon |
References changed(), g_pIconManager, KviIconManager::iconName(), m_pTextIconDict, and KviPointerHashTable< Key, T >::replace().
Referenced by checkDefaultAssociations(), OptionsWidget_textIcons::commit(), and texticons_kvs_cmd_set().
void KviTextIconManager::insert | ( | const QString & | szName, |
KviTextIcon & | icon ) |
Inserts an icon in the dictionary.
szName | The name of the icon |
icon | The icon |
References changed(), m_pTextIconDict, and KviPointerHashTable< Key, T >::replace().
void KviTextIconManager::load | ( | ) |
Loads the dictionary.
References KviApplication::Config, g_pApp, KviApplication::getGlobalKvircDirectory(), KviApplication::getReadOnlyConfigPath(), KVI_CONFIGFILE_TEXTICONS, load(), and TEXTICONMANAGER_CURRENT_CONFIG_UPDATE.
Referenced by load(), and KviApplication::setup().
|
protected |
Loads the dictionary from a file.
This is the real load() function It returns the config update
szFileName | The filename from where to load |
bMerge | Whether to merge the existing dictionary with the loaded one |
References changed(), KviPointerHashTable< Key, T >::clear(), KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), KviConfigurationFile::dict(), KviPointerHashTable< Key, T >::find(), g_pIconManager, KviIconManager::getPixmap(), KviIconManager::getSmallIcon(), KviIconManager::Help, KviIconManager::iconName(), m_pTextIconDict, KviConfigurationFile::Read, KviConfigurationFile::readEntry(), KviConfigurationFile::readIntEntry(), KviPointerHashTable< Key, T >::replace(), s, and KviConfigurationFile::setGroup().
|
inline |
Returns the text of the icon.
szName | The name of the icon |
References KviPointerHashTable< Key, T >::find().
Referenced by KviHtmlGenerator::convertToHtml(), KviIrcView::getTextLine(), KviTopicWidget::paintColoredText(), KviIrcView::paintEvent(), texticons_kvs_cmd_set(), and texticons_kvs_fnc_get().
void KviTextIconManager::save | ( | ) |
Saves the dictionary.
References KviApplication::Config, g_pApp, KviApplication::getLocalKvircDirectory(), KVI_CONFIGFILE_TEXTICONS, and save().
Referenced by OptionsWidget_textIcons::commit(), save(), and KviApplication::saveTextIcons().
|
protected |
Saves the dictionary to a file.
This is the real save() function
szFileName | The filename where to save |
References KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), m_pTextIconDict, KviConfigurationFile::setGroup(), TEXTICONMANAGER_CURRENT_CONFIG_UPDATE, KviConfigurationFile::Write, and KviConfigurationFile::writeEntry().
|
inline |
Returns the dictionary of the icons.
Referenced by KviTextIconWindow::fill(), OptionsWidget_textIcons::fillTable(), texticons_kvs_cmd_set(), and texticons_kvs_fnc_get().
|
friend |
|
friend |
|
private |
Referenced by applyOptions(), checkDefaultAssociations(), clear(), insert(), insert(), KviTextIconManager(), load(), save(), and ~KviTextIconManager().