1 /***************************************************************************
2 componentchooser.h - description
4 copyright : (C) 2002 by Joseph Wenninger
6 ***************************************************************************/
8 /***************************************************************************
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 *
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"
26 #include <QVBoxLayout>
30 class QListWidgetItem
;
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.
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
50 BrowserConfig_UI( QWidget
*parent
) : QWidget( parent
) {
55 class EmailClientConfig_UI
: public QWidget
, public Ui::EmailClientConfig_UI
58 EmailClientConfig_UI( QWidget
*parent
) : QWidget( parent
) {
63 class ComponentConfig_UI
: public QWidget
, public Ui::ComponentConfig_UI
66 ComponentConfig_UI( QWidget
*parent
) : QWidget( parent
) {
72 class ComponentChooser_UI
: public QWidget
, public Ui::ComponentChooser_UI
75 ComponentChooser_UI( QWidget
*parent
) : QWidget( parent
) {
82 class CfgComponent
: public ComponentConfig_UI
,public CfgPlugin
86 CfgComponent(QWidget
*parent
);
87 virtual ~CfgComponent();
88 virtual void load(KConfig
*cfg
);
89 virtual void save(KConfig
*cfg
);
90 virtual void defaults();
93 QHash
<QString
, QString
*> m_lookupDict
,m_revLookupDict
;
96 void slotComponentChanged(const QString
&);
102 class CfgEmailClient
: public EmailClientConfig_UI
,public CfgPlugin
106 CfgEmailClient(QWidget
*parent
);
107 virtual ~CfgEmailClient();
108 virtual void load(KConfig
*cfg
);
109 virtual void save(KConfig
*cfg
);
110 virtual void defaults();
113 KEMailSettings
*pSettings
;
116 void selectEmailClient();
117 void configChanged();
122 class CfgBrowser
: public BrowserConfig_UI
,public CfgPlugin
126 CfgBrowser(QWidget
*parent
);
127 virtual ~CfgBrowser();
128 virtual void load(KConfig
*cfg
);
129 virtual void save(KConfig
*cfg
);
130 virtual void defaults();
133 void selectBrowser();
134 void configChanged();
139 QString m_browserExec
;
140 KService::Ptr m_browserService
;
144 class ComponentChooser
: public ComponentChooser_UI
150 ComponentChooser(QWidget
*parent
=0);
151 virtual ~ComponentChooser();
154 void restoreDefault();
157 QString latestEditedService
;
158 bool somethingChanged
;
159 QWidget
*configWidget
;
160 QVBoxLayout
*myLayout
;
162 void emitChanged(bool);
163 void slotServiceSelected(QListWidgetItem
*);