KVIrc  4.9.2
DeveloperAPIs
KviModuleManager.h
Go to the documentation of this file.
1 #ifndef _KVI_MODULEMANAGER_H_
2 #define _KVI_MODULEMANAGER_H_
3 
4 //=============================================================================
5 //
6 // File : KviModuleManager.h
7 // Creation date : Sat Aug 12 2000 20:31:17 by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "kvi_settings.h"
29 #include "KviPointerList.h"
30 #include "KviModule.h"
31 #include "KviPointerHashTable.h"
32 
33 #include <QTimer>
34 #include <QObject>
35 
36 class KVIRC_API KviModuleManager : public QObject
37 {
38  Q_OBJECT
39 public:
42 
43 private:
45  QTimer * m_pCleanupTimer;
46  QString m_szLastError;
47 
48 public:
49  QString & lastError() { return m_szLastError; };
50  KviModule * findModule(const QString & modName);
51  KviModule * getModule(const QString & modName);
52  bool loadModule(const QString & modName);
53  bool unloadModule(const QString & modName);
54  bool unloadModule(KviModule * module);
55  void unloadAllModules();
56  //void registerDefaultCommands(KviModule * module);
57  void loadModulesByCaps(const QString & caps, const QString & dir);
58  void loadModulesByCaps(const QString & caps);
59  bool hasLockedModules();
60  void completeModuleNames(const QString & word, KviPointerList<QString> * matches);
61 
62 protected:
63  void completeModuleNames(const QString & path, const QString & work, KviPointerList<QString> * matches);
64 public slots:
65  void cleanupUnusedModules();
66 signals:
67  void moduleAboutToUnload(KviModule * m);
68 };
69 
71 
72 #endif //_KVI_MODULEMANAGER_H_
#define KVIRC_API
Definition: kvi_settings.h:128
KVIRC_API KviModuleManager * g_pModuleManager
Definition: KviModuleManager.cpp:39
#define m
Definition: detector.cpp:77
QTimer * m_pCleanupTimer
Definition: KviModuleManager.h:45
QString m_szLastError
Definition: KviModuleManager.h:46
Pointer Hash Table.
Definition: KviModuleManager.h:36
C++ Template based double linked pointer list class.
Definition: KviModule.h:131
KviPointerHashTable< QString, KviModule > * m_pModuleDict
Definition: KviModuleManager.h:44
This file contains compile time settings.
QString & lastError()
Definition: KviModuleManager.h:49