2
* Copyright (C) 2013 - 2015 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef FM_PLACESMODELITEM_H
22
#define FM_PLACESMODELITEM_H
24
#include "libfmqtglobals.h"
25
#include <QStandardItemModel>
26
#include <QStandardItem>
34
class LIBFM_QT_API PlacesModelItem : public QStandardItem {
37
Places = QStandardItem::UserType + 1,
45
PlacesModelItem(QIcon icon, QString title, FmPath* path = NULL);
46
PlacesModelItem(const char* iconName, QString title, FmPath* path = NULL);
47
PlacesModelItem(FmIcon* icon, QString title, FmPath* path = NULL);
50
FmFileInfo* fileInfo() {
53
void setFileInfo(FmFileInfo* fileInfo);
58
void setPath(FmPath* path);
63
void setIcon(FmIcon* icon);
64
void setIcon(GIcon* gicon);
67
QVariant data(int role = Qt::UserRole + 1) const;
69
virtual int type() const {
75
FmFileInfo* fileInfo_;
79
class LIBFM_QT_API PlacesModelVolumeItem : public PlacesModelItem {
81
PlacesModelVolumeItem(GVolume* volume);
84
return g_volume_can_eject(volume_);
86
virtual int type() const {
97
class LIBFM_QT_API PlacesModelMountItem : public PlacesModelItem {
99
PlacesModelMountItem(GMount* mount);
100
virtual int type() const {
103
GMount* mount() const {
111
class LIBFM_QT_API PlacesModelBookmarkItem : public PlacesModelItem {
113
virtual int type() const {
116
PlacesModelBookmarkItem(FmBookmarkItem* bm_item);
117
virtual ~PlacesModelBookmarkItem() {
119
fm_bookmark_item_unref(bookmarkItem_);
121
FmBookmarkItem* bookmark() const {
122
return bookmarkItem_;
125
FmBookmarkItem* bookmarkItem_;
130
#endif // FM_PLACESMODELITEM_H