Diffstat (limited to 'libopie2/opieui/opluginconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opieui/opluginconfigwidget.cpp | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/libopie2/opieui/opluginconfigwidget.cpp b/libopie2/opieui/opluginconfigwidget.cpp new file mode 100644 index 0000000..359e7a1 --- a/dev/null +++ b/libopie2/opieui/opluginconfigwidget.cpp | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * LGPLv2 2004 zecke@handhelds.org | ||
3 | */ | ||
4 | |||
5 | |||
6 | #include "opluginconfig.h" | ||
7 | |||
8 | #include <opie/opluginloader.h> | ||
9 | |||
10 | using Opie::Core::OPluginManager; | ||
11 | using Opie::Core::OGenericPluginLoader; | ||
12 | |||
13 | namespace Opie { | ||
14 | namespace Ui { | ||
15 | |||
16 | } | ||
17 | } | ||
18 | |||
19 | /** | ||
20 | * C'tor compatible with all Qt Widgets in its arguments. | ||
21 | * After constructing you need to insert and call load() | ||
22 | * | ||
23 | * The default mode is Queued | ||
24 | * | ||
25 | * @param wid the Widget | ||
26 | * @param name The name of the widget | ||
27 | * @param fl The widget flags you may want to set | ||
28 | * | ||
29 | * @see QWidget::QWidget | ||
30 | */ | ||
31 | OPluginConfigWidget::OPluginConfigWidget( QWidget* wid, const char *name, WFlags fl ) | ||
32 | : QWidget( wid, name, fl ), m_mode( Queued ) | ||
33 | { | ||
34 | } | ||
35 | |||
36 | /** | ||
37 | * C'tor where you can give a Opie::Core::OPluginManager and additional optional | ||
38 | * parameters. | ||
39 | * | ||
40 | * This call insert for the OPluginManager you pass to this method. You'll still | ||
41 | * need to call load after constructing this widget. | ||
42 | * | ||
43 | * Ownership will not be transfered | ||
44 | * | ||
45 | * The default mode is Queued | ||
46 | * | ||
47 | * @param manager The OPluginManager you pass | ||
48 | * @param wid The QWidget parent | ||
49 | * @param name the Name of the widget | ||
50 | * @param fl Possible Flags | ||
51 | * | ||
52 | */ | ||
53 | OPluginConfigWidget::OPluginConfigWidget( Opie::Core::OPluginManager* manager, | ||
54 | QWidget* wid, const char* name, WFlags fl ) | ||
55 | : QWidget( wid, name, fl ), m_mode( Queued ) | ||
56 | { | ||
57 | insert( QString::null, manager ); | ||
58 | } | ||
59 | |||
60 | |||
61 | /** | ||
62 | * C'tor where you can give a Opie::Core::OGenericPluginLoader and additional optional | ||
63 | * parameters. Internally we use a Opie::Core::OPluginManager on top of the loader. | ||
64 | * | ||
65 | * This call insert for the Opie::Core::OGenericPluginLoader you pass to this method. | ||
66 | * You'll still need to call load() after constructing this widget. | ||
67 | * | ||
68 | * It is still your OGenericPluginLoader and ownership is not transfered. | ||
69 | * | ||
70 | * The default mode is Queued | ||
71 | * | ||
72 | * @param manager The OGenericPluginLoader you pass | ||
73 | * @param wid The QWidget parent | ||
74 | * @param name the Name of the widget | ||
75 | * @param fl Possible Flags | ||
76 | * | ||
77 | */ | ||
78 | OPluginConfigWidget::OPluginConfigWidget( Opie::Core::OGenericPluginLoader* load, | ||
79 | QWidget* wid, const char* name, WFlags fl ) | ||
80 | : QWidget( wid, name, fl ), m_mode( Queued ) | ||
81 | { | ||
82 | insert( QString::null, load ); | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * d'tor. This does not save the changes if your in Queued mode | ||
87 | * make sure to call save() before destructing this widget. | ||
88 | */ | ||
89 | OPluginConfigWidget::~OPluginConfigWidget() { | ||
90 | // | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * Set the ChangeMode of this widget. Currently there are two possible values. | ||
95 | * Immediate - all changes by the user are immediately applied and signals are emitted | ||
96 | * the signals emitted are plugin* and also changed() due calling save internally | ||
97 | * Queued - changes need to be saved manually. save() emits changed() | ||
98 | * | ||
99 | * @param mode the ChangeMode to use. Either use Immediate or Queued | ||
100 | */ | ||
101 | void OPluginConfigWidget::setChangeMode( enum OPluginConfigWidget::ChangeMode mode ) { | ||
102 | m_mode = mode; | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * Return the Mode | ||
107 | * | ||
108 | * @return Returns the change mode this widget is in. | ||
109 | * @see OPluginConfigWidget::ChangeMode | ||
110 | * @see OPluginConfigWidget::setChangeMode | ||
111 | */ | ||
112 | OPluginConfigWidget::ChangeMode OPluginConfigWidget::mode()const{ | ||
113 | return m_mode; | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * Insert a PluginManager directly. Ownership is not transfered. | ||
118 | * | ||
119 | * @param name The name represented to the user | ||
120 | * @param mana The manager which should be inserted | ||
121 | */ | ||
122 | void OPluginConfigWidget::insert( const QString& name, const Opie::Core::OPluginManager* mana) { | ||
123 | |||
124 | } | ||
125 | |||
126 | /** | ||
127 | * | ||
128 | * @param name The name | ||
129 | * | ||
130 | */ | ||
131 | void OPluginConfigWidget::insert( const QString& name, const Opie::Core::OGenericPluginLoader* load) { | ||
132 | |||
133 | } | ||
134 | |||
135 | } | ||
136 | } | ||