author | zecke <zecke> | 2004-05-18 20:58:40 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-18 20:58:40 (UTC) |
commit | f12bce1641990d64067634b7817430bc080d9e23 (patch) (unidiff) | |
tree | f0831eadeacd8d09f6bdef3de91833e9611ab92f | |
parent | 59c6451a16405f19b1d4bc97906bd5778b5b0cd3 (diff) | |
download | opie-f12bce1641990d64067634b7817430bc080d9e23.zip opie-f12bce1641990d64067634b7817430bc080d9e23.tar.gz opie-f12bce1641990d64067634b7817430bc080d9e23.tar.bz2 |
My Idea of a PluginConfig Widget part II :)
Now on to implementing it
-rw-r--r-- | libopie2/opieui/opluginconfig.h | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/libopie2/opieui/opluginconfig.h b/libopie2/opieui/opluginconfig.h index 1ff4858..bfee5bf 100644 --- a/libopie2/opieui/opluginconfig.h +++ b/libopie2/opieui/opluginconfig.h | |||
@@ -1,38 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | * LGPLv2 zecke@handhelds.org | 2 | * LGPLv2 zecke@handhelds.org |
3 | */ | 3 | */ |
4 | #ifndef ODP_OPIE_UI_OPLUGIN_CONFIG_H | 4 | #ifndef ODP_OPIE_UI_OPLUGIN_CONFIG_H |
5 | #define ODP_OPIE_UI_OPLUGIN_CONFIG_H | 5 | #define ODP_OPIE_UI_OPLUGIN_CONFIG_H |
6 | 6 | ||
7 | #include <qwidget.h> | 7 | #include <qwidget.h> |
8 | 8 | ||
9 | namespace Opie { | 9 | namespace Opie { |
10 | namespace Core { | 10 | namespace Core { |
11 | class OPluginManager; | 11 | class OPluginManager; |
12 | class OGenericPluginLoader; | 12 | class OGenericPluginLoader; |
13 | } | 13 | } |
14 | namespace Ui { | 14 | namespace Ui { |
15 | class OPluginConfig : public QWidget { | 15 | /** |
16 | * With this widget you can configure one or many PluginLoaders either | ||
17 | * through an already existing Opie::Core::OPluginManager or Opie::Core::OGenericPluginLoader | ||
18 | * The sorted state will be read from the Loader. | ||
19 | * | ||
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 | ||
22 | * call save. | ||
23 | * | ||
24 | * Internally we operate on Opie::Core::OPluginManager. | ||
25 | * | ||
26 | * @see Opie::Ui::OKeyConfigWidget | ||
27 | * @see Opie::Core::OPluginLoader | ||
28 | * @see Opie::Core::OPluginManager | ||
29 | * | ||
30 | * @author zecke | ||
31 | * @since Opie 1.1.5 | ||
32 | * | ||
33 | */ | ||
34 | class OPluginConfigWidget : public QWidget { | ||
16 | public: | 35 | public: |
17 | enum Mode { Queued, Immediate }; | 36 | enum ChangeMode { Queued, Immediate }; |
18 | OPluginConfig( QWidget* wid, const char*, WFlags fl ); | 37 | OPluginConfigWidget( QWidget* wid = 0, const char* name = 0, WFlags fl = 0); |
19 | OPluginConfig( OGenericPluginManager* manager, QWidget* wid, | 38 | OPluginConfig( Opie::Core::OPluginManager* manager, QWidget* wid = 0, |
20 | const char* name, WFlags fl ); | 39 | const char* name = 0, WFlags fl = 0); |
21 | OPluginConfig( OPluginLoader* loader, QWidget* wid, const char* name, | 40 | OPluginConfig( Opie::Core::OGenericPluginLoader* loader, QWidget* wid, const char* name, |
22 | WFlags fl ); | 41 | WFlags fl ); |
23 | 42 | ||
24 | ~OPluginConfig(); | 43 | ~OPluginConfig(); |
25 | 44 | ||
26 | void setMode( enum Mode ); | 45 | void setChangeMode( enum Mode ); |
27 | Mode mode()const; | 46 | ChangeMode mode()const; |
47 | |||
48 | void insert( const QString&, const Opie::Core::OPluginManager* ); | ||
49 | void insert( const QString&, const Opie::Core::OPluginLoader* ); | ||
28 | 50 | ||
29 | void insert( const OPluginManager* ); | 51 | signals: |
30 | void insert( const OPluginLoader* , const QString& name ); | 52 | /** |
53 | * @param item The new OPluginItem | ||
54 | */ | ||
55 | void pluginChanged ( const Opie::Core::OPluginItem& item, bool old_state); | ||
56 | void pluginEnabled ( const Opie::Core::OPluginItem& item); | ||
57 | void pluginDisabled( const Opie::Core::OPluginItem& item); | ||
58 | public: | ||
31 | 59 | ||
32 | void load(); | 60 | void load(); |
33 | void save(); | 61 | void save(); |
62 | private: | ||
63 | |||
34 | }; | 64 | }; |
35 | } | 65 | } |
36 | } | 66 | } |
37 | 67 | ||
38 | #endif | 68 | #endif |