digiKam
Loading...
Searching...
No Matches
taggingactionfactory.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of Tumorprofil
4 *
5 * Date : 11.09.2015
6 *
7 * SPDX-FileCopyrightText: 2012 by Marcel Wiesweg <marcel dot wiesweg at uk-essen dot de>
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 *
11 * ============================================================ */
12
13#pragma once
14
15// Qt includes
16
17#include <QList>
18
19// Local includes
20
21#include "taggingaction.h"
22
23namespace Digikam
24{
25
27{
28public:
29
31 {
32 public:
33
35 virtual ~ConstraintInterface() = default;
36 virtual bool matches(int tagId) = 0;
37
38 private:
39
40 Q_DISABLE_COPY(ConstraintInterface)
41 };
42
43public:
44
53
54public:
55
56 explicit TaggingActionFactory();
57 virtual ~TaggingActionFactory();
58
60 void setFragment(const QString& fragment);
61 QString fragment() const;
62
64 void setParentTag(int parentTagId);
65 int parentTagId() const;
66
71 void setConstraintInterface(ConstraintInterface* const iface);
72 ConstraintInterface* constraintInterface() const;
73
77
79 void reset();
80
82 QList<TaggingAction> actions() const;
83
86
88 int indexOfDefaultAction() const;
89
91 int indexOfLastRecentAction() const;
92
94 QString suggestedUIString(const TaggingAction& action) const;
95
96 static TaggingAction defaultTaggingAction(const QString& tagName, int parentTagId = 0);
97
98private:
99
100 // Disable
102 TaggingActionFactory& operator=(const TaggingActionFactory&) = delete;
103
104 class Private;
105 Private* const d = nullptr;
106};
107
108} // namespace Digikam
Definition taggingactionfactory.h:31
Definition taggingactionfactory.h:27
void setParentTag(int parentTagId)
Set a tag which may by the user be intended to be the parent of a newly created tag.
Definition taggingactionfactory.cpp:90
void reset()
reset all settings to the default (no fragment, no actions)
Definition taggingactionfactory.cpp:133
int parentTagId() const
Definition taggingactionfactory.cpp:85
NameMatchMode nameMatchMode() const
Definition taggingactionfactory.cpp:128
TaggingActionFactory()
Definition taggingactionfactory.cpp:59
QString fragment() const
Definition taggingactionfactory.cpp:69
int indexOfDefaultAction() const
Returns the index of the default action in the list returned by generate()
Definition taggingactionfactory.cpp:270
virtual ~TaggingActionFactory()
Definition taggingactionfactory.cpp:64
NameMatchMode
Definition taggingactionfactory.h:46
@ MatchContainingFragment
use the "contains" method
Definition taggingactionfactory.h:51
@ MatchStartingWithFragment
Default: use the "startingWith" method.
Definition taggingactionfactory.h:48
ConstraintInterface * constraintInterface() const
Definition taggingactionfactory.cpp:112
int indexOfLastRecentAction() const
Returns the index of the last recent action in the list returned by actions()
Definition taggingactionfactory.cpp:280
void setNameMatchMode(NameMatchMode mode)
Set the matching mode for the tag name.
Definition taggingactionfactory.cpp:117
void setConstraintInterface(ConstraintInterface *const iface)
Definition taggingactionfactory.cpp:101
QList< TaggingAction > actions() const
Returns the sorted list of suggested tagging actions, based on the above settings.
Definition taggingactionfactory.cpp:143
QString suggestedUIString(const TaggingAction &action) const
Returns a string to be used in the UI for the given TaggingAction, interpreted in the context of the ...
Definition taggingactionfactory.cpp:354
TaggingAction defaultTaggingAction() const
Returns one single action, which is decided to be the presumably best action based on the settings.
Definition taggingactionfactory.cpp:392
void setFragment(const QString &fragment)
Set a fragment of a tag name to generate possible tags, as known from completers.
Definition taggingactionfactory.cpp:74
Definition taggingaction.h:26
Definition datefolderview.cpp:34