digiKam
itemfiltershistorymodel.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2010-06-23
7  * Description : model for view with used filters on currently loaded image
8  *
9  * Copyright (C) 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_ITEM_FILTERS_HISTORY_MODEL_H
25 #define DIGIKAM_ITEM_FILTERS_HISTORY_MODEL_H
26 
27 // Qt includes
28 
29 #include <QAbstractListModel>
30 #include <QList>
31 #include <QUrl>
32 
33 // Local includes
34 
35 #include "dimagehistory.h"
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
41 class ItemFiltersHistoryTreeItem;
42 
43 class ItemFiltersHistoryModel : public QAbstractItemModel
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit ItemFiltersHistoryModel(QObject* const parent = nullptr, const QUrl& url = QUrl());
50  ~ItemFiltersHistoryModel() override;
51 
52  void setUrl(const QUrl& url);
53  bool removeRows(int row, int count, const QModelIndex& parent) override;
54  void setupModelData(const QList<DImageHistory::Entry>& entries,
56 
57  Qt::ItemFlags flags(const QModelIndex& index) const override;
58  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
59  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
60  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
61  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
62  QModelIndex parent(const QModelIndex& index) const override;
63  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
64 
65 public Q_SLOTS:
66 
67  void removeEntry(const QModelIndex& index);
68  void setEnabledEntries(int count);
69  void disableEntries(int count);
70  void enableEntries(int count);
71 
72 private:
73 
74  class Private;
75  Private* const d;
76 };
77 
78 } // namespace Digikam
79 
80 #endif // DIGIKAM_ITEM_FILTERS_HISTORY_MODEL_H
Definition: itemfiltershistorymodel.h:44
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition: itemfiltershistorymodel.cpp:130
QModelIndex parent(const QModelIndex &index) const override
Definition: itemfiltershistorymodel.cpp:212
ItemFiltersHistoryModel(QObject *const parent=nullptr, const QUrl &url=QUrl())
Definition: itemfiltershistorymodel.cpp:61
~ItemFiltersHistoryModel() override
Definition: itemfiltershistorymodel.cpp:85
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition: itemfiltershistorymodel.cpp:182
void setUrl(const QUrl &url)
Definition: itemfiltershistorymodel.cpp:91
void setupModelData(const QList< DImageHistory::Entry > &entries, ItemFiltersHistoryTreeItem *parent=nullptr)
Definition: itemfiltershistorymodel.cpp:251
void enableEntries(int count)
Definition: itemfiltershistorymodel.cpp:371
void setEnabledEntries(int count)
Definition: itemfiltershistorymodel.cpp:341
bool removeRows(int row, int count, const QModelIndex &parent) override
Definition: itemfiltershistorymodel.cpp:324
void disableEntries(int count)
Definition: itemfiltershistorymodel.cpp:353
void removeEntry(const QModelIndex &index)
Definition: itemfiltershistorymodel.cpp:319
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: itemfiltershistorymodel.cpp:155
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: itemfiltershistorymodel.cpp:230
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition: itemfiltershistorymodel.cpp:172
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition: itemfiltershistorymodel.cpp:115
Definition: itemfiltershistorytreeitem.h:40
Definition: piwigotalker.h:48
@ Orientation
Definition: coredbfields.h:86
Definition: datefolderview.cpp:43