1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : helper class used to modify tag albums in views
9
* Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot de>
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)
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.
22
* ============================================================ */
24
#ifndef TAGMODIFICATIONHELPER_H
25
#define TAGMODIFICATIONHELPER_H
37
class TagModificationHelperPriv;
40
* Utility class providing methods to modify tag albums (TAlbum) in a way
41
* useful to implement views.
43
* This class can do background processing for batch tag operations. So be sure
44
* that the signals indicating the progress of these operations are used.
48
class TagModificationHelper: public QObject
56
* @param parent parent for qt parent child mechanism
57
* @param dialogParent paret widget for dialogs displayed by this object
59
TagModificationHelper(QObject *parent, QWidget *dialogParent);
64
virtual ~TagModificationHelper();
69
* Creates one ore more new tags under the given parent. If only the parent
70
* is given, then a dialog is shown to create new tags. Else, if also a
71
* title and optionally an icon are given, then these values will be used
72
* directly to create the tag.
74
* @param parent parent tag album under which to create the new tags. May be
75
* 0 to use the root album
76
* @param title if this isn't an empty string, then this tag name is
78
* @param iconName an optional name for the icon to suggest for the new tag
79
* @return new tag album or 0 if not created
81
TAlbum *slotTagNew(TAlbum *parent, const QString &title = QString(),
82
const QString &iconName = QString());
85
* Same as above, but this slot is using the parent TAlbum set previously
87
* @return new tag created or 0 if no tag was created
92
* Edits the given tag via a user dialog.
94
* @param tag the tag to change
96
void slotTagEdit(TAlbum *tag);
100
* Deletes the given tag and after prompting the user for this.
102
* @param tag the tag to delete, must not be the root tag album
104
void slotTagDelete(TAlbum *tag);
105
void slotTagDelete();
108
* Sets the parent tag. This will be used by the variants which do not
109
* take a TAlbum* argument.
110
* You may find this useful if you want to connect a signal to this object.
112
void setParentTag(TAlbum *parent);
116
void tagCreated(TAlbum *tag);
117
void tagEdited(TAlbum *tag);
118
void aboutToDeleteTag(TAlbum *tag);
121
TagModificationHelperPriv *d;
127
#endif /* TAGMODIFICATIONHELPER_H */