Add (and install) svg for the new krunner interface.
[kdebase/uwolfer.git] / runtime / kcontrol / componentchooser / componentchooser.h
blobf5ac3a8f30a716c2248c0402f2998e12ae61952d
1 /***************************************************************************
2 componentchooser.h - description
3 -------------------
4 copyright : (C) 2002 by Joseph Wenninger
5 email : jowenn@kde.org
6 ***************************************************************************/
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License version 2 as *
12 * published by the Free Software Foundationi *
13 * *
14 ***************************************************************************/
16 #ifndef _COMPONENTCHOOSER_H_
17 #define _COMPONENTCHOOSER_H_
19 #include "ui_componentchooser_ui.h"
20 #include "ui_componentconfig_ui.h"
21 #include "ui_emailclientconfig_ui.h"
22 #include "ui_browserconfig_ui.h"
23 #include <QHash>
25 //Added by qt3to4:
26 #include <QVBoxLayout>
28 #include <kservice.h>
30 class QListWidgetItem;
31 class KEMailSettings;
32 class KConfig;
34 /* The CfgPlugin class is an exception. It is LGPL. It will be parted of the plugin interface
35 which I plan for KDE 3.2.
37 class CfgPlugin
39 public:
40 CfgPlugin(){}
41 virtual ~CfgPlugin(){}
42 virtual void load(KConfig *cfg)=0;
43 virtual void save(KConfig *cfg)=0;
44 virtual void defaults()=0;
47 class BrowserConfig_UI : public QWidget, public Ui::BrowserConfig_UI
49 public:
50 BrowserConfig_UI( QWidget *parent ) : QWidget( parent ) {
51 setupUi( this );
55 class EmailClientConfig_UI : public QWidget, public Ui::EmailClientConfig_UI
57 public:
58 EmailClientConfig_UI( QWidget *parent ) : QWidget( parent ) {
59 setupUi( this );
63 class ComponentConfig_UI : public QWidget, public Ui::ComponentConfig_UI
65 public:
66 ComponentConfig_UI( QWidget *parent ) : QWidget( parent ) {
67 setupUi( this );
72 class ComponentChooser_UI : public QWidget, public Ui::ComponentChooser_UI
74 public:
75 ComponentChooser_UI( QWidget *parent ) : QWidget( parent ) {
76 setupUi( this );
82 class CfgComponent: public ComponentConfig_UI,public CfgPlugin
84 Q_OBJECT
85 public:
86 CfgComponent(QWidget *parent);
87 virtual ~CfgComponent();
88 virtual void load(KConfig *cfg);
89 virtual void save(KConfig *cfg);
90 virtual void defaults();
92 protected:
93 QHash<QString, QString*> m_lookupDict,m_revLookupDict;
95 protected Q_SLOTS:
96 void slotComponentChanged(const QString&);
97 Q_SIGNALS:
98 void changed(bool);
102 class CfgEmailClient: public EmailClientConfig_UI,public CfgPlugin
104 Q_OBJECT
105 public:
106 CfgEmailClient(QWidget *parent);
107 virtual ~CfgEmailClient();
108 virtual void load(KConfig *cfg);
109 virtual void save(KConfig *cfg);
110 virtual void defaults();
112 private:
113 KEMailSettings *pSettings;
115 protected Q_SLOTS:
116 void selectEmailClient();
117 void configChanged();
118 Q_SIGNALS:
119 void changed(bool);
122 class CfgBrowser: public BrowserConfig_UI,public CfgPlugin
124 Q_OBJECT
125 public:
126 CfgBrowser(QWidget *parent);
127 virtual ~CfgBrowser();
128 virtual void load(KConfig *cfg);
129 virtual void save(KConfig *cfg);
130 virtual void defaults();
132 protected Q_SLOTS:
133 void selectBrowser();
134 void configChanged();
136 Q_SIGNALS:
137 void changed(bool);
138 private:
139 QString m_browserExec;
140 KService::Ptr m_browserService;
144 class ComponentChooser : public ComponentChooser_UI
147 Q_OBJECT
149 public:
150 ComponentChooser(QWidget *parent=0);
151 virtual ~ComponentChooser();
152 void load();
153 void save();
154 void restoreDefault();
156 private:
157 QString latestEditedService;
158 bool somethingChanged;
159 QWidget *configWidget;
160 QVBoxLayout *myLayout;
161 protected Q_SLOTS:
162 void emitChanged(bool);
163 void slotServiceSelected(QListWidgetItem *);
165 Q_SIGNALS:
166 void changed(bool);
171 #endif