digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::TagModificationHelper Class Reference

Utility class providing methods to modify tag albums (TAlbum) in a way useful to implement views. More...

+ Inheritance diagram for Digikam::TagModificationHelper:

Public Slots

void slotFaceTagDelete ()
 must use bindTag and a QAction
 
void slotFaceTagDelete (TAlbum *tag)
 Deletes the given face tag and after prompting the user for this.
 
void slotMultipleFaceTagDel ()
 must use bindMultipleTags and a QAction
 
void slotMultipleFaceTagDel (const QList< TAlbum * > &tags)
 Delete multiple face tags and prompt user only once for all The tags itself are not deleted.
 
void slotMultipleTagDel ()
 must use bindMultipleTags and a QAction
 
void slotMultipleTagDel (const QList< TAlbum * > &tags)
 must use bindTag and a QAction
 
void slotMultipleTagsToFaceTags ()
 must use bindMultipleTags and a QAction
 
void slotMultipleTagsToFaceTags (const QList< TAlbum * > &tags)
 Marks the tags as face tags if they are not already.
 
void slotTagDelete ()
 must use bindTag and a QAction
 
void slotTagDelete (TAlbum *tag)
 Deletes the given tag and after prompting the user for this.
 
void slotTagEdit ()
 must use bindTag and a QAction
 
void slotTagEdit (TAlbum *tag)
 Edits the given tag via a user dialog.
 
TAlbumslotTagNew ()
 Same as above, but this slot can be triggered from a QAction if a parent tag is bound to this action, see below.
 
TAlbumslotTagNew (TAlbum *parent, const QString &title=QString(), const QString &iconName=QString())
 Creates one ore more new tags under the given parent.
 
void slotTagToFaceTag ()
 must use bindTag and a QAction
 
void slotTagToFaceTag (TAlbum *tag)
 Marks the tag as face tag if it is not already.
 

Signals

void aboutToDeleteTag (TAlbum *tag)
 
void tagCreated (TAlbum *tag)
 
void tagEdited (TAlbum *tag)
 

Public Member Functions

 TagModificationHelper (QObject *const parent, QWidget *const dialogParent)
 Constructor.
 
 ~TagModificationHelper () override
 Destructor.
 
void bindMultipleTags (QAction *action, const QList< TAlbum * > &tags)
 Set QVector's pointer into action's data.
 
void bindTag (QAction *action, TAlbum *parent) const
 Sets the tag that the given action operates on.
 
QList< TAlbum * > boundMultipleTags (QObject *sender)
 Return QVector pointer bound with bindMultipleTags.
 
TAlbumboundTag (QObject *action) const
 Returns the tag bound with bindTag.
 

Detailed Description

This class can do background processing for batch tag operations. So be sure that the signals indicating the progress of these operations are used.

Author
jwienke

Constructor & Destructor Documentation

◆ TagModificationHelper()

Digikam::TagModificationHelper::TagModificationHelper ( QObject *const  parent,
QWidget *const  dialogParent 
)
explicit
Parameters
parentthe parent for qt parent child mechanism
dialogParentparent widget for dialogs displayed by this object

Member Function Documentation

◆ bindMultipleTags()

void Digikam::TagModificationHelper::bindMultipleTags ( QAction *  action,
const QList< TAlbum * > &  tags 
)

Make sure that QVector is not a local object and it's not destroyed before boundMultipleTags are called

Parameters
action- action to store pointer
tags- QVector pointer to be stored

◆ bindTag()

void Digikam::TagModificationHelper::bindTag ( QAction *  action,
TAlbum parent 
) const

You must call bindTag and then connect the action's triggered to the desired slot, slotTagNew(), slotTagEdit() or slotTagDelete(). Note: Changes the Action's user data.

◆ boundMultipleTags()

QList< TAlbum * > Digikam::TagModificationHelper::boundMultipleTags ( QObject *  sender)

Use when context menu should delete more than one item: multiple-selection.

◆ boundTag()

TAlbum * Digikam::TagModificationHelper::boundTag ( QObject *  action) const

The given QObject shall be a QAction, but for convenience the given object will be checked with qobject_cast first, so you can pass QObject::sender().

◆ slotFaceTagDelete

void Digikam::TagModificationHelper::slotFaceTagDelete ( TAlbum tag)
slot

The tag itself is not deleted. Only its property as face tag.

Parameters
tagthe face tag to delete

◆ slotMultipleFaceTagDel

void Digikam::TagModificationHelper::slotMultipleFaceTagDel ( const QList< TAlbum * > &  tags)
slot

Only their properties as face tags.

Parameters
tagsface tags to be deleted.

◆ slotMultipleTagDel

void Digikam::TagModificationHelper::slotMultipleTagDel ( const QList< TAlbum * > &  tags)
slot

Delete multiple tags and prompt user only once for all

Parameters
tagsthe tags to be deleted, without root tag

Tags must be deleted from children to parents, if we don't want to step on invalid index. Use QMultiMap to order them by distance to root tag

QMultimap doesn't provide reverse iterator, use QList.

◆ slotMultipleTagsToFaceTags

void Digikam::TagModificationHelper::slotMultipleTagsToFaceTags ( const QList< TAlbum * > &  tags)
slot
Parameters
tagsthe tags to mark.

◆ slotTagDelete

void Digikam::TagModificationHelper::slotTagDelete ( TAlbum tag)
slot
Parameters
tagthe tag to delete, must not be the root tag album

◆ slotTagEdit

void Digikam::TagModificationHelper::slotTagEdit ( TAlbum tag)
slot
Parameters
tagthe tag to change

◆ slotTagNew [1/2]

TAlbum * Digikam::TagModificationHelper::slotTagNew ( )
slot

Without this mechanism, will add a toplevel tag.

Returns
new tag created or 0 if no tag was created

◆ slotTagNew [2/2]

TAlbum * Digikam::TagModificationHelper::slotTagNew ( TAlbum parent,
const QString &  title = QString(),
const QString &  iconName = QString() 
)
slot

If only the parent is given, then a dialog is shown to create new tags. Else, if also a title and optionally an icon are given, then these values will be used directly to create the tag.

Parameters
parentthe parent tag album under which to create the new tags. May be 0 to use the root album
titleif this isn't an empty string, then this tag name is suggested
iconNamean optional name for the icon to suggest for the new tag
Returns
new tag album or 0 if not created

◆ slotTagToFaceTag

void Digikam::TagModificationHelper::slotTagToFaceTag ( TAlbum tag)
slot
Parameters
tagthe tag to mark