digiKam
itemversionsmodel.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-07-13
7  * Description : Model for item versions
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_VERSIONS_MODEL_H
25 #define DIGIKAM_ITEM_VERSIONS_MODEL_H
26 
27 // Qt includes
28 
29 #include <QModelIndex>
30 #include <QPixmap>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
39 class DIGIKAM_DATABASE_EXPORT ItemVersionsModel : public QAbstractListModel
40 {
41  Q_OBJECT
42 
43 public:
44 
45  explicit ItemVersionsModel(QObject* const parent = nullptr);
46  ~ItemVersionsModel() override;
47 
48  Qt::ItemFlags flags(const QModelIndex& index) const override;
49  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
50  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
51 
52  void setupModelData(QList<QPair<QString, int> >& data);
53  void clearModelData();
54 
55  QString currentSelectedImage() const;
56  void setCurrentSelectedImage(const QString& path);
57  QModelIndex currentSelectedImageIndex() const;
58 
59  bool paintTree() const;
60  int listIndexOf(const QString& item) const;
61 
62 public Q_SLOTS:
63 
64  void slotAnimationStep();
65  void setPaintTree(bool paint);
66 
67 private:
68 
69  class Private;
70  Private* const d;
71 };
72 
73 } // namespace Digikam
74 
75 #endif // DIGIKAM_ITEM_VERSIONS_MODEL_H
Definition: itemversionsmodel.h:40
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43