/usr/include/kdevicelistmodel.h is in kdelibs5-dev 4:4.8.4-4+deb7u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | /* This file is part of the KDE project
Copyright (C) 2006 Michael Larouche <michael.larouche@kdemail.net>
2007 Kevin Ottens <ervin@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDEVICELISTMODEL_H
#define KDEVICELISTMODEL_H
#include <kio/kio_export.h>
#include <QtCore/QAbstractItemModel>
#include <solid/device.h>
#include <solid/predicate.h>
/**
* @brief Device list model in Qt's Interview framework.
*
* This class is a tree view model. Each device has a parent
* excluding the main device(the computer). Only revelant when
* used with QTreeView.
*
* @author Michaƫl Larouche <michael.larouche@kdemail.net>
*/
class KIO_EXPORT KDeviceListModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit KDeviceListModel(QObject *parent=0);
explicit KDeviceListModel(const QString &predicate, QObject *parent=0);
explicit KDeviceListModel(const Solid::Predicate &predicate,
QObject *parent=0);
~KDeviceListModel();
/**
* @brief Get a visible data based on Qt role for the given index.
* Return the device information for the give index.
*
* @param index The QModelIndex which contains the row, column to fetch the data.
* @param role The Interview data role(ex: Qt::DisplayRole).
*
* @return the data for the given index and role.
*/
QVariant data(const QModelIndex &index, int role) const;
/**
* @brief Get the header data for a given section, orientation and role.
* This method return a value to display in header in a view.
* Only support Qt::Horizontal direction and Qt::DisplayRole role.
*
* @param section Section of Header to get the data of.
* @param orientation Orientation of the header.
* @param role The Interview data role(ex: Qt::DisplayRole).
*
* @return the header data for the given section.
*/
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
/**
* @brief Get the children model index for the given row and column.
*/
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex rootIndex() const;
/**
* @brief Get the parent QModelIndex for the given model child.
*/
QModelIndex parent(const QModelIndex &child) const;
/**
* @brief Get the number of rows for a model index.
*/
int rowCount(const QModelIndex &parent = QModelIndex()) const;
/**
* @brief Get the number of columns for a model index.
*/
int columnCount(const QModelIndex &parent = QModelIndex()) const;
Solid::Device deviceForIndex( const QModelIndex& index ) const;
Q_SIGNALS:
void modelInitialized();
private:
Q_PRIVATE_SLOT(d, void _k_initDeviceList())
Q_PRIVATE_SLOT(d, void _k_deviceAdded(const QString &))
Q_PRIVATE_SLOT(d, void _k_deviceRemoved(const QString &))
class Private;
Private * const d;
};
#endif
|