digiKam
taggingaction.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2010-06-12
7  * Description : Action when adding a tag
8  *
9  * Copyright (C) 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx 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 DIGIKAM_TAGGING_ACTION_H
25 #define DIGIKAM_TAGGING_ACTION_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QMetaType>
31 
32 namespace Digikam
33 {
34 
36 {
37 public:
38 
44  enum Type
45  {
49  };
50 
51 public:
52 
56  TaggingAction();
57 
61  explicit TaggingAction(int tagId);
62 
68  TaggingAction(const QString& name, int parentTagId);
69 
70  bool operator==(const TaggingAction& other) const;
71 
72  Type type() const;
73  bool isValid() const;
74  bool shallAssignTag() const;
75  bool shallCreateNewTag() const;
76 
78  int tagId() const;
79 
81  QString newTagName() const;
82  int parentTagId() const;
83 
84 protected:
85 
87  int m_tagId;
88  QString m_tagName;
89 };
90 
91 } // namespace Digikam
92 
93 Q_DECLARE_METATYPE(Digikam::TaggingAction)
94 
95 #endif // DIGIKAM_TAGGING_ACTION_H
Definition: taggingaction.h:36
int tagId() const
If shallAssignTag(), returns the tag id.
Definition: taggingaction.cpp:77
bool shallAssignTag() const
Definition: taggingaction.cpp:67
QString m_tagName
Definition: taggingaction.h:88
QString newTagName() const
If shallCreateNewTag(), returns the tag name and the parent tag id, 0 for toplevel tag.
Definition: taggingaction.cpp:82
bool isValid() const
Definition: taggingaction.cpp:62
Type
Definition: taggingaction.h:45
@ NoAction
Definition: taggingaction.h:46
@ AssignTag
Definition: taggingaction.h:47
@ CreateNewTag
Definition: taggingaction.h:48
bool operator==(const TaggingAction &other) const
Definition: taggingaction.cpp:48
Type m_type
Definition: taggingaction.h:86
int parentTagId() const
Definition: taggingaction.cpp:87
int m_tagId
Definition: taggingaction.h:87
TaggingAction()
Definition: taggingaction.cpp:29
bool shallCreateNewTag() const
Definition: taggingaction.cpp:72
Type type() const
Definition: taggingaction.cpp:57
Definition: datefolderview.cpp:43
Type
Definition: gpsitemcontainer.h:45