1
// Copyright (c) 2000-2001 Charles Samuels <charles@kde.org>
2
// Copyright (c) 2000-2001 Neil Stevens <multivac@fcmail.com>
4
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// of this software and associated documentation files (the "Software"), to deal
6
// in the Software without restriction, including without limitation the rights
7
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
// copies of the Software, and to permit persons to whom the Software is
9
// furnished to do so, subject to the following conditions:
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIAB\ILITY, WHETHER IN
18
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
#ifndef PLUGINMODULE_H
22
#define PLUGINMODULE_H
24
#include <klistview.h>
26
#include <qstringlist.h>
28
#include "noatunpref.h"
29
#include "pluginloader.h"
33
class PluginListItem : public QCheckListItem
36
PluginListItem(const bool _exclusive, bool _checked, const NoatunLibraryInfo &_info, QListView *_parent);
37
const NoatunLibraryInfo &info() const { return mInfo; }
39
// This will toggle the state without "emitting" the stateChange
40
void setChecked(bool);
43
virtual void stateChange(bool);
44
virtual void paintCell(QPainter *, const QColorGroup &, int, int, int);
46
NoatunLibraryInfo mInfo;
47
bool silentStateChange;
51
class PluginListView : public KListView
55
friend class PluginListItem;
58
PluginListView(QWidget *_parent = 0, const char *_name = 0);
59
PluginListView(unsigned _min, QWidget *_parent = 0, const char *_name = 0);
60
PluginListView(unsigned _min, unsigned _max, QWidget *_parent = 0, const char *_name = 0);
65
void stateChange(PluginListItem *, bool);
68
void stateChanged(PluginListItem *, bool);
75
class Plugins : public CModule
79
Plugins(QObject *_parent = 0);
81
virtual void reopen();
84
void stateChange(PluginListItem *, bool);
87
void addPlugin(const NoatunLibraryInfo &);
88
void removePlugin(const NoatunLibraryInfo &);
89
PluginListItem *findItem(const NoatunLibraryInfo &) const;
91
QStringList mAdded, mDeleted;
92
PluginListView *interfaceList, *playlistList, *otherList;