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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
/* ksim - a system monitor for kde
*
* Copyright (C) 2001 Robbie Ward <linuxphreak@gmx.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef PLUGINGLOBAL_H
#define PLUGINGLOBAL_H
#include <tqstring.h>
#include <tqpixmap.h>
#include <tqvaluelist.h>
#include <kdemacros.h>
class KDesktopFile;
namespace KSim
{
class PluginObject;
class PluginView;
class PluginPage;
/**
* A class that holds various information about a plugin
* @author Robbie Ward <linuxphreak@gmx.co.uk>
*/
class KDE_EXPORT Plugin
{
public:
/**
* Constructs a null Plugin
*/
Plugin();
/**
* Constructs a Plugin
*/
Plugin(KSim::PluginObject *plugin, const KDesktopFile &file);
/**
* Copy constructor
*/
Plugin(const Plugin &rhs);
/**
* Destructor for Plugin
*/
~Plugin();
/**
* Assigns rhs to this Plugin and returns a reference to this Plugin.
*/
Plugin &operator=(const Plugin &rhs);
/**
* @return true if the plugin is equal to rhs; otherwise returns false
* @see #operator!=
*/
bool operator==(const Plugin &rhs) const;
/**
* @return true if the plugin is different to rhs; otherwise returns false
* @see #operator==
*/
bool operator!=(const Plugin &rhs) const;
/**
* sets if the plugin is enabled or not
*/
void setEnabled(bool enabled);
/**
* returns true if this plugin is enabled, else it returns false
*/
bool isEnabled() const;
/**
* returns true if the last enabled state is different to the current
* enabled state, else it returns false
*/
bool isDifferent() const;
/**
* @return true if the Plugin object is empty
*/
bool isNull() const;
/**
* @return the name of the plugin, NOT the library name
* @see #libName
*/
const TQString &name() const;
/**
* @return the icon of the plugin
*/
TQPixmap icon() const;
/**
* @return library name of the plugin
*/
TQCString libName() const;
/**
* @return path to the .desktop file
*/
const TQString &fileName() const;
/**
* @return the plugin object
*/
KSim::PluginObject *plugin() const;
/**
* @return the view object of the plugin
*/
KSim::PluginView *view() const;
/**
* @return the config object of the plugin
*/
KSim::PluginPage *configPage() const;
/**
* a null plugin, provided for convenience.
* currently only used in KSim::PluginLoader
*/
static KSim::Plugin null;
private:
void init(KSim::PluginObject *plugin, const KDesktopFile &file);
class Private;
Private *d;
};
/**
* Please do not use this class directly,
* use pluginList() from KSim::PluginLoader instead
* @author Robbie Ward <linuxphreak@gmx.co.uk>
*/
class KDE_EXPORT PluginList : public TQValueList<Plugin>
{
public:
/**
* constructs a null list
*/
PluginList() : TQValueList<Plugin>() {}
/**
* constructs a copy of @p list
*/
PluginList(const PluginList &list) : TQValueList<Plugin>(list) {}
/**
* constructs a copy of @p list
*/
PluginList(const TQValueList<Plugin> &list)
: TQValueList<Plugin>(list) {}
/**
* constructs a list with just one item
*/
PluginList(const Plugin &plugin) { append(plugin); }
~PluginList() {}
};
}
#endif
|