• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KFile

kfileplacesmodel.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
00003     Copyright (C) 2007 David Faure <faure@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 version 2 as published by the Free Software Foundation.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 
00019 */
00020 #ifndef KFILEPLACESMODEL_H
00021 #define KFILEPLACESMODEL_H
00022 
00023 #include <kfile_export.h>
00024 
00025 #include <QtCore/QAbstractItemModel>
00026 #include <kurl.h>
00027 #include <kbookmark.h>
00028 #include <kicon.h>
00029 
00030 #include <solid/device.h>
00031 
00032 class QMimeData;
00033 class QAction;
00034 
00040 class KFILE_EXPORT KFilePlacesModel : public QAbstractItemModel
00041 {
00042     Q_OBJECT
00043 public:
00044     enum AdditionalRoles {
00045         UrlRole = 0x069CD12B,
00046         HiddenRole = 0x0741CAAC,
00047         SetupNeededRole = 0x059A935D
00048     };
00049 
00050     KFilePlacesModel(QObject *parent=0);
00051     ~KFilePlacesModel();
00052 
00053     KUrl url(const QModelIndex &index) const;
00054     bool setupNeeded(const QModelIndex &index) const;
00055     KIcon icon(const QModelIndex &index) const;
00056     QString text(const QModelIndex &index) const;
00057     bool isHidden(const QModelIndex &index) const;
00058     bool isDevice(const QModelIndex &index) const;
00059     Solid::Device deviceForIndex(const QModelIndex &index) const;
00060     KBookmark bookmarkForIndex(const QModelIndex &index) const;
00061 
00062     QAction *teardownActionForIndex(const QModelIndex &index) const;
00063     QAction *ejectActionForIndex(const QModelIndex &index) const;
00064     void requestTeardown(const QModelIndex &index);
00065     void requestEject(const QModelIndex &index);
00066     void requestSetup(const QModelIndex &index);
00067 
00068     void addPlace(const QString &text, const KUrl &url, const QString &iconName = QString(), const QString &appName = QString());
00069     void editPlace(const QModelIndex &index, const QString &text, const KUrl &url, const QString &iconName = QString(), const QString &appName = QString());
00070     void removePlace(const QModelIndex &index) const;
00071     void setPlaceHidden(const QModelIndex &index, bool hidden);
00072 
00073     int hiddenCount() const;
00074 
00084     QVariant data(const QModelIndex &index, int role) const;
00085 
00089     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
00090 
00094     QModelIndex parent(const QModelIndex &child) const;
00095 
00099     int rowCount(const QModelIndex &parent = QModelIndex()) const;
00100 
00104     int columnCount(const QModelIndex &parent = QModelIndex()) const;
00105 
00120     QModelIndex closestItem(const KUrl &url) const;
00121 
00122 
00123     Qt::DropActions supportedDropActions() const;
00124     Qt::ItemFlags flags(const QModelIndex &index) const;
00125     QStringList mimeTypes() const;
00126     QMimeData *mimeData(const QModelIndexList &indexes) const;
00127     bool dropMimeData(const QMimeData *data, Qt::DropAction action,
00128                       int row, int column, const QModelIndex &parent);
00129 
00130 Q_SIGNALS:
00131     void errorMessage(const QString &message);
00132     void setupDone(const QModelIndex &index, bool success);
00133 
00134 private:
00135     Q_PRIVATE_SLOT(d, void _k_initDeviceList())
00136     Q_PRIVATE_SLOT(d, void _k_deviceAdded(const QString&))
00137     Q_PRIVATE_SLOT(d, void _k_deviceRemoved(const QString&))
00138     Q_PRIVATE_SLOT(d, void _k_itemChanged(const QString&))
00139     Q_PRIVATE_SLOT(d, void _k_reloadBookmarks())
00140     Q_PRIVATE_SLOT(d, void _k_storageSetupDone(Solid::ErrorType, QVariant))
00141     Q_PRIVATE_SLOT(d, void _k_storageTeardownDone(Solid::ErrorType, QVariant))
00142 
00143     class Private;
00144     Private * const d;
00145     friend class Private;
00146 };
00147 
00148 #endif

KFile

Skip menu "KFile"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal