digiKam
tagscompleter.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 : Completion Box for tags
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_TAGS_COMPLETER_H
25 #define DIGIKAM_TAGS_COMPLETER_H
26 
27 // Qt includes
28 
29 #include <QCompleter>
30 
31 // Local includes
32 
33 #include "taggingaction.h"
34 
35 namespace Digikam
36 {
37 
38 class AlbumFilterModel;
39 class TagModel;
40 
41 class TagCompleter : public QCompleter
42 {
43  Q_OBJECT
44 
45 public:
46 
50  explicit TagCompleter(QObject* const parent = nullptr);
51  ~TagCompleter() override;
52 
56  void update(const QString& fragment);
57 
61  void setContextParentTag(int parentTagId);
62 
66  void setSupportingTagModel(TagModel* const supportingModel);
67  void setTagFilterModel(AlbumFilterModel* const supportingModel);
68 
69 Q_SIGNALS:
70 
71  void signalActivated(const TaggingAction& action);
72  void signalHighlighted(const TaggingAction& action);
73 
74 private Q_SLOTS:
75 
76  void slotActivated(const QModelIndex& index);
77  void slotHighlighted(const QModelIndex& index);
78 
79 private:
80 
81  class Private;
82  Private* const d;
83 };
84 
85 } // namespace Digikam
86 
87 #endif // DIGIKAM_TAGS_COMPLETER_H
Definition: albumfiltermodel.h:45
Definition: tagscompleter.h:42
void setTagFilterModel(AlbumFilterModel *const supportingModel)
Definition: tagscompleter.cpp:127
void update(const QString &fragment)
Definition: tagscompleter.cpp:143
TagCompleter(QObject *const parent=nullptr)
Definition: tagscompleter.cpp:99
void setContextParentTag(int parentTagId)
Definition: tagscompleter.cpp:138
void setSupportingTagModel(TagModel *const supportingModel)
Definition: tagscompleter.cpp:133
void signalHighlighted(const TaggingAction &action)
~TagCompleter() override
Definition: tagscompleter.cpp:122
void signalActivated(const TaggingAction &action)
Definition: albummodel.h:63
Definition: taggingaction.h:36
Definition: datefolderview.cpp:43