KVIrc  4.9.2
DeveloperAPIs
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 "KviPointerList.h"
31 #include "KviQString.h"
32 
33 #include "KviKvsScript.h"
34 
35 class KVIRC_API KviKvsAliasManager : public QObject
36 {
37  Q_OBJECT
38 protected: // it only can be created and destroyed by KviKvsAliasManager::init()/done()
41 
42 protected:
45 
46 public:
48  {
49  return m_pAliasManager;
50  };
51  static void init(); // called by KviKvs::init()
52  static void done(); // called by KviKvs::done()
53 
55  const KviKvsScript * lookup(const QString & szName)
56  {
57  return m_pAliasDict->find(szName);
58  };
59  void add(const QString & szName, KviKvsScript * pAlias);
60  bool remove(const QString & szName)
61  {
62  return m_pAliasDict->remove(szName);
63  };
64  bool removeNamespace(const QString & szName);
65  void clear()
66  {
67  m_pAliasDict->clear();
68  };
69 
70  void save(const QString & filename);
71  void load(const QString & filename);
72 
73  void completeCommand(const QString & word, KviPointerList<QString> * matches);
74 signals:
75  void aliasRefresh(const QString &);
76 };
77 // namespaces are handled completly in the editing!
78 #endif
#define KVIRC_API
Definition: kvi_settings.h:128
The KVIrc Script class.
Definition: KviKvsScript.h:59
KVIrc Script manager.
Pointer Hash Table.
void done()
Definition: KviKvs.cpp:50
const KviKvsScript * lookup(const QString &szName)
Definition: KviKvsAliasManager.h:55
bool save(KviThemeInfo &options, bool bSaveIcons)
Definition: KviOptions.cpp:986
KviPointerHashTable< QString, KviKvsScript > * aliasDict()
Definition: KviKvsAliasManager.h:54
void clear()
Definition: KviKvsAliasManager.h:65
KviPointerHashTable< QString, KviKvsScript > * m_pAliasDict
Definition: KviKvsAliasManager.h:43
C++ Template based double linked pointer list class.
static KviKvsAliasManager * instance()
Definition: KviKvsAliasManager.h:47
int init()
Definition: winamp.cpp:118
This file contains compile time settings.
Definition: KviKvsAliasManager.h:35
Helper functions for the QString class.
static KviKvsAliasManager * m_pAliasManager
Definition: KviKvsAliasManager.h:44