KVIrc 5.2.0
Developer APIs
KviKvsPopupManager.h
Go to the documentation of this file.
1#ifndef _KVI_KVS_POPUPMANAGER_H_
2#define _KVI_KVS_POPUPMANAGER_H_
3//=============================================================================
4//
5// File : KviKvsPopupManager.h
6// Creation date : Tue 7 Jan 2004 02:11:41 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2004-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
27#include "kvi_settings.h"
28#include "KviKvsPopupMenu.h"
29
30class KVIRC_API KviKvsPopupManager : public QObject
31{
32 Q_OBJECT
33protected: // can only be created by init/done
36
37protected:
40
41public:
42 static KviKvsPopupManager * instance() { return m_pInstance; };
43 static void init();
44 static void done();
45 int popupCount() { return m_pPopupDict->count(); };
46
48
49 KviKvsPopupMenu * lookup(const QString & szPopupName) { return m_pPopupDict->find(szPopupName); };
50 KviKvsPopupMenu * get(const QString & szPopupName);
51 void add(const QString & szPopupName, KviKvsPopupMenu * pPopup);
52 void remove(const QString & szPopupName) { m_pPopupDict->remove(szPopupName); };
53 void clear() { m_pPopupDict->clear(); };
54
55 void save(const QString & filename);
56 void load(const QString & filename);
57 void emitRefresh(const QString & szPopupName);
58signals:
59 void popupRefresh(const QString & szPopupName);
60};
61
62#endif
Definition KviKvsPopupManager.h:31
static KviKvsPopupManager * instance()
Definition KviKvsPopupManager.h:42
void clear()
Definition KviKvsPopupManager.h:53
void remove(const QString &szPopupName)
Definition KviKvsPopupManager.h:52
KviPointerHashTable< QString, KviKvsPopupMenu > * popupDict()
Definition KviKvsPopupManager.h:47
static KviKvsPopupManager * m_pInstance
Definition KviKvsPopupManager.h:39
KviKvsPopupMenu * lookup(const QString &szPopupName)
Definition KviKvsPopupManager.h:49
int popupCount()
Definition KviKvsPopupManager.h:45
KviPointerHashTable< QString, KviKvsPopupMenu > * m_pPopupDict
Definition KviKvsPopupManager.h:38
void popupRefresh(const QString &szPopupName)
Definition KviKvsPopupMenu.h:270
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
void clear()
Removes all the items from the hash table.
Definition KviPointerHashTable.h:650
unsigned int count() const
Returns the number of items in this hash table.
Definition KviPointerHashTable.h:502
bool remove(const Key &hKey)
Removes the item pointer associated to the key hKey, if such an item exists in the hash table.
Definition KviPointerHashTable.h:581
T * find(const Key &hKey)
Returns the item associated to the key.
Definition KviPointerHashTable.h:471
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127
int init()
Definition winamp.cpp:118