author | zecke <zecke> | 2004-05-28 16:20:57 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-28 16:20:57 (UTC) |
commit | 9521c1627157bf15824b5b55b9782b87cc610df6 (patch) (unidiff) | |
tree | ee0d9dc734e8db0e85a3e4d6ad0ee548c31f4115 /libopie2/opieui/opluginconfig.h | |
parent | 8db08a3d320e48924d0ccd78d2bd177e316fff90 (diff) | |
download | opie-9521c1627157bf15824b5b55b9782b87cc610df6.zip opie-9521c1627157bf15824b5b55b9782b87cc610df6.tar.gz opie-9521c1627157bf15824b5b55b9782b87cc610df6.tar.bz2 |
Ideas of the API of the Generic PluginLoader
Diffstat (limited to 'libopie2/opieui/opluginconfig.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/opluginconfig.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/libopie2/opieui/opluginconfig.h b/libopie2/opieui/opluginconfig.h index bfee5bf..0db1fcb 100644 --- a/libopie2/opieui/opluginconfig.h +++ b/libopie2/opieui/opluginconfig.h | |||
@@ -12,57 +12,83 @@ namespace Core { | |||
12 | class OGenericPluginLoader; | 12 | class OGenericPluginLoader; |
13 | } | 13 | } |
14 | namespace Ui { | 14 | namespace Ui { |
15 | /** | 15 | /** |
16 | * With this widget you can configure one or many PluginLoaders either | 16 | * With this widget you can configure one or many PluginLoaders either |
17 | * through an already existing Opie::Core::OPluginManager or Opie::Core::OGenericPluginLoader | 17 | * through an already existing Opie::Core::OPluginManager or Opie::Core::OGenericPluginLoader |
18 | * The sorted state will be read from the Loader. | 18 | * The sorted state will be read from the Loader. |
19 | * | 19 | * |
20 | * As with Opie::Ui::OKeyConfigWidget you can have two options. To either apply your changes | 20 | * As with Opie::Ui::OKeyConfigWidget you can have two options. To either apply your changes |
21 | * directly through Opie::Core::OPluginManager or to use Queued where you manually need to | 21 | * directly through Opie::Core::OPluginManager or to use Queued where you manually need to |
22 | * call save. | 22 | * call save. |
23 | * | 23 | * |
24 | * Internally we operate on Opie::Core::OPluginManager. | 24 | * Internally we operate on Opie::Core::OPluginManager. You can insert any numbers of loaders |
25 | * or pluginmanagers. But you need to call load() after you've inserted new items. | ||
25 | * | 26 | * |
26 | * @see Opie::Ui::OKeyConfigWidget | 27 | * @see Opie::Ui::OKeyConfigWidget |
27 | * @see Opie::Core::OPluginLoader | 28 | * @see Opie::Core::OPluginLoader |
28 | * @see Opie::Core::OPluginManager | 29 | * @see Opie::Core::OPluginManager |
29 | * | 30 | * |
30 | * @author zecke | 31 | * @author zecke |
31 | * @since Opie 1.1.5 | 32 | * @since Opie 1.1.5 |
32 | * | 33 | * |
33 | */ | 34 | */ |
34 | class OPluginConfigWidget : public QWidget { | 35 | class OPluginConfigWidget : public QWidget { |
35 | public: | 36 | public: |
36 | enum ChangeMode { Queued, Immediate }; | 37 | enum ChangeMode { Queued, Immediate }; |
37 | OPluginConfigWidget( QWidget* wid = 0, const char* name = 0, WFlags fl = 0); | 38 | OPluginConfigWidget( QWidget* wid = 0, const char* name = 0, WFlags fl = 0); |
38 | OPluginConfig( Opie::Core::OPluginManager* manager, QWidget* wid = 0, | 39 | OPluginConfig( Opie::Core::OPluginManager* manager, QWidget* wid = 0, |
39 | const char* name = 0, WFlags fl = 0); | 40 | const char* name = 0, WFlags fl = 0); |
40 | OPluginConfig( Opie::Core::OGenericPluginLoader* loader, QWidget* wid, const char* name, | 41 | OPluginConfig( Opie::Core::OGenericPluginLoader* loader, QWidget* wid, const char* name, |
41 | WFlags fl ); | 42 | WFlags fl ); |
42 | 43 | ||
43 | ~OPluginConfig(); | 44 | virtual ~OPluginConfig(); |
44 | 45 | ||
45 | void setChangeMode( enum Mode ); | 46 | void setChangeMode( enum ChangeMode ); |
46 | ChangeMode mode()const; | 47 | ChangeMode mode()const; |
47 | 48 | ||
48 | void insert( const QString&, const Opie::Core::OPluginManager* ); | 49 | void insert( const QString&, const Opie::Core::OPluginManager* ); |
49 | void insert( const QString&, const Opie::Core::OPluginLoader* ); | 50 | void insert( const QString&, const Opie::Core::OGenericPluginLoader* ); |
50 | 51 | ||
51 | signals: | 52 | signals: |
52 | /** | 53 | /** |
53 | * @param item The new OPluginItem | 54 | * A PluginItem was changed. This signal is only emitted if you're |
55 | * in the immediate ChangeMode. | ||
56 | * This is emitted on any change ( disable,enable,pos) | ||
57 | * | ||
58 | * @param item The OPluginItem that was changed. This is how it looks now | ||
59 | * @param old_state If it was enabled before | ||
54 | */ | 60 | */ |
55 | void pluginChanged ( const Opie::Core::OPluginItem& item, bool old_state); | 61 | void pluginChanged ( const Opie::Core::OPluginItem& item, bool old_state); |
62 | |||
63 | /** | ||
64 | * emitted only if you're in Immediate when an Item was enabled | ||
65 | * | ||
66 | * @param item The Item that was enabled | ||
67 | */ | ||
56 | void pluginEnabled ( const Opie::Core::OPluginItem& item); | 68 | void pluginEnabled ( const Opie::Core::OPluginItem& item); |
69 | |||
70 | /** | ||
71 | * emitted only if you're in Immediate when an Item was enabled | ||
72 | * | ||
73 | * @param item The Item was disabled | ||
74 | */ | ||
57 | void pluginDisabled( const Opie::Core::OPluginItem& item); | 75 | void pluginDisabled( const Opie::Core::OPluginItem& item); |
76 | |||
77 | /** | ||
78 | * Data was saved(). Normally this is emitted when save() is called | ||
79 | * @see changed | ||
80 | */ | ||
81 | void changed(); | ||
58 | public: | 82 | public: |
59 | 83 | ||
60 | void load(); | 84 | void load(); |
61 | void save(); | 85 | void save(); |
62 | private: | 86 | private: |
87 | ChangeMode m_mode; | ||
88 | QMap<Opie::Core::OPluginManager*, bool> m_items; | ||
63 | 89 | ||
64 | }; | 90 | }; |
65 | } | 91 | } |
66 | } | 92 | } |
67 | 93 | ||
68 | #endif | 94 | #endif |