1 /* This file is part of the KDE project
2 Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef KFILEPLACESITEM_P_H
21 #define KFILEPLACESITEM_P_H
24 #include <QtCore/QObject>
25 #include <QtCore/QModelIndex>
26 #include <kbookmark.h>
27 #include <solid/device.h>
31 class KFilePlacesItem
: public QObject
35 KFilePlacesItem(KBookmarkManager
*manager
,
36 const QString
&address
,
37 const QString
&udi
= QString());
42 bool isDevice() const;
43 KBookmark
bookmark() const;
44 void setBookmark(const KBookmark
&bookmark
);
45 Solid::Device
device() const;
46 QVariant
data(int role
) const;
48 static KBookmark
createBookmark(KBookmarkManager
*manager
,
51 const QString
&iconName
);
52 static KBookmark
createSystemBookmark(KBookmarkManager
*manager
,
55 const QString
&iconName
);
56 static KBookmark
createDeviceBookmark(KBookmarkManager
*manager
,
60 void itemChanged(const QString
&id
);
63 void onAccessibilityChanged();
64 void onListerCompleted();
67 QVariant
bookmarkData(int role
) const;
68 QVariant
deviceData(int role
) const;
70 bool hasFullIcon(const KBookmark
&bookmark
) const;
71 QString
iconNameForBookmark(const KBookmark
&bookmark
) const;
73 static QString
generateNewId();
75 KBookmarkManager
*m_manager
;