summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/opluginloader.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/opluginloader.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/opluginloader.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/libopie2/opiecore/opluginloader.h b/libopie2/opiecore/opluginloader.h
index a7df4a8..421d1f6 100644
--- a/libopie2/opiecore/opluginloader.h
+++ b/libopie2/opiecore/opluginloader.h
@@ -4,12 +4,13 @@
4 */ 4 */
5#ifndef ODP_CORE_OPLUGIN_LOADER_H 5#ifndef ODP_CORE_OPLUGIN_LOADER_H
6#define ODP_CORE_OPLUGIN_LOADER_H 6#define ODP_CORE_OPLUGIN_LOADER_H
7 7
8#include <qpe/qlibrary.h> 8#include <qpe/qlibrary.h>
9 9
10#include <qptrdict.h>
10#include <qstringlist.h> 11#include <qstringlist.h>
11 12
12namespace Opie { 13namespace Opie {
13namespace Core { 14namespace Core {
14class OConfig; 15class OConfig;
15namespace Internal { 16namespace Internal {
@@ -28,32 +29,29 @@ template class QPtrDict<QLibrary>;
28 * 29 *
29 */ 30 */
30class OPluginItem { 31class OPluginItem {
31public: 32public:
32 typedef QValueList<OPluginItem> List; 33 typedef QValueList<OPluginItem> List;
33 OPluginItem(); 34 OPluginItem();
34 OPluginItem( const QString& name, const QCString& confopt, const QString& path, int pos = -1 ); 35 OPluginItem( const QString& name, const QString& path, int pos = -1 );
35 ~OPluginItem(); 36 ~OPluginItem();
36 37
37 bool operator==( const OPluginItem& )const; 38 bool operator==( const OPluginItem& )const;
38 bool operator!=( const OPluginItem& )const; 39 bool operator!=( const OPluginItem& )const;
39 40
40 41
41 QString name()const; 42 QString name()const;
42 QCString configKey()const;
43 QString path()const; 43 QString path()const;
44 int position()const; 44 int position()const;
45 45
46 void setName( const QString& ); 46 void setName( const QString& );
47 void setConfigKey( const QCString& );
48 void setPath( const QString& ); 47 void setPath( const QString& );
49 void setPosition( int ); 48 void setPosition( int );
50 49
51private: 50private:
52 QString m_name; 51 QString m_name;
53 QCString m_conf;
54 QString m_path; 52 QString m_path;
55 int m_pos; 53 int m_pos;
56 struct Private; 54 struct Private;
57 Private *d; 55 Private *d;
58}; 56};
59 57
@@ -87,30 +85,28 @@ public:
87 85
88 86
89 virtual QUnknownInterface* load( const OPluginItem& item, const QUuid& ); 87 virtual QUnknownInterface* load( const OPluginItem& item, const QUuid& );
90 virtual void unload( QUnknownInterface* ); 88 virtual void unload( QUnknownInterface* );
91 89
92protected: 90protected:
93 virtual void readConfig(); 91 void readConfig();
94 virtual List plugins( const QString& dir, bool sorted, bool disabled )const; 92 virtual List plugins( const QString& dir, bool sorted, bool disabled )const;
95 void setPluginDirs( const QStringList& ); 93 void setPluginDirs( const QStringList& );
96 void setPluginDir( const QString& ); 94 void setPluginDir( const QString& );
97 bool &isSafeMode()const; 95 bool isSorted()const;
98 bool &isSorted()const; 96 void setSafeMode(const QString& app = QString::null, bool b = false);
99 void readConfig()const; 97 static QString unlibify( const QString& str );
100 void setSafeMode(bool b = false);
101 98
102private: 99private:
103 QString languageList(); 100 QStringList languageList();
104 void installTranslators(const QString& type); 101 void installTranslators(const QString& type);
105 QString m_dir; 102 QString m_dir;
106 QStringList m_plugDirs; 103 QStringList m_plugDirs;
107 QStringList m_languages; 104 QStringList m_languages;
108 bool m_autoDelete : 1; 105 bool m_autoDelete : 1;
109 bool m_isSafeMode : 1; 106 bool m_isSafeMode : 1;
110 bool m_readConfig : 1;
111 bool m_isSorted : 1; 107 bool m_isSorted : 1;
112 QPtrDict<QLibrary> m_library; 108 QPtrDict<QLibrary> m_library;
113 109
114 struct Private; 110 struct Private;
115 Private* d; 111 Private* d;
116}; 112};
@@ -136,15 +132,15 @@ private:
136 */ 132 */
137class OPluginLoader : public OGenericPluginLoader { 133class OPluginLoader : public OGenericPluginLoader {
138public: 134public:
139 OPluginLoader( const QString& name, bool sorted = false ); 135 OPluginLoader( const QString& name, bool sorted = false );
140 ~OPluginLoader(); 136 ~OPluginLoader();
141 137
142 temlate<class IFace> 138 template<class IFace>
143 IFace* load( const QString& name, const QUuid& ); 139 IFace* load( const QString& name, const QUuid& );
144 temlate<class IFace> 140 template<class IFace>
145 IFace* load( const OPluginItem& item, const QUuid& ); 141 IFace* load( const OPluginItem& item, const QUuid& );
146}; 142};
147 143
148/** 144/**
149 * \brief A class to manager order and activation of plugins 145 * \brief A class to manager order and activation of plugins
150 * 146 *