summaryrefslogtreecommitdiff
path: root/libopie2/opieui/opluginconfig.h
blob: bfee5bf1d5e4f0b5ca6aa8213b08c13e4e1273a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * LGPLv2 zecke@handhelds.org
 */
#ifndef ODP_OPIE_UI_OPLUGIN_CONFIG_H
#define ODP_OPIE_UI_OPLUGIN_CONFIG_H

#include <qwidget.h>

namespace Opie {
namespace Core {
    class OPluginManager;
    class OGenericPluginLoader;
}
namespace Ui {
/**
 * With this widget you can configure one or many PluginLoaders either
 * through an already existing Opie::Core::OPluginManager or Opie::Core::OGenericPluginLoader
 * The sorted state will be read from the Loader.
 *
 * As with Opie::Ui::OKeyConfigWidget you can have two options. To either apply your changes
 * directly through Opie::Core::OPluginManager or to use Queued where you manually need to
 * call save.
 *
 * Internally we operate on Opie::Core::OPluginManager.
 *
 * @see Opie::Ui::OKeyConfigWidget
 * @see Opie::Core::OPluginLoader
 * @see Opie::Core::OPluginManager
 *
 * @author zecke
 * @since Opie 1.1.5
 *
 */
class OPluginConfigWidget :  public QWidget {
public:
    enum ChangeMode { Queued, Immediate };
    OPluginConfigWidget( QWidget* wid = 0, const char* name = 0, WFlags fl = 0);
    OPluginConfig( Opie::Core::OPluginManager* manager, QWidget* wid = 0,
                   const char* name = 0, WFlags fl = 0);
    OPluginConfig( Opie::Core::OGenericPluginLoader* loader, QWidget* wid, const char* name,
                   WFlags fl );

    ~OPluginConfig();

    void setChangeMode( enum Mode );
    ChangeMode mode()const;

    void insert(  const QString&, const Opie::Core::OPluginManager* );
    void insert(  const QString&, const Opie::Core::OPluginLoader*  );

signals:
    /**
     * @param item The new OPluginItem
     */
    void pluginChanged ( const Opie::Core::OPluginItem& item, bool old_state);
    void pluginEnabled ( const Opie::Core::OPluginItem& item);
    void pluginDisabled( const Opie::Core::OPluginItem& item);
public:

    void load();
    void save();
private:

};
}
}

#endif