2 // C++ Interface: mediadevicepluginmanager
7 // Author: Jeff Mitchell <kde-dev@emailgoeshere.com>, (C) 2005
9 // Copyright: See COPYING file that comes with this distribution
12 #ifndef MEDIUMPLUGINMANAGER_H
13 #define MEDIUMPLUGINMANAGER_H
16 #include "hintlineedit.h"
17 #include "plugin/pluginconfig.h"
23 #include <KPageDialog>
28 #include <Q3ValueList>
30 class QAbstractButton
;
35 class MediaDevicePluginManager
;
37 typedef QMap
<QString
, bool> DeletedMap
;
40 @author Jeff Mitchell <kde-dev@emailgoeshere.com>
41 @author Martin Aumueller <aumuell@reserv.at>
44 class MediaDeviceConfig
: public KHBox
49 MediaDeviceConfig( QString id
, MediaDevicePluginManager
*mgr
, const bool nographics
=false, QWidget
*parent
=0, const char *name
=0 );
51 QString
oldPlugin() { return m_oldPlugin
; }
52 void setOldPlugin( const QString
&oldPlugin
) { m_oldPlugin
= oldPlugin
; }
54 KComboBox
* pluginCombo() { return m_pluginCombo
; }
55 QAbstractButton
*configButton() { return m_configButton
; }
56 QAbstractButton
*removeButton() { return m_removeButton
; }
57 QString
uid() { return m_uid
; }
58 bool isNew() { return m_new
; }
61 void configureDevice();
66 void deleteDevice( const QString
& );
69 MediaDevicePluginManager
*m_manager
;
72 KComboBox
* m_pluginCombo
;
73 QAbstractButton
*m_configButton
;
74 QAbstractButton
*m_removeButton
;
78 class MediaDevicePluginManager
: public QObject
83 //nographics only for the initial run of detectDevices...pass in
84 //directly to detectDevices after
85 explicit MediaDevicePluginManager( QWidget
*widget
, const bool nographics
=false );
86 ~MediaDevicePluginManager();
90 void selectedPlugin( const QString
&, const QString
& );
93 void redetectDevices();
95 void deleteDevice( const QString
&uid
);
98 bool detectDevices( bool redetect
=false, bool nographics
=false );
99 DeletedMap m_deletedMap
;
100 QList
<MediaDeviceConfig
*> m_deviceList
;
105 class MediaDevicePluginManagerDialog
: public KPageDialog
110 MediaDevicePluginManagerDialog();
111 ~MediaDevicePluginManagerDialog();
119 Q3GroupBox
*m_location
;
120 MediaDevicePluginManager
*m_manager
;
123 class ManualDeviceAdder
: public KPageDialog
128 ManualDeviceAdder( MediaDevicePluginManager
* mdm
);
129 ~ManualDeviceAdder();
130 bool successful() const { return m_successful
; }
131 QString
getId( bool recreate
= false );
132 QString
getPlugin() const { return m_selectedPlugin
; }
135 void slotButtonClicked( KDialog::ButtonCode
);
136 void comboChanged( const QString
& );
139 MediaDevicePluginManager
* m_mpm
;
141 QString m_comboOldText
;
142 QString m_selectedPlugin
;
145 KComboBox
* m_mdaCombo
;
146 HintLineEdit
* m_mdaName
;
147 HintLineEdit
* m_mdaMountPoint
;