KIO
kdevicelistmodel.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KDEVICELISTMODEL_H
00021 #define KDEVICELISTMODEL_H
00022
00023 #include <kio/kio_export.h>
00024
00025 #include <QtCore/QAbstractItemModel>
00026
00027 #include <solid/device.h>
00028 #include <solid/predicate.h>
00029
00039 class KIO_EXPORT KDeviceListModel : public QAbstractItemModel
00040 {
00041 Q_OBJECT
00042 public:
00043 explicit KDeviceListModel(QObject *parent=0);
00044 explicit KDeviceListModel(const QString &predicate, QObject *parent=0);
00045 explicit KDeviceListModel(const Solid::Predicate &predicate,
00046 QObject *parent=0);
00047 ~KDeviceListModel();
00048
00058 QVariant data(const QModelIndex &index, int role) const;
00059
00071 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00072
00076 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
00077
00078 QModelIndex rootIndex() const;
00079
00083 QModelIndex parent(const QModelIndex &child) const;
00084
00088 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00089
00093 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00094
00095 Solid::Device deviceForIndex( const QModelIndex& index ) const;
00096
00097
00098 Q_SIGNALS:
00099 void modelInitialized();
00100
00101 private:
00102 Q_PRIVATE_SLOT(d, void _k_initDeviceList())
00103 Q_PRIVATE_SLOT(d, void _k_deviceAdded(const QString &))
00104 Q_PRIVATE_SLOT(d, void _k_deviceRemoved(const QString &))
00105
00106 class Private;
00107 Private * const d;
00108 };
00109
00110 #endif