File indexing completed on 2024-10-06 04:26:01
0001 /* 0002 SPDX-FileCopyrightText: 2005-2009 Sebastian Trueg <trueg@k3b.org> 0003 SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef _K3B_MEDIA_SELECTION_DIALOG_H_ 0009 #define _K3B_MEDIA_SELECTION_DIALOG_H_ 0010 0011 #include "k3bmedium.h" 0012 #include <QDialog> 0013 0014 class QPushButton; 0015 0016 namespace K3b { 0017 class MediaSelectionComboBox; 0018 0019 namespace Device { 0020 class Device; 0021 } 0022 0023 class MediaSelectionDialog : public QDialog 0024 { 0025 Q_OBJECT 0026 0027 public: 0028 /** 0029 * Do not use the constructor. Use the static method instead. 0030 */ 0031 explicit MediaSelectionDialog( QWidget* parent = 0, 0032 const QString& title = QString(), 0033 const QString& text = QString(), 0034 bool modal = false ); 0035 ~MediaSelectionDialog() override; 0036 0037 /** 0038 * \see MediaSelectionComboBox::setWantedMediumType() 0039 */ 0040 void setWantedMediumType( Device::MediaTypes type ); 0041 0042 /** 0043 * \see MediaSelectionComboBox::setWantedMediumState() 0044 */ 0045 void setWantedMediumState( Device::MediaStates state ); 0046 0047 /** 0048 * \see MediaSelectionComboBox::setWantedMediumContent() 0049 */ 0050 void setWantedMediumContent( Medium::MediumContents state ); 0051 0052 /** 0053 * Although the dialog is used to select a medium the result is the 0054 * device containing that medium. 0055 */ 0056 Device::Device* selectedDevice() const; 0057 0058 static Device::Device* selectMedium( Device::MediaTypes type, 0059 Device::MediaStates state, 0060 Medium::MediumContents content = Medium::ContentAll, 0061 QWidget* parent = 0, 0062 const QString& title = QString(), 0063 const QString& text = QString(), 0064 bool* canceled = 0 ); 0065 0066 private Q_SLOTS: 0067 void slotSelectionChanged( K3b::Device::Device* ); 0068 0069 private: 0070 MediaSelectionComboBox* m_combo; 0071 QPushButton* m_okButton; 0072 }; 0073 } 0074 0075 #endif