author | zecke <zecke> | 2004-05-12 19:08:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-12 19:08:58 (UTC) |
commit | 00efb6af5ff15e43913f91fcc5c33805233c7e91 (patch) (unidiff) | |
tree | 9e661ed6a94e40e642a5d03f56e46125d0eaa852 | |
parent | 7a9cabb330284777113bb544139843dcf0593628 (diff) | |
download | opie-00efb6af5ff15e43913f91fcc5c33805233c7e91.zip opie-00efb6af5ff15e43913f91fcc5c33805233c7e91.tar.gz opie-00efb6af5ff15e43913f91fcc5c33805233c7e91.tar.bz2 |
As pointed out on irc the template functions fail to compile.
I've removed the method in the base class so remove in OPluginLoader as well
Evaluate if we want to allow loading of a 'path' + QUUid or only via
OPluginItem
-rw-r--r-- | libopie2/opiecore/opluginloader.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/libopie2/opiecore/opluginloader.h b/libopie2/opiecore/opluginloader.h index 421d1f6..6166b75 100644 --- a/libopie2/opiecore/opluginloader.h +++ b/libopie2/opiecore/opluginloader.h | |||
@@ -43,145 +43,139 @@ public: | |||
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 setPath( const QString& ); | 47 | void setPath( const QString& ); |
48 | void setPosition( int ); | 48 | void setPosition( int ); |
49 | 49 | ||
50 | private: | 50 | private: |
51 | QString m_name; | 51 | QString m_name; |
52 | QString m_path; | 52 | QString m_path; |
53 | int m_pos; | 53 | int m_pos; |
54 | struct Private; | 54 | struct Private; |
55 | Private *d; | 55 | Private *d; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * \brief A generic class to easily load and manage plugins | 59 | * \brief A generic class to easily load and manage plugins |
60 | * | 60 | * |
61 | * This is the generic non sepcialised loader for plugins. Normally | 61 | * This is the generic non sepcialised loader for plugins. Normally |
62 | * you would prefer using the OPluginLoader directly. This class | 62 | * you would prefer using the OPluginLoader directly. This class |
63 | * exists to minimize the application binary size due the usage | 63 | * exists to minimize the application binary size due the usage |
64 | * of templates in the specialized API | 64 | * of templates in the specialized API |
65 | * | 65 | * |
66 | * @since 1.2 | 66 | * @since 1.2 |
67 | * @see OPluginLoader | 67 | * @see OPluginLoader |
68 | */ | 68 | */ |
69 | class OGenericPluginLoader { | 69 | class OGenericPluginLoader { |
70 | public: | 70 | public: |
71 | typedef OPluginItem::List List; | 71 | typedef OPluginItem::List List; |
72 | OGenericPluginLoader( const QString &name, bool isSorted = false ); | 72 | OGenericPluginLoader( const QString &name, bool isSorted = false ); |
73 | virtual ~OGenericPluginLoader(); | 73 | virtual ~OGenericPluginLoader(); |
74 | 74 | ||
75 | void setAutoDelete( bool ); | 75 | void setAutoDelete( bool ); |
76 | bool autoDelete()const; | 76 | bool autoDelete()const; |
77 | void clear(); | 77 | void clear(); |
78 | 78 | ||
79 | 79 | ||
80 | bool isInSafeMode()const; | 80 | bool isInSafeMode()const; |
81 | 81 | ||
82 | 82 | ||
83 | List allAvailable(bool sorted = FALSE)const; | 83 | List allAvailable(bool sorted = FALSE)const; |
84 | List filtered(bool sorted = FALSE)const; | 84 | List filtered(bool sorted = FALSE)const; |
85 | 85 | ||
86 | 86 | ||
87 | virtual QUnknownInterface* load( const OPluginItem& item, const QUuid& ); | 87 | virtual QUnknownInterface* load( const OPluginItem& item, const QUuid& ); |
88 | virtual void unload( QUnknownInterface* ); | 88 | virtual void unload( QUnknownInterface* ); |
89 | 89 | ||
90 | protected: | 90 | protected: |
91 | void readConfig(); | 91 | void readConfig(); |
92 | virtual List plugins( const QString& dir, bool sorted, bool disabled )const; | 92 | virtual List plugins( const QString& dir, bool sorted, bool disabled )const; |
93 | void setPluginDirs( const QStringList& ); | 93 | void setPluginDirs( const QStringList& ); |
94 | void setPluginDir( const QString& ); | 94 | void setPluginDir( const QString& ); |
95 | bool isSorted()const; | 95 | bool isSorted()const; |
96 | void setSafeMode(const QString& app = QString::null, bool b = false); | 96 | void setSafeMode(const QString& app = QString::null, bool b = false); |
97 | static QString unlibify( const QString& str ); | 97 | static QString unlibify( const QString& str ); |
98 | 98 | ||
99 | private: | 99 | private: |
100 | QStringList languageList(); | 100 | QStringList languageList(); |
101 | void installTranslators(const QString& type); | 101 | void installTranslators(const QString& type); |
102 | QString m_dir; | 102 | QString m_dir; |
103 | QStringList m_plugDirs; | 103 | QStringList m_plugDirs; |
104 | QStringList m_languages; | 104 | QStringList m_languages; |
105 | bool m_autoDelete : 1; | 105 | bool m_autoDelete : 1; |
106 | bool m_isSafeMode : 1; | 106 | bool m_isSafeMode : 1; |
107 | bool m_isSorted : 1; | 107 | bool m_isSorted : 1; |
108 | QPtrDict<QLibrary> m_library; | 108 | QPtrDict<QLibrary> m_library; |
109 | 109 | ||
110 | struct Private; | 110 | struct Private; |
111 | Private* d; | 111 | Private* d; |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | * \brief The class to load your QCOM+ plugins | 115 | * \brief The class to load your QCOM+ plugins |
116 | * | 116 | * |
117 | * This class takes care of activation and even the order | 117 | * This class takes care of activation and even the order |
118 | * if you need it. It is normally good to place a .directory file | 118 | * if you need it. It is normally good to place a .directory file |
119 | * into your plugin directory if you need order of activation. | 119 | * into your plugin directory if you need order of activation. |
120 | * | 120 | * |
121 | * You'll create the OPluginLoader and then use it to load the filtered | 121 | * You'll create the OPluginLoader and then use it to load the filtered |
122 | * plugins. | 122 | * plugins. |
123 | * | 123 | * |
124 | * There is also a GUI for the configuration and a Manager to write the | 124 | * There is also a GUI for the configuration and a Manager to write the |
125 | * mentioned .directory file | 125 | * mentioned .directory file |
126 | * | 126 | * |
127 | * On crash the safe mode is activated for the next run. You can then decide | 127 | * On crash the safe mode is activated for the next run. You can then decide |
128 | * if you want to load plugins or come up with the Configuration on | 128 | * if you want to load plugins or come up with the Configuration on |
129 | * next start yourself then. | 129 | * next start yourself then. |
130 | * | 130 | * |
131 | * @since 1.2 | 131 | * @since 1.2 |
132 | */ | 132 | */ |
133 | class OPluginLoader : public OGenericPluginLoader { | 133 | class OPluginLoader : public OGenericPluginLoader { |
134 | public: | 134 | public: |
135 | OPluginLoader( const QString& name, bool sorted = false ); | 135 | OPluginLoader( const QString& name, bool sorted = false ); |
136 | ~OPluginLoader(); | 136 | ~OPluginLoader(); |
137 | 137 | ||
138 | template<class IFace> | 138 | template<class IFace> |
139 | IFace* load( const QString& name, const QUuid& ); | ||
140 | template<class IFace> | ||
141 | IFace* load( const OPluginItem& item, const QUuid& ); | 139 | IFace* load( const OPluginItem& item, const QUuid& ); |
142 | }; | 140 | }; |
143 | 141 | ||
144 | /** | 142 | /** |
145 | * \brief A class to manager order and activation of plugins | 143 | * \brief A class to manager order and activation of plugins |
146 | * | 144 | * |
147 | * Manage order and activation. This is used by the Opie::Ui::OPluginConfig | 145 | * Manage order and activation. This is used by the Opie::Ui::OPluginConfig |
148 | * This class controls the activation and order of plugins depending | 146 | * This class controls the activation and order of plugins depending |
149 | * on the OPluginLoader you supply. | 147 | * on the OPluginLoader you supply. |
150 | * | 148 | * |
151 | * @see OPluginConfig | 149 | * @see OPluginConfig |
152 | * | 150 | * |
153 | */ | 151 | */ |
154 | class OPluginManager { | 152 | class OPluginManager { |
155 | public: | 153 | public: |
156 | OPluginManager( OGenericPluginLoader* , const QString& name); | 154 | OPluginManager( OGenericPluginLoader* , const QString& name); |
157 | OPluginManager( OConfig* conf, const QString&, | 155 | OPluginManager( OConfig* conf, const QString&, |
158 | const QCString& group, const OPluginItem::List& ); | 156 | const QCString& group, const OPluginItem::List& ); |
159 | ~OPluginManager(); | 157 | ~OPluginManager(); |
160 | 158 | ||
161 | QString name(); | 159 | QString name(); |
162 | void setName( const QString& ); | 160 | void setName( const QString& ); |
163 | 161 | ||
164 | void setPosition( const OPluginItem& ); | 162 | void setPosition( const OPluginItem& ); |
165 | void enable( const OPluginItem& ); | 163 | void enable( const OPluginItem& ); |
166 | void disable( const OPluginItem& ); | 164 | void disable( const OPluginItem& ); |
167 | void setEnabled( const OPluginItem&, bool = true); | 165 | void setEnabled( const OPluginItem&, bool = true); |
168 | 166 | ||
169 | void load(); | 167 | void load(); |
170 | void save(); | 168 | void save(); |
171 | }; | 169 | }; |
172 | 170 | ||
173 | template<class IFace> | ||
174 | IFace* OPluginLoader::load( const QString& name, const QUuid& uid ) { | ||
175 | return static_cast<IFace*>( OGenericPluginLoader::load( item, uid ) ); | ||
176 | } | ||
177 | 171 | ||
178 | template<class IFace> | 172 | template<class IFace> |
179 | IFace* OPluginLoader::load( const OPluginItem& item, const QUuid& uid ) { | 173 | IFace* OPluginLoader::load( const OPluginItem& item, const QUuid& uid ) { |
180 | return static_cast<IFace*>( OGenericPluginLoader::load( item, uid ) ); | 174 | return static_cast<IFace*>( OGenericPluginLoader::load( item, uid ) ); |
181 | } | 175 | } |
182 | 176 | ||
183 | } | 177 | } |
184 | } | 178 | } |
185 | 179 | ||
186 | 180 | ||
187 | #endif | 181 | #endif |