~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to digikam/tagmodificationhelper.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2010-04-09 21:30:01 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409213001-4bfyibrd359rn7o3
Tags: 2:1.2.0-0ubuntu1
* New upstream release (LP: #560576)
* Remove all patches, fixed upstream
  - Remove quilt build-depend

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2000-12-05
 
7
 * Description : helper class used to modify tag albums in views
 
8
 *
 
9
 * Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot de>
 
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 TAGMODIFICATIONHELPER_H
 
25
#define TAGMODIFICATIONHELPER_H
 
26
 
 
27
// Qt includes
 
28
#include <qobject.h>
 
29
#include <qstring.h>
 
30
 
 
31
// Local includes
 
32
#include "album.h"
 
33
 
 
34
namespace Digikam
 
35
{
 
36
 
 
37
class TagModificationHelperPriv;
 
38
 
 
39
/**
 
40
 * Utility class providing methods to modify tag albums (TAlbum) in a way
 
41
 * useful to implement views.
 
42
 *
 
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.
 
45
 *
 
46
 * @author jwienke
 
47
 */
 
48
class TagModificationHelper: public QObject
 
49
{
 
50
    Q_OBJECT
 
51
public:
 
52
 
 
53
    /**
 
54
     * Constructor.
 
55
     *
 
56
     * @param parent parent for qt parent child mechanism
 
57
     * @param dialogParent paret widget for dialogs displayed by this object
 
58
     */
 
59
    TagModificationHelper(QObject *parent, QWidget *dialogParent);
 
60
 
 
61
    /**
 
62
     * Destructor.
 
63
     */
 
64
    virtual ~TagModificationHelper();
 
65
 
 
66
public Q_SLOTS:
 
67
 
 
68
    /**
 
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.
 
73
     *
 
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
 
77
     *              suggested
 
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
 
80
     */
 
81
    TAlbum *slotTagNew(TAlbum *parent, const QString &title = QString(),
 
82
                       const QString &iconName = QString());
 
83
 
 
84
    /**
 
85
     * Same as above, but this slot is using the parent TAlbum set previously
 
86
     *
 
87
     * @return new tag created or 0 if no tag was created
 
88
     */
 
89
    TAlbum *slotTagNew();
 
90
 
 
91
    /**
 
92
     * Edits the given tag via a user dialog.
 
93
     *
 
94
     * @param tag the tag to change
 
95
     */
 
96
    void slotTagEdit(TAlbum *tag);
 
97
    void slotTagEdit();
 
98
 
 
99
    /**
 
100
     * Deletes the given tag and after prompting the user for this.
 
101
     *
 
102
     * @param tag the tag to delete, must not be the root tag album
 
103
     */
 
104
    void slotTagDelete(TAlbum *tag);
 
105
    void slotTagDelete();
 
106
 
 
107
    /**
 
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.
 
111
     */
 
112
    void setParentTag(TAlbum *parent);
 
113
 
 
114
Q_SIGNALS:
 
115
 
 
116
    void tagCreated(TAlbum *tag);
 
117
    void tagEdited(TAlbum *tag);
 
118
    void aboutToDeleteTag(TAlbum *tag);
 
119
 
 
120
private:
 
121
    TagModificationHelperPriv *d;
 
122
 
 
123
};
 
124
 
 
125
}
 
126
 
 
127
#endif /* TAGMODIFICATIONHELPER_H */