25 #ifndef DIGIKAM_ITEM_MODEL_H
26 #define DIGIKAM_ITEM_MODEL_H
30 #include <QAbstractListModel>
44 class ImageTagChangeset;
46 namespace DatabaseFields
51 class DIGIKAM_DATABASE_EXPORT
ItemModel :
public QAbstractListModel,
63 ItemModelPointerRole = Qt::UserRole,
64 ItemModelInternalId = Qt::UserRole + 1,
70 ThumbnailRole = Qt::UserRole + 2,
75 CreationDateRole = Qt::UserRole + 3,
80 ExtraDataRole = Qt::UserRole + 5,
85 ExtraDataDuplicateCount = Qt::UserRole + 6,
91 LTLeftPanelRole = Qt::UserRole + 50,
96 LTRightPanelRole = Qt::UserRole + 51,
101 SubclassRoles = Qt::UserRole + 100,
106 FilterModelRoles = Qt::UserRole + 500
111 explicit ItemModel(QObject*
const parent =
nullptr);
118 void setKeepsFilePathCache(
bool keepCache);
119 bool keepsFilePathCache()
const;
134 ItemInfo imageInfo(
const QModelIndex& index)
const;
135 ItemInfo& imageInfoRef(
const QModelIndex& index)
const;
136 qlonglong imageId(
const QModelIndex& index)
const;
146 ItemInfo& imageInfoRef(
int row)
const;
147 qlonglong imageId(
int row)
const;
152 QModelIndex indexForItemInfo(
const ItemInfo& info)
const;
153 QModelIndex indexForItemInfo(
const ItemInfo& info,
const QVariant& extraValue)
const;
154 QModelIndex indexForImageId(qlonglong
id)
const;
155 QModelIndex indexForImageId(qlonglong
id,
const QVariant& extraValue)
const;
159 int numberOfIndexesForItemInfo(
const ItemInfo& info)
const;
160 int numberOfIndexesForImageId(qlonglong
id)
const;
169 QModelIndex indexForPath(
const QString& filePath)
const;
170 ItemInfo imageInfo(
const QString& filePath)
const;
180 void addItemInfo(
const ItemInfo& info);
187 void clearItemInfos();
197 void removeIndex(
const QModelIndex& indexes);
199 void removeItemInfo(
const ItemInfo& info);
210 void addItemInfoSynchronously(
const ItemInfo& info);
219 void ensureHasItemInfo(
const ItemInfo& info);
226 void ensureHasGroupedImages(
const ItemInfo& groupLeader);
232 bool hasImage(qlonglong
id)
const;
233 bool hasImage(
const ItemInfo& info)
const;
234 bool hasImage(
const ItemInfo& info,
const QVariant& extraValue)
const;
235 bool hasImage(qlonglong
id,
const QVariant& extraValue)
const;
237 bool isEmpty()
const;
238 int itemCount()
const;
255 void setPreprocessor(QObject*
const processor);
256 void unsetPreprocessor(QObject*
const processor);
263 bool isRefreshing()
const;
269 void setSendRemovalSignals(
bool send);
271 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
272 QVariant headerData(
int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
273 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
274 Qt::ItemFlags flags(
const QModelIndex& index)
const override;
275 QModelIndex index(
int row,
int column = 0,
const QModelIndex& parent = QModelIndex())
const override;
281 static ItemInfo retrieveItemInfo(
const QModelIndex& index);
282 static qlonglong retrieveImageId(
const QModelIndex& index);
348 void reAddingFinished();
359 void finishRefresh();
366 void requestIncrementalRefresh();
367 bool hasIncrementalRefreshPending()
const;
374 void startIncrementalRefresh();
375 void finishIncrementalRefresh();
377 void emitDataChangedForAll();
378 void emitDataChangedForSelection(
const QItemSelection& selection);
400 void cleanSituationChecks();
401 void removeRowPairsWithCheck(
const QList<QPair<int, int> >& toRemove);
402 void removeRowPairs(
const QList<QPair<int, int> >& toRemove);
Definition: coredbfields.h:389
Definition: dragdropimplementations.h:40
Definition: coredbchangesets.h:48
Definition: coredbchangesets.h:80
Definition: iteminfo.h:78
Definition: itemmodel.h:53
ItemModelRoles
Definition: itemmodel.h:59
virtual void imageInfosAboutToBeRemoved(int, int)
Definition: itemmodel.h:388
virtual void imageInfosCleared()
Definition: itemmodel.h:383
void imageInfosAdded(const QList< ItemInfo > &infos)
void imageInfosRemoved(const QList< ItemInfo > &infos)
void readyForIncrementalRefresh()
void imageInfosAboutToBeRemoved(const QList< ItemInfo > &infos)
void preprocess(const QList< ItemInfo > &infos, const QList< QVariant > &)
void allRefreshingFinished()
void imageChange(const ImageChangeset &, const QItemSelection &)
void imageInfosAboutToBeAdded(const QList< ItemInfo > &infos)
void imageTagChange(const ImageTagChangeset &, const QItemSelection &)
void processAdded(const QList< ItemInfo > &infos, const QList< QVariant > &)
#define DECLARE_MODEL_DRAG_DROP_METHODS
Definition: dragdropimplementations.h:90
@ Orientation
Definition: coredbfields.h:86
Definition: datefolderview.cpp:43