summaryrefslogtreecommitdiff
path: root/libopie2/opieui/opluginconfigwidget.cpp
blob: 359e7a10b41c677f72448f28d8d7329dd90a9499 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
 * LGPLv2 2004 zecke@handhelds.org
 */


#include "opluginconfig.h"

#include <opie/opluginloader.h>

using Opie::Core::OPluginManager;
using Opie::Core::OGenericPluginLoader;

namespace Opie {
namespace Ui   {

}
}

/**
 * C'tor compatible with all Qt Widgets in its arguments.
 * After constructing you need to  insert and call load()
 *
 * The default mode is Queued
 *
 * @param wid the Widget
 * @param name The name of the widget
 * @param fl The widget flags you may want to set
 *
 * @see QWidget::QWidget
 */
OPluginConfigWidget::OPluginConfigWidget( QWidget* wid, const char *name, WFlags fl )
        : QWidget( wid, name, fl ), m_mode( Queued )
{
}

/**
 * C'tor where you can give a Opie::Core::OPluginManager and additional optional
 * parameters.
 *
 * This call insert for the OPluginManager you pass to this method. You'll still
 * need to call load after constructing this widget.
 *
 * Ownership will not be transfered
 *
 * The default mode is Queued
 *
 * @param manager The OPluginManager you pass
 * @param wid The QWidget parent
 * @param name the Name of the widget
 * @param fl Possible Flags
 *
 */
OPluginConfigWidget::OPluginConfigWidget( Opie::Core::OPluginManager* manager,
                                          QWidget* wid, const char* name, WFlags fl )
    : QWidget( wid, name, fl ), m_mode( Queued )
{
    insert( QString::null, manager );
}


/**
 * C'tor where you can give a Opie::Core::OGenericPluginLoader and additional optional
 * parameters. Internally we use a Opie::Core::OPluginManager on top of the loader.
 *
 * This call insert for the Opie::Core::OGenericPluginLoader you pass to this method.
 * You'll still need to call load() after constructing this widget.
 *
 * It is still your OGenericPluginLoader and ownership is not transfered.
 *
 * The default mode is Queued
 *
 * @param manager The OGenericPluginLoader you pass
 * @param wid The QWidget parent
 * @param name the Name of the widget
 * @param fl Possible Flags
 *
 */
OPluginConfigWidget::OPluginConfigWidget( Opie::Core::OGenericPluginLoader* load,
                                          QWidget* wid,  const char* name, WFlags fl )
    : QWidget( wid, name, fl ), m_mode( Queued )
{
    insert( QString::null, load );
}

/**
 * d'tor. This does not save the changes if your in Queued mode
 * make sure to call save() before destructing this widget.
 */
OPluginConfigWidget::~OPluginConfigWidget() {
//
}

/**
 * Set the ChangeMode of this widget. Currently there are two possible values.
 * Immediate - all changes by the user are immediately applied and signals are emitted
 *             the signals emitted are plugin* and also changed() due calling save internally
 * Queued    - changes need to be saved manually. save() emits changed()
 *
 * @param mode the ChangeMode to use. Either use Immediate or Queued
 */
void OPluginConfigWidget::setChangeMode( enum OPluginConfigWidget::ChangeMode mode ) {
    m_mode = mode;
}

/**
 * Return the Mode
 *
 * @return Returns the change mode this widget is in.
 * @see OPluginConfigWidget::ChangeMode
 * @see OPluginConfigWidget::setChangeMode
 */
OPluginConfigWidget::ChangeMode OPluginConfigWidget::mode()const{
    return m_mode;
}

/**
 * Insert a PluginManager directly. Ownership is not transfered.
 *
 * @param name  The name represented to the user
 * @param mana  The manager which should be inserted
 */
void OPluginConfigWidget::insert( const QString& name, const Opie::Core::OPluginManager* mana) {

}

/**
 *
 * @param name The name
 *
 */
void OPluginConfigWidget::insert( const QString& name, const Opie::Core::OGenericPluginLoader* load) {

}

}
}