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