KFile
kfileplacesitem_p.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 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 */ 00019 00020 #ifndef KFILEPLACESITEM_P_H 00021 #define KFILEPLACESITEM_P_H 00022 00023 00024 #include <QtCore/QObject> 00025 #include <QtCore/QPointer> 00026 #include <QtCore/QModelIndex> 00027 #include <QtCore/QStringList> 00028 #include <kbookmark.h> 00029 #include <solid/device.h> 00030 00031 class KDirLister; 00032 namespace Solid 00033 { 00034 class StorageAccess; 00035 class StorageVolume; 00036 class OpticalDisc; 00037 class PortableMediaPlayer; 00038 } 00039 00040 class KFilePlacesItem : public QObject 00041 { 00042 Q_OBJECT 00043 public: 00044 KFilePlacesItem(KBookmarkManager *manager, 00045 const QString &address, 00046 const QString &udi = QString()); 00047 ~KFilePlacesItem(); 00048 00049 QString id() const; 00050 00051 bool isDevice() const; 00052 KBookmark bookmark() const; 00053 void setBookmark(const KBookmark &bookmark); 00054 Solid::Device device() const; 00055 QVariant data(int role) const; 00056 00057 static KBookmark createBookmark(KBookmarkManager *manager, 00058 const QString &label, 00059 const KUrl &url, 00060 const QString &iconName, 00061 KFilePlacesItem *after = 0); 00062 static KBookmark createSystemBookmark(KBookmarkManager *manager, 00063 const QString &untranslatedLabel, 00064 const QString &translatedLabel, 00065 const KUrl &url, 00066 const QString &iconName); 00067 static KBookmark createDeviceBookmark(KBookmarkManager *manager, 00068 const QString &udi); 00069 00070 Q_SIGNALS: 00071 void itemChanged(const QString &id); 00072 00073 private Q_SLOTS: 00074 void onAccessibilityChanged(bool); 00075 void onListerCompleted(); 00076 00077 private: 00078 QVariant bookmarkData(int role) const; 00079 QVariant deviceData(int role) const; 00080 00081 bool hasFullIcon(const KBookmark &bookmark) const; 00082 QString iconNameForBookmark(const KBookmark &bookmark) const; 00083 00084 static QString generateNewId(); 00085 00086 KBookmarkManager *m_manager; 00087 KBookmark m_bookmark; 00088 KDirLister *m_lister; 00089 bool m_folderIsEmpty; 00090 bool m_isCdrom; 00091 bool m_isAccessible; 00092 QString m_text; 00093 mutable Solid::Device m_device; 00094 mutable QPointer<Solid::StorageAccess> m_access; 00095 mutable QPointer<Solid::StorageVolume> m_volume; 00096 mutable QPointer<Solid::OpticalDisc> m_disc; 00097 mutable QPointer<Solid::PortableMediaPlayer> m_mtp; 00098 QString m_iconPath; 00099 QStringList m_emblems; 00100 }; 00101 00102 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:40:57 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:40:57 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.