File indexing completed on 2024-04-28 04:49:50

0001 /*
0002     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_DEVICE_COMBO_BOX_H_
0007 #define _K3B_DEVICE_COMBO_BOX_H_
0008 
0009 #include "k3b_export.h"
0010 #include <KComboBox>
0011 #include <QList>
0012 
0013 namespace K3b {
0014     namespace Device {
0015         class Device;
0016     }
0017 
0018 
0019     /**
0020      * A combobox to select a K3b device.
0021      *
0022      * It automatically removes devices that are removed from the system.
0023      */
0024     class LIBK3B_EXPORT DeviceComboBox : public KComboBox
0025     {
0026         Q_OBJECT
0027 
0028     public:
0029         explicit DeviceComboBox( QWidget* parent = 0 );
0030         ~DeviceComboBox() override;
0031 
0032         Device::Device* selectedDevice() const;
0033 
0034     Q_SIGNALS:
0035         void selectionChanged( K3b::Device::Device* );
0036 
0037     public Q_SLOTS:
0038         void addDevice( K3b::Device::Device* );
0039         void addDevices( const QList<K3b::Device::Device*>& );
0040         /**
0041          * Clears the device combo and tries to keep the current selection
0042          */
0043         void refreshDevices( const QList<K3b::Device::Device*>& );
0044         void removeDevice( K3b::Device::Device* );
0045         void setSelectedDevice( K3b::Device::Device* );
0046 
0047     private Q_SLOTS:
0048         void slotActivated( int );
0049 
0050     private:
0051         class Private;
0052         Private* d;
0053     };
0054 }
0055 
0056 #endif