~ubuntu-branches/ubuntu/trusty/kvirc/trusty

« back to all changes in this revision

Viewing changes to src/modules/system/plugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _PLUGIN_H_
2
 
#define _PLUGIN_H_
3
 
 
4
 
//=============================================================================
5
 
//
6
 
//   File : plugin.h
7
 
//   Creation date : Wed Apr 11 04 2007 00:54:00 GMT+1 by TheXception
8
 
//
9
 
//   This file is part of the KVirc irc client distribution
10
 
//   Copyright (C) 2007-2008 TheXception
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 opinion) 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_module.h"
29
 
#include "kvi_pointerhashtable.h"
30
 
#include <QLibrary>
31
 
 
32
 
typedef int (*plugin_function)(int argc, char* argv[], char ** buffer);
33
 
typedef int (*plugin_unload)();
34
 
typedef int (*plugin_canunload)();
35
 
typedef int (*plugin_load)();
36
 
typedef int (*plugin_free)(char * pBuffer);
37
 
 
38
 
class KviPlugin
39
 
{
40
 
protected:
41
 
        // You have to create plugin instance by calling KviPlugin::load()
42
 
        KviPlugin(QLibrary * pLibrary,const QString& name);
43
 
public:
44
 
        ~KviPlugin();
45
 
private:
46
 
        // shared
47
 
        // internal
48
 
        QLibrary *m_pLibrary;
49
 
        QString   m_szName;
50
 
public:
51
 
        static KviPlugin* load(const QString& szFileName);
52
 
        bool pfree(char * pBuffer);
53
 
        bool unload();
54
 
        bool canunload();
55
 
        int call(const QString& szFunctionName, int argc, char * argv[], char ** pBuffer);
56
 
        QString name() const;
57
 
        void setName(const QString& szName);
58
 
protected:
59
 
};
60
 
 
61
 
class KviPluginManager
62
 
{
63
 
        public:
64
 
                KviPluginManager();
65
 
                ~KviPluginManager();
66
 
        private:
67
 
                // shared
68
 
                bool m_bCanUnload;
69
 
                // internal
70
 
                KviPointerHashTable<QString,KviPlugin> * m_pPluginDict;
71
 
        public:
72
 
                bool pluginCall(KviKvsModuleFunctionCall *c);
73
 
                bool checkUnload();
74
 
                void unloadAll();
75
 
        protected:
76
 
                bool findPlugin(QString& szName);
77
 
                bool isPluginLoaded(const QString& szFileNameOrPathToLoad);
78
 
                bool loadPlugin(const QString& szPluginPath);
79
 
                KviPlugin * getPlugin(const QString& szPluginPath);
80
 
};
81
 
 
82
 
#endif //_PLUGIN_H_