KIO
kopenwithdialog_p.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 David Faure <faure@kde.org> 00003 Copyright (C) 2007 Pino Toscano <pino@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef OPENWITHDIALOG_P_H 00022 #define OPENWITHDIALOG_P_H 00023 00024 #include <QtCore/QAbstractItemModel> 00025 #include <QtGui/QTreeView> 00026 00027 class KApplicationModelPrivate; 00028 00032 class KApplicationModel : public QAbstractItemModel 00033 { 00034 Q_OBJECT 00035 00036 public: 00037 KApplicationModel(QObject *parent = 0); 00038 virtual ~KApplicationModel(); 00039 virtual bool canFetchMore(const QModelIndex &parent) const; 00040 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 00041 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 00042 virtual void fetchMore(const QModelIndex &parent); 00043 // virtual Qt::ItemFlags flags(const QModelIndex &index) const; 00044 virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const; 00045 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 00046 virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; 00047 virtual QModelIndex parent(const QModelIndex &index) const; 00048 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 00049 00050 QString entryPathFor(const QModelIndex &index) const; 00051 QString execFor(const QModelIndex &index) const; 00052 bool isDirectory(const QModelIndex &index) const; 00053 00054 private: 00055 friend class KApplicationModelPrivate; 00056 KApplicationModelPrivate *const d; 00057 00058 Q_DISABLE_COPY(KApplicationModel) 00059 }; 00060 00061 class KApplicationViewPrivate; 00062 00066 class KApplicationView : public QTreeView 00067 { 00068 Q_OBJECT 00069 00070 public: 00071 KApplicationView(QWidget *parent = 0); 00072 ~KApplicationView(); 00073 00074 virtual void setModel(QAbstractItemModel *model); 00075 00076 bool isDirSel() const; 00077 00078 Q_SIGNALS: 00079 void selected(const QString &_name, const QString &_exec); 00080 void highlighted(const QString &_name, const QString &_exec); 00081 00082 protected Q_SLOTS: 00083 virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); 00084 00085 private Q_SLOTS: 00086 void slotSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); 00087 00088 private: 00089 friend class KApplicationViewPrivate; 00090 KApplicationViewPrivate *const d; 00091 00092 Q_DISABLE_COPY(KApplicationView) 00093 }; 00094 00095 #endif
KDE 4.6 API Reference