summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/opluginloader.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/opluginloader.h b/libopie2/opiecore/opluginloader.h
index 740551c..7582d29 100644
--- a/libopie2/opiecore/opluginloader.h
+++ b/libopie2/opiecore/opluginloader.h
@@ -1,116 +1,116 @@
1/* 1/*
2 * LGPLv2 or later 2 * LGPLv2 or later
3 * zecke@handhelds.org 3 * zecke@handhelds.org
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 <qptrdict.h>
11#include <qstringlist.h> 11#include <qstringlist.h>
12 12
13namespace Opie { 13namespace Opie {
14namespace Core { 14namespace Core {
15class OConfig; 15class OConfig;
16namespace Internal { 16namespace Internal {
17class OPluginLibraryHolder; 17class OPluginLibraryHolder;
18} 18}
19 19
20template class QPtrDict<QLibrary>; 20// template class QPtrDict<QLibrary>;
21 21
22/** 22/**
23 * \brief A small item representing the Plugin Information 23 * \brief A small item representing the Plugin Information
24 * This class contains the information about a Plugin. It contains 24 * This class contains the information about a Plugin. It contains
25 * a translated name if available to the system, a config key, 25 * a translated name if available to the system, a config key,
26 * and the path location. 26 * and the path location.
27 * 27 *
28 * @since 1.2 28 * @since 1.2
29 * 29 *
30 */ 30 */
31class OPluginItem { 31class OPluginItem {
32public: 32public:
33 typedef QValueList<OPluginItem> List; 33 typedef QValueList<OPluginItem> List;
34 OPluginItem(); 34 OPluginItem();
35 OPluginItem( const QString& name, const QString& path, bool enabled = true, int pos = -1 ); 35 OPluginItem( const QString& name, const QString& path, bool enabled = true, int pos = -1 );
36 ~OPluginItem(); 36 ~OPluginItem();
37 37
38 bool isEmpty()const; 38 bool isEmpty()const;
39 39
40 bool operator==( const OPluginItem& )const; 40 bool operator==( const OPluginItem& )const;
41 bool operator!=( const OPluginItem& )const; 41 bool operator!=( const OPluginItem& )const;
42 42
43 43
44 QString name()const; 44 QString name()const;
45 QString path()const; 45 QString path()const;
46 bool isEnabled()const; 46 bool isEnabled()const;
47 int position()const; 47 int position()const;
48 48
49 void setName( const QString& ); 49 void setName( const QString& );
50 void setPath( const QString& ); 50 void setPath( const QString& );
51 void setEnabled( bool ); 51 void setEnabled( bool );
52 void setPosition( int ); 52 void setPosition( int );
53 53
54private: 54private:
55 QString m_name; 55 QString m_name;
56 QString m_path; 56 QString m_path;
57 bool m_enabled : 1; 57 bool m_enabled : 1;
58 int m_pos; 58 int m_pos;
59 struct Private; 59 struct Private;
60 Private *d; 60 Private *d;
61}; 61};
62 62
63/** 63/**
64 * \brief A generic class to easily load and manage plugins 64 * \brief A generic class to easily load and manage plugins
65 * 65 *
66 * This is the generic non sepcialised loader for plugins. Normally 66 * This is the generic non sepcialised loader for plugins. Normally
67 * you would prefer using the OPluginLoader directly. This class 67 * you would prefer using the OPluginLoader directly. This class
68 * exists to minimize the application binary size due the usage 68 * exists to minimize the application binary size due the usage
69 * of templates in the specialized API 69 * of templates in the specialized API
70 * 70 *
71 * @since 1.2 71 * @since 1.2
72 * @see OPluginLoader 72 * @see OPluginLoader
73 */ 73 */
74class OGenericPluginLoader { 74class OGenericPluginLoader {
75public: 75public:
76 typedef OPluginItem::List List; 76 typedef OPluginItem::List List;
77 OGenericPluginLoader( const QString &name, bool isSorted = false ); 77 OGenericPluginLoader( const QString &name, bool isSorted = false );
78 virtual ~OGenericPluginLoader(); 78 virtual ~OGenericPluginLoader();
79 79
80 void setAutoDelete( bool ); 80 void setAutoDelete( bool );
81 bool autoDelete()const; 81 bool autoDelete()const;
82 void clear(); 82 void clear();
83 83
84 QString name()const; 84 QString name()const;
85 bool isSorted()const; 85 bool isSorted()const;
86 bool isInSafeMode()const; 86 bool isInSafeMode()const;
87 87
88 88
89 List allAvailable(bool sorted = false )const; 89 List allAvailable(bool sorted = false )const;
90 List filtered(bool sorted = false )const; 90 List filtered(bool sorted = false )const;
91 91
92 92
93 virtual QUnknownInterface* load( const OPluginItem& item, const QUuid& ); 93 virtual QUnknownInterface* load( const OPluginItem& item, const QUuid& );
94 virtual void unload( QUnknownInterface* ); 94 virtual void unload( QUnknownInterface* );
95 95
96protected: 96protected:
97 friend class OPluginManager; // we need the static unlibify 97 friend class OPluginManager; // we need the static unlibify
98 void readConfig(); 98 void readConfig();
99 virtual List plugins( const QString& dir, bool sorted, bool disabled )const; 99 virtual List plugins( const QString& dir, bool sorted, bool disabled )const;
100 void setPluginDirs( const QStringList& ); 100 void setPluginDirs( const QStringList& );
101 void setPluginDir( const QString& ); 101 void setPluginDir( const QString& );
102 void setSafeMode(const QString& app = QString::null, bool b = false); 102 void setSafeMode(const QString& app = QString::null, bool b = false);
103 static QString unlibify( const QString& str ); 103 static QString unlibify( const QString& str );
104private: 104private:
105 QStringList languageList(); 105 QStringList languageList();
106 void installTranslators(const QString& type); 106 void installTranslators(const QString& type);
107 QString m_dir; 107 QString m_dir;
108 QStringList m_plugDirs; 108 QStringList m_plugDirs;
109 QStringList m_languages; 109 QStringList m_languages;
110 bool m_autoDelete : 1; 110 bool m_autoDelete : 1;
111 bool m_isSafeMode : 1; 111 bool m_isSafeMode : 1;
112 bool m_isSorted : 1; 112 bool m_isSorted : 1;
113 QPtrDict<QLibrary> m_library; 113 QPtrDict<QLibrary> m_library;
114 114
115 struct Private; 115 struct Private;
116 Private* d; 116 Private* d;