KVIrc 5.2.0
Developer APIs
KviTextIconManager.h
Go to the documentation of this file.
1#ifndef _KVI_TEXTICONMANAGER_H_
2#define _KVI_TEXTICONMANAGER_H_
3//=============================================================================
4//
5// File : KviTextIconManager.h
6// Creation date : Thu 15 May 2002 12:04:12 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2002-2010 Szymon Stefanek (pragma at kvirc dot net)
10//
11// This program is FREE software. You can redistribute it and/or
12// modify it under the terms of the GNU General Public License
13// as published by the Free Software Foundation; either version 2
14// of the License, or (at your option) any later version.
15//
16// This program is distributed in the HOPE that it will be USEFUL,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19// See the GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program. If not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24//
25//=============================================================================
26
35#include "kvi_settings.h"
36#include "KviAnimatedPixmap.h"
37#include "KviIconManager.h"
38#include "KviPointerHashTable.h"
39
40#include <QPixmap>
41
42#define TEXTICONMANAGER_CURRENT_CONFIG_UPDATE 9
43
50{
51 const char * name;
52 int iVal;
53};
54
60{
61protected:
63 QString m_szFileName;
65
66public:
73
79 KviTextIcon(const QString & szFile);
80
86 KviTextIcon(KviTextIcon * pIcon);
87
92
93public:
98 KviIconManager::SmallIcon id() const { return m_eIcon; }
99
105 void setId(KviIconManager::SmallIcon eIcon);
106
113 void setId(int iIcon);
114
120 void setFilename(const QString & szFileName);
121
126 const QString & filename() const { return m_szFileName; }
127
132 QPixmap * pixmap();
133
134 void setPixmap(QPixmap * pIcon);
135
141};
142
147class KVIRC_API KviTextIconManager : public QObject
148{
149 friend class KviTextIconWindow;
150 friend class KviTextIconsOptionsWidget;
151 Q_OBJECT
152public:
158
163
164private:
166
167public:
172 KviPointerHashTable<QString, KviTextIcon> * textIconDict() const { return m_pTextIconDict; }
173
178 void checkDefaultAssociations();
179
184 void clear();
185
192 void insert(const QString & szName, int iId);
193
200 void insert(const QString & szName, KviTextIcon & icon);
201
207 KviTextIcon * lookupTextIcon(const QString & szName) { return m_pTextIconDict->find(szName); }
208
213 void load();
214
219 void save();
220
225 void applyOptions();
226
227protected:
235 void save(const QString & szFileName);
236
246 int load(const QString & szFileName, bool bMerge = false);
247signals:
252 void changed();
253};
254
255#ifndef _KVI_TEXTICONMANAGER_CPP_
257#endif
258
259#endif //_KVI_TEXTICONMANAGER_H_
Icon manager.
Pointer Hash Table.
KVIRC_API KviTextIconManager * g_pTextIconManager
Definition KviTextIconManager.cpp:58
btnDict clear()
m_pAnimatedPixmap
Definition KvsObject_pixmap.cpp:110
Definition KviAnimatedPixmap.h:70
SmallIcon
Contains all KVIrc's small icons.
Definition KviIconManager.h:170
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
T * find(const Key &hKey)
Returns the item associated to the key.
Definition KviPointerHashTable.h:471
The class that manages the icons.
Definition KviTextIconManager.h:148
KviPointerHashTable< QString, KviTextIcon > * textIconDict() const
Returns the dictionary of the icons.
Definition KviTextIconManager.h:172
KviPointerHashTable< QString, KviTextIcon > * m_pTextIconDict
Definition KviTextIconManager.h:165
KviTextIcon * lookupTextIcon(const QString &szName)
Returns the text of the icon.
Definition KviTextIconManager.h:207
void changed()
Called when the default associations change.
Text icon window class.
Definition KviTextIconWindow.h:41
The class that holds the icons.
Definition KviTextIconManager.h:60
const QString & filename() const
Returns the filename of the icon.
Definition KviTextIconManager.h:126
void setPixmap(QPixmap *pIcon)
KviAnimatedPixmap * animatedPixmap() const
Returns the animated pixmap associated to the icon.
Definition KviTextIconManager.h:140
KviIconManager::SmallIcon m_eIcon
Definition KviTextIconManager.h:62
KviIconManager::SmallIcon id() const
Returns the id of the icon.
Definition KviTextIconManager.h:98
QString m_szFileName
Definition KviTextIconManager.h:63
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127
Definition KviTextIconManager.h:50
int iVal
Definition KviTextIconManager.h:52
const char * name
Definition KviTextIconManager.h:51