polish
[kdegraphics.git] / gwenview / lib / semanticinfo / sorteddirmodel.h
blob258dd5dd8bec8fdd3267c03c2b9bde8d8171b67c
1 /*
2 Gwenview: an image viewer
3 Copyright 2007 Aurélien Gâteau <aurelien.gateau@free.fr>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef SORTEDDIRMODEL_H
21 #define SORTEDDIRMODEL_H
23 // KDE
24 #include <kdirsortfilterproxymodel.h>
26 // Local
27 #include <lib/gwenviewlib_export.h>
30 class KDirLister;
31 class KFileItem;
32 class KUrl;
34 namespace Gwenview {
36 class AbstractSemanticInfoBackEnd;
37 class SortedDirModelPrivate;
38 class TagSet;
41 /**
42 * This model makes it possible to show all images in a folder.
43 * It can filter images based on name and metadata.
45 class GWENVIEWLIB_EXPORT SortedDirModel : public KDirSortFilterProxyModel {
46 Q_OBJECT
47 public:
48 SortedDirModel(QObject* parent);
49 ~SortedDirModel();
50 KDirLister* dirLister();
51 KFileItem itemForIndex(const QModelIndex& index) const;
52 QModelIndex indexForItem(const KFileItem& item) const;
53 QModelIndex indexForUrl(const KUrl& url) const;
55 /**
56 * A list of file extensions we should skip
58 void setBlackListedExtensions(const QStringList& list);
60 virtual void setMimeExcludeFilter(const QStringList &mimeList);
62 void setTagSetFilter(const TagSet& tagSet);
64 void reload();
66 AbstractSemanticInfoBackEnd* semanticInfoBackEnd() const;
68 public Q_SLOTS:
69 void setMinimumRating(int);
71 protected:
72 bool filterAcceptsRow(int row, const QModelIndex& parent) const;
74 private:
75 friend class SortedDirModelPrivate;
76 SortedDirModelPrivate * const d;
79 } // namespace
81 #endif /* SORTEDDIRMODEL_H */