digiKam
fileactionmngr.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 : 2009-05-05
7  * Description : file action manager
8  *
9  * Copyright (C) 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_FILE_ACTION_MNGR_H
26 #define DIGIKAM_FILE_ACTION_MNGR_H
27 
28 // Local includes
29 
30 #include "iteminfo.h"
31 #include "metaengine_rotation.h"
32 #include "digikam_export.h"
33 
34 namespace Digikam
35 {
36 
37 class MetadataHub;
38 class MetadataHubOnTheRoad;
39 class DisjointMetadata;
40 
41 class DIGIKAM_GUI_EXPORT FileActionMngr : public QObject
42 {
43  Q_OBJECT
44 
45 public:
46 
48  {
51  SplitGroup
52  };
53 
54 public:
55 
56  static FileActionMngr* instance();
57 
58  bool requestShutDown();
59  void shutDown();
60  bool isActive();
61 
62 Q_SIGNALS:
63 
64  void signalImageChangeFailed(const QString& message, const QStringList& fileNames);
65 
66 public Q_SLOTS:
67 
68  void assignTag(const ItemInfo& info, int tagID);
69  void assignTag(const QList<ItemInfo>& infos, int tagID);
70  void assignTags(const ItemInfo& info, const QList<int>& tagIDs);
71  void assignTags(const QList<ItemInfo>& infos, const QList<int>& tagIDs);
72  void assignTags(const QList<qlonglong>& imageIds, const QList<int>& tagIDs);
73 
74  void removeTag(const ItemInfo& info, int tagID);
75  void removeTag(const QList<ItemInfo>& infos, int tagID);
76  void removeTags(const ItemInfo& info, const QList<int>& tagIDs);
77  void removeTags(const QList<ItemInfo>& infos, const QList<int>& tagIDs);
78 
79  void assignPickLabel(const ItemInfo& infos, int pickId);
80  void assignPickLabel(const QList<ItemInfo>& infos, int pickId);
81 
82  void assignColorLabel(const ItemInfo& infos, int colorId);
83  void assignColorLabel(const QList<ItemInfo>& infos, int colorId);
84 
85  void assignRating(const ItemInfo& infos, int rating);
86  void assignRating(const QList<ItemInfo>& infos, int rating);
87 
88  void addToGroup(const ItemInfo& pick, const QList<ItemInfo>& infos);
89  void removeFromGroup(const ItemInfo& info);
90  void removeFromGroup(const QList<ItemInfo>& infos);
91  void ungroup(const ItemInfo& info);
92  void ungroup(const QList<ItemInfo>& infos);
93 
94  void setExifOrientation(const QList<ItemInfo>& infos, int orientation);
95 /*
96  void applyMetadata(const QList<ItemInfo>& infos, const MetadataHub& hub);
97 */
98  void applyMetadata(const QList<ItemInfo>& infos, const DisjointMetadata& hub);
99 
100  // ownership of the hub is passed, hub must be created without QObject parent
101  void applyMetadata(const QList<ItemInfo>& infos, DisjointMetadata* hub);
102 
106  void transform(const QList<ItemInfo>& infos, MetaEngineRotation::TransformationAction action);
107 
108  void copyAttributes(const ItemInfo& source, const QStringList& derivedPaths);
109  void copyAttributes(const ItemInfo& source, const QString& derivedPath);
110 
111 public:
112 
113  // Declared public due to use by FileActionMngrWorker, FileActionMngrDatabaseWorker, and FileActionMngrFileWorker
114  class Private;
115 
116 private:
117 
118  // Disable
119  FileActionMngr();
120  explicit FileActionMngr(QObject*);
121  ~FileActionMngr() override;
122 
123  Private* const d;
124 
125  friend class FileActionMngrCreator;
126 };
127 
128 } // namespace Digikam
129 
130 #endif // DIGIKAM_FILE_ACTION_MNGR_H
Definition: disjointmetadata.h:47
Definition: fileactionmngr_p.h:78
Definition: fileactionmngr.h:42
void signalImageChangeFailed(const QString &message, const QStringList &fileNames)
GroupAction
Definition: fileactionmngr.h:48
@ AddToGroup
Definition: fileactionmngr.h:49
@ RemoveFromGroup
Definition: fileactionmngr.h:50
Definition: iteminfo.h:78
TransformationAction
Definition: metaengine_rotation.h:54
Definition: datefolderview.cpp:43