KVIrc 5.2.6
Developer APIs
KviKvsAliasManager.h
Go to the documentation of this file.
1#ifndef _KVI_KVS_ALIASMANAGER_H_
2#define _KVI_KVS_ALIASMANAGER_H_
3//=============================================================================
4//
5// File : KviKvsAliasManager.h
6// Creation date : Mon 15 Dec 2003 02:11:41 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2003-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 "KviPointerHashTable.h"
29
30#include "KviQString.h"
31
32#include "KviKvsScript.h"
33
34#include <vector>
35
36class KVIRC_API KviKvsAliasManager : public QObject
37{
38 Q_OBJECT
39protected: // it only can be created and destroyed by KviKvsAliasManager::init()/done()
42
43protected:
46
47public:
49 {
50 return m_pAliasManager;
51 };
52 static void init(); // called by KviKvs::init()
53 static void done(); // called by KviKvs::done()
54
56 const KviKvsScript * lookup(const QString & szName)
57 {
58 return m_pAliasDict->find(szName);
59 };
60 void add(const QString & szName, KviKvsScript * pAlias);
61 bool remove(const QString & szName)
62 {
63 return m_pAliasDict->remove(szName);
64 };
65 bool removeNamespace(const QString & szName);
66 void clear()
67 {
68 m_pAliasDict->clear();
69 };
70
71 void save(const QString & filename);
72 void load(const QString & filename);
73
74 void completeCommand(const QString & word, std::vector<QString> & matches);
75signals:
76 void aliasRefresh(const QString &);
77};
78// namespaces are handled completely in the editing!
79#endif
KVIrc Script manager.
Pointer Hash Table.
Helper functions for the QString class.
KviPointerHashTable< QString, KviKvsScript > * aliasDict()
Definition KviKvsAliasManager.h:55
const KviKvsScript * lookup(const QString &szName)
Definition KviKvsAliasManager.h:56
void clear()
Definition KviKvsAliasManager.h:66
KviKvsAliasManager()
Definition KviKvsAliasManager.cpp:30
void aliasRefresh(const QString &)
static KviKvsAliasManager * instance()
Definition KviKvsAliasManager.h:48
bool remove(const QString &szName)
Definition KviKvsAliasManager.h:61
KviPointerHashTable< QString, KviKvsScript > * m_pAliasDict
Definition KviKvsAliasManager.h:44
static KviKvsAliasManager * m_pAliasManager
Definition KviKvsAliasManager.h:45
The KVIrc Script class.
Definition KviKvsScript.h:60
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127
int init()
Definition winamp.cpp:118