Add (and install) svg for the new krunner interface.
[kdebase/uwolfer.git] / apps / kinfocenter / modules.h
blob5709ed49812157202d9113b644a81a4f506b69e8
1 /*
2 Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef MODULES_H
21 #define MODULES_H
23 #include <kcmoduleinfo.h>
24 #include <QObject>
25 #include <Qt3Support/Q3Dict>
26 //Added by qt3to4:
27 #include <QVBoxLayout>
28 #include <Q3PtrList>
29 #include <kvbox.h>
31 template<class ConfigModule> class Q3PtrList;
32 class QStringList;
33 class KAboutData;
34 class KCModule;
35 class ProxyWidget;
36 class K3Process;
37 class QX11EmbedWidget;
38 class QVBoxLayout;
39 class KVBox;
41 class ConfigModule : public QObject, public KCModuleInfo
43 Q_OBJECT
45 public:
47 ConfigModule(const KService::Ptr &s);
48 ~ConfigModule();
50 bool isChanged() { return _changed; }
51 void setChanged(bool changed) { _changed = changed; }
53 bool isActive() { return _module != 0; }
54 ProxyWidget *module();
55 const KAboutData *aboutData() const;
58 public Q_SLOTS:
60 void deleteClient();
63 private Q_SLOTS:
65 void clientClosed();
66 void clientChanged(bool state);
67 void runAsRoot();
68 void rootExited(K3Process *proc);
71 Q_SIGNALS:
73 void changed(ConfigModule *module);
74 void childClosed();
75 void helpRequest();
78 private:
80 bool _changed;
81 ProxyWidget *_module;
82 QX11EmbedWidget *_embedWidget;
83 K3Process *_rootProcess;
84 QVBoxLayout *_embedLayout;
85 KVBox *_embedFrame;
89 class ConfigModuleList : public Q3PtrList<ConfigModule>
91 public:
93 ConfigModuleList();
95 void readDesktopEntries();
96 bool readDesktopEntriesRecursive(const QString &path);
98 /**
99 * Returns all submenus of the submenu identified by path
101 Q3PtrList<ConfigModule> modules(const QString &path);
104 * Returns all modules of the submenu identified by path
106 QStringList submenus(const QString &path);
109 * Returns the path of the submenu the module is in
111 QString findModule(ConfigModule *module);
113 protected:
115 class Menu
117 public:
118 Q3PtrList<ConfigModule> modules;
119 QStringList submenus;
122 Q3Dict<Menu> subMenus;
125 #endif