digiKam
|
Public Types | |
enum | AlbumDataRole { AlbumTitleRole = Qt::UserRole , AlbumTypeRole = Qt::UserRole + 1 , AlbumPointerRole = Qt::UserRole + 2 , AlbumIdRole = Qt::UserRole + 3 , AlbumGlobalIdRole = Qt::UserRole + 4 , AlbumSortRole = Qt::UserRole + 5 } |
enum | RootAlbumBehavior { IncludeRootAlbum , IgnoreRootAlbum } |
Signals | |
void | rootAlbumAvailable () |
Public Member Functions | |
AbstractAlbumModel (Album::Type albumType, Album *const rootAlbum, RootAlbumBehavior rootBehavior=IncludeRootAlbum, QObject *const parent=nullptr) | |
Album * | albumForIndex (const QModelIndex &index) const |
Album::Type | albumType () const |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
AlbumModelDragDropHandler * | dragDropHandler () const |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
bool | hasChildren (const QModelIndex &parent=QModelIndex()) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | indexForAlbum (Album *album) const |
bool | isFaceTagModel () const |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
QStringList | mimeTypes () const override |
QModelIndex | parent (const QModelIndex &index) const override |
Album * | rootAlbum () const |
RootAlbumBehavior | rootAlbumBehavior () const |
QModelIndex | rootAlbumIndex () const |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
void | setDragDropHandler (AlbumModelDragDropHandler *handler) |
Qt::DropActions | supportedDropActions () const override |
~AbstractAlbumModel () override | |
Static Public Member Functions | |
static Album * | retrieveAlbum (const QModelIndex &index) |
Protected Slots | |
void | slotAlbumAboutToBeAdded (Album *album, Album *parent, Album *prev) |
void | slotAlbumAboutToBeDeleted (Album *album) |
void | slotAlbumAdded (Album *) |
void | slotAlbumHasBeenDeleted (quintptr) |
void | slotAlbumIconChanged (Album *album) |
void | slotAlbumRenamed (Album *album) |
void | slotAlbumsCleared () |
Protected Member Functions | |
virtual void | albumCleared (Album *) |
Notification when an entry is removed. More... | |
virtual QVariant | albumData (Album *a, int role) const |
For subclassing convenience: A part of the implementation of data() More... | |
virtual void | allAlbumsCleared () |
Notification when all entries are removed. More... | |
virtual QString | columnHeader () const |
For subclassing convenience: A part of the implementation of headerData() More... | |
virtual QVariant | decorationRoleData (Album *a) const |
For subclassing convenience: A part of the implementation of data() More... | |
virtual bool | filterAlbum (Album *album) const |
virtual QVariant | fontRoleData (Album *a) const |
For subclassing convenience: A part of the implementation of data() More... | |
virtual Qt::ItemFlags | itemFlags (Album *album) const |
For subclassing convenience: A part of the implementation of itemFlags() More... | |
void | setEnableDrag (bool enable) |
void | setEnableDrop (bool enable) |
void | setFaceTagModel (bool enable) |
virtual QVariant | sortRoleData (Album *a) const |
For subclassing convenience: A part of the implementation of data() More... | |
Enumerator | |
---|---|
AlbumTitleRole | Returns the album title. Principally the same as display role, but without any additions. |
AlbumTypeRole | Returns the Album::Type of the associated album. |
AlbumPointerRole | Returns a pointer to the associated Album object. |
AlbumIdRole | Returns the id of the associated Album object. |
AlbumGlobalIdRole | Returns the global id (unique across all album types) |
AlbumSortRole | Returns the data to sort on. |
AbstractAlbumModel is the abstract base class for all models that present Album objects as managed by AlbumManager. You will want to create an instance of the base classes.
|
explicit |
Create an AbstractAlbumModel object for albums with the given type. Pass the root album if it is already available. Do not use this class directly, but one of the subclasses.
References albumType(), Digikam::AlbumManager::instance(), rootAlbum(), Digikam::AlbumManager::signalAlbumAboutToBeAdded(), Digikam::AlbumManager::signalAlbumAboutToBeDeleted(), Digikam::AlbumManager::signalAlbumAdded(), Digikam::AlbumManager::signalAlbumHasBeenDeleted(), Digikam::AlbumManager::signalAlbumIconChanged(), Digikam::AlbumManager::signalAlbumRenamed(), Digikam::AlbumManager::signalAlbumsCleared(), slotAlbumAboutToBeAdded(), slotAlbumAboutToBeDeleted(), slotAlbumAdded(), slotAlbumHasBeenDeleted(), slotAlbumIconChanged(), slotAlbumRenamed(), and slotAlbumsCleared().
|
override |
|
inlineprotectedvirtual |
Notification when an entry is removed.
Reimplemented in Digikam::AbstractCheckableAlbumModel, and Digikam::AbstractCountingAlbumModel.
Referenced by slotAlbumAboutToBeDeleted().
|
protectedvirtual |
For subclassing convenience: A part of the implementation of data()
NOTE: these can be reimplemented in a subclass
Reimplemented in Digikam::SearchModel, Digikam::TagModel, Digikam::AlbumModel, Digikam::AbstractCheckableAlbumModel, and Digikam::AbstractCountingAlbumModel.
References AlbumGlobalIdRole, AlbumIdRole, AlbumPointerRole, AlbumSortRole, AlbumTitleRole, AlbumTypeRole, decorationRoleData(), fontRoleData(), Digikam::Album::globalID(), Digikam::Album::id(), sortRoleData(), Digikam::Album::title(), and Digikam::Album::type().
Referenced by Digikam::AbstractCountingAlbumModel::albumData(), and data().
Album * Digikam::AbstractAlbumModel::albumForIndex | ( | const QModelIndex & | index | ) | const |
Returns the album object associated with the given model index
References index().
Referenced by Digikam::AlbumModel::albumForIndex(), Digikam::TagModel::albumForIndex(), Digikam::SearchModel::albumForIndex(), Digikam::DateAlbumModel::albumForIndex(), Digikam::AbstractCountingAlbumModel::excludeChildrenCount(), Digikam::AbstractCountingAlbumModel::includeChildrenCount(), Digikam::AbstractCheckableAlbumModel::invertCheckedAlbums(), mimeData(), Digikam::AbstractAlbumTreeView::rowsAboutToBeRemoved(), and Digikam::AbstractCheckableAlbumModel::setData().
Album::Type Digikam::AbstractAlbumModel::albumType | ( | ) | const |
Returns the Album::Type of the contained albums
Referenced by AbstractAlbumModel().
|
inlineprotectedvirtual |
Notification when all entries are removed.
Reimplemented in Digikam::AbstractCheckableAlbumModel, and Digikam::AbstractCountingAlbumModel.
Referenced by slotAlbumsCleared().
|
override |
|
protectedvirtual |
For subclassing convenience: A part of the implementation of headerData()
Reimplemented in Digikam::AbstractSpecificAlbumModel.
Referenced by headerData().
|
override |
References albumData(), and index().
|
protectedvirtual |
For subclassing convenience: A part of the implementation of data()
Reimplemented in Digikam::DateAlbumModel, Digikam::TagModel, and Digikam::AlbumModel.
Referenced by albumData().
AlbumModelDragDropHandler * Digikam::AbstractAlbumModel::dragDropHandler | ( | ) | const |
Returns the drag drop handler, or 0 if none is installed
Referenced by Digikam::AbstractAlbumTreeView::dragEnterEvent(), Digikam::AbstractAlbumTreeView::dragMoveEvent(), Digikam::AbstractAlbumTreeView::dropEvent(), Digikam::AlbumTreeView::setAlbumModel(), and Digikam::TagTreeView::setAlbumModel().
|
override |
|
protectedvirtual |
Returns true for those and only those albums that shall be contained in this model. They must have a common root album, which is set in the constructor.
References Digikam::Album::type().
Referenced by Digikam::AbstractSpecificAlbumModel::emitDataChangedForChildren(), indexForAlbum(), slotAlbumAboutToBeAdded(), slotAlbumAboutToBeDeleted(), slotAlbumIconChanged(), slotAlbumRenamed(), and Digikam::AbstractSpecificAlbumModel::slotGotThumbnailFromIcon().
|
override |
References index(), and itemFlags().
Referenced by Digikam::AbstractCheckableAlbumModel::flags().
|
protectedvirtual |
For subclassing convenience: A part of the implementation of data()
Reimplemented in Digikam::TagModel.
Referenced by albumData().
|
override |
References Digikam::Album::firstChild(), IncludeRootAlbum, and parent().
|
override |
References columnHeader().
|
override |
References Digikam::Album::childAtRow(), IncludeRootAlbum, and parent().
Referenced by Digikam::TagModel::activateFaceTagModel(), albumForIndex(), Digikam::AlbumModel::albumForIndex(), Digikam::TagModel::albumForIndex(), Digikam::SearchModel::albumForIndex(), Digikam::DateAlbumModel::albumForIndex(), data(), Digikam::AbstractSpecificAlbumModel::emitDataChangedForChildren(), Digikam::AbstractCountingAlbumModel::excludeChildrenCount(), flags(), Digikam::AbstractCheckableAlbumModel::flags(), Digikam::AbstractCountingAlbumModel::includeChildrenCount(), Digikam::AbstractCheckableAlbumModel::invertCheckedAlbums(), mimeData(), Digikam::DateAlbumModel::monthIndexForDate(), parent(), Digikam::AbstractCheckableAlbumModel::resetAllCheckedAlbums(), retrieveAlbum(), Digikam::AbstractCheckableAlbumTreeView::rowsInserted(), Digikam::AbstractCheckableAlbumModel::setCheckStateForChildren(), Digikam::AbstractCheckableAlbumModel::setCheckStateForParents(), Digikam::AbstractCountingAlbumModel::setCount(), Digikam::AbstractCheckableAlbumModel::setData(), Digikam::TagModel::setData(), slotAlbumIconChanged(), slotAlbumRenamed(), and Digikam::AbstractSpecificAlbumModel::slotGotThumbnailFromIcon().
QModelIndex Digikam::AbstractAlbumModel::indexForAlbum | ( | Album * | album | ) | const |
Return the QModelIndex for the given album, or an invalid index if the album is not contained in this model.
References filterAlbum(), IncludeRootAlbum, and Digikam::Album::rowFromAlbum().
Referenced by Digikam::TagModel::activateFaceTagModel(), Digikam::AbstractSpecificAlbumModel::emitDataChangedForChildren(), Digikam::AlbumFilterModel::indexForAlbum(), Digikam::ContextMenuHelper::Private::indexForAlbumFromAction(), Digikam::AlbumFilterModel::matches(), parent(), Digikam::AbstractCheckableAlbumModel::resetAllCheckedAlbums(), rootAlbumIndex(), Digikam::AbstractCheckableAlbumModel::setChecked(), Digikam::AbstractCheckableAlbumModel::setCheckState(), Digikam::AbstractCheckableAlbumModel::setCheckStateForChildren(), Digikam::AbstractCheckableAlbumModel::setCheckStateForParents(), Digikam::AbstractCountingAlbumModel::setCount(), slotAlbumAboutToBeAdded(), slotAlbumAboutToBeDeleted(), slotAlbumIconChanged(), slotAlbumRenamed(), and Digikam::AbstractSpecificAlbumModel::slotGotThumbnailFromIcon().
bool Digikam::AbstractAlbumModel::isFaceTagModel | ( | ) | const |
Returns true if the album model a face tag model
Referenced by Digikam::TagModel::decorationRoleData(), and Digikam::AlbumFilterModel::lessThan().
|
protectedvirtual |
For subclassing convenience: A part of the implementation of itemFlags()
Referenced by flags().
|
override |
References albumForIndex(), and index().
|
override |
|
override |
References index(), indexForAlbum(), and Digikam::Album::parent().
Referenced by Digikam::AbstractCheckableAlbumModel::checkAllAlbums(), hasChildren(), index(), Digikam::AbstractCheckableAlbumModel::invertCheckedAlbums(), Digikam::AbstractCheckableAlbumModel::resetCheckedAlbums(), rowCount(), slotAlbumAboutToBeAdded(), and slotAlbumAboutToBeDeleted().
|
static |
Returns the album represented by the index. In contrast to albumForIndex(), the index can be from any proxy model, as long as an AbstractAlbumModel is at the end.
References AlbumPointerRole, and index().
Referenced by Digikam::AlbumFilterModel::albumForIndex(), and Digikam::AlbumFilterModel::filterAcceptsRow().
Album * Digikam::AbstractAlbumModel::rootAlbum | ( | ) | const |
Referenced by AbstractAlbumModel(), Digikam::AbstractAlbumTreeView::setAlbumModel(), Digikam::AbstractCheckableAlbumModel::setRootCheckable(), Digikam::AbstractCountingAlbumModel::setShowCount(), Digikam::DateAlbumModel::setYearMonthMap(), and Digikam::AbstractSpecificAlbumModel::slotReloadThumbnails().
|
signal |
This is initialized once after creation, if the root album becomes available, if it was not already available at time of construction. This is emitted regardless of root album policy.
Referenced by slotAlbumAdded().
AbstractAlbumModel::RootAlbumBehavior Digikam::AbstractAlbumModel::rootAlbumBehavior | ( | ) | const |
Returns the root album behavior set for this model
Referenced by Digikam::TagTreeView::setAlbumModel().
QModelIndex Digikam::AbstractAlbumModel::rootAlbumIndex | ( | ) | const |
Return the index corresponding to the root album. If the policy is IgnoreRootAlbum, this is an invalid index.
References indexForAlbum().
Referenced by Digikam::AbstractCheckableAlbumModel::flags(), Digikam::AbstractCheckableAlbumModel::resetCheckedAlbums(), and Digikam::AlbumFilterModel::rootAlbumIndex().
|
override |
References Digikam::Album::childCount(), IncludeRootAlbum, and parent().
Referenced by Digikam::AbstractCheckableAlbumModel::invertCheckedAlbums(), and Digikam::DateAlbumModel::monthIndexForDate().
void Digikam::AbstractAlbumModel::setDragDropHandler | ( | AlbumModelDragDropHandler * | handler | ) |
Set a drag drop handler
Referenced by Digikam::AlbumTreeView::setAlbumModel(), and Digikam::TagTreeView::setAlbumModel().
|
protected |
Switch on drag and drop globally for all items. Default is true. For per-item cases reimplement itemFlags().
|
protected |
|
protected |
Referenced by Digikam::TagModel::activateFaceTagModel().
|
protectedslot |
References filterAlbum(), IgnoreRootAlbum, indexForAlbum(), Digikam::Album::isRoot(), parent(), and Digikam::Album::rowFromAlbum().
Referenced by AbstractAlbumModel().
|
protectedslot |
References albumCleared(), filterAlbum(), IgnoreRootAlbum, indexForAlbum(), Digikam::Album::isRoot(), Digikam::Album::parent(), parent(), and Digikam::Album::rowFromAlbum().
Referenced by AbstractAlbumModel().
|
protectedslot |
References rootAlbumAvailable().
Referenced by AbstractAlbumModel().
|
protectedslot |
Referenced by AbstractAlbumModel().
|
protectedslot |
References filterAlbum(), index(), and indexForAlbum().
Referenced by AbstractAlbumModel().
|
protectedslot |
References filterAlbum(), index(), and indexForAlbum().
Referenced by AbstractAlbumModel().
|
protectedslot |
References allAlbumsCleared().
Referenced by AbstractAlbumModel().
|
protectedvirtual |
For subclassing convenience: A part of the implementation of data()
Reimplemented in Digikam::DateAlbumModel.
References Digikam::Album::title().
Referenced by albumData().
|
override |
References Digikam::CopyAction, and Digikam::MoveAction.