digiKam
addtagscombobox.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-09-15
7  * Description : Special combo box for adding or creating 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_ADD_TAGS_COMBO_BOX_H
25 #define DIGIKAM_ADD_TAGS_COMBO_BOX_H
26 
27 // Qt includes
28 
29 #include <QEvent>
30 
31 // Local includes
32 
33 #include "albumselectcombobox.h"
34 #include "taggingaction.h"
35 
36 namespace Digikam
37 {
38 
39 class AddTagsCompletionBox;
40 class AddTagsLineEdit;
41 class Album;
42 class CheckableAlbumFilterModel;
43 class TAlbum;
44 class TagModel;
45 class TagPropertiesFilterModel;
46 class TagTreeView;
47 
49 {
50  Q_OBJECT
51 
52 public:
53 
54  explicit AddTagsComboBox(QWidget* const parent = nullptr);
55  ~AddTagsComboBox() override;
56 
61  void setAlbumModels(TagModel* const model,
62  TagPropertiesFilterModel* const filteredModel = nullptr,
63  CheckableAlbumFilterModel* const filterModel = nullptr);
64 
71 
75  void setCurrentTag(TAlbum* const album);
76 
77  void setPlaceholderText(const QString& message);
78 
79  QString text() const;
80  void setText(const QString& text);
81 
82  AddTagsLineEdit* lineEdit() const;
83 
84 public Q_SLOTS:
85 
89  void setParentTag(TAlbum* const album);
90 
91 Q_SIGNALS:
92 
97 
103 
104 protected Q_SLOTS:
105 
106  void slotViewIndexActivated(const QModelIndex&);
107  void slotLineEditActionActivated(const TaggingAction& action);
108  void slotLineEditActionSelected(const TaggingAction& action);
109 
110 protected:
111 
112  bool eventFilter(QObject* object, QEvent* event) override;
113 
114 private:
115 
116  // Disable
117  void setEditable(bool editable);
118 
119 private:
120 
121  class Private;
122  Private* const d;
123 };
124 
125 } // namespace Digikam
126 
127 #endif // DIGIKAM_ADD_TAGS_COMBO_BOX_H
Definition: addtagscombobox.h:49
AddTagsComboBox(QWidget *const parent=nullptr)
Definition: addtagscombobox.cpp:61
void slotLineEditActionActivated(const TaggingAction &action)
Definition: addtagscombobox.cpp:177
QString text() const
Definition: addtagscombobox.cpp:139
void slotLineEditActionSelected(const TaggingAction &action)
Definition: addtagscombobox.cpp:184
AddTagsLineEdit * lineEdit() const
Definition: addtagscombobox.cpp:118
void setPlaceholderText(const QString &message)
Definition: addtagscombobox.cpp:134
void setParentTag(TAlbum *const album)
Definition: addtagscombobox.cpp:123
void taggingActionActivated(const TaggingAction &action)
void setCurrentTag(TAlbum *const album)
Definition: addtagscombobox.cpp:128
void setAlbumModels(TagModel *const model, TagPropertiesFilterModel *const filteredModel=nullptr, CheckableAlbumFilterModel *const filterModel=nullptr)
Definition: addtagscombobox.cpp:107
~AddTagsComboBox() override
Definition: addtagscombobox.cpp:102
void taggingActionSelected(const TaggingAction &action)
bool eventFilter(QObject *object, QEvent *event) override
Definition: addtagscombobox.cpp:191
void setText(const QString &text)
Definition: addtagscombobox.cpp:144
void slotViewIndexActivated(const QModelIndex &)
Definition: addtagscombobox.cpp:159
TaggingAction currentTaggingAction()
Definition: addtagscombobox.cpp:149
Definition: addtagslineedit.h:46
QSortFilterProxyModel * filterModel() const
Definition: albumselectcombobox.cpp:231
AbstractCheckableAlbumModel * model() const
Definition: albumselectcombobox.cpp:226
Definition: albumfiltermodel.h:294
Definition: album.h:420
Definition: albummodel.h:63
Definition: albumfiltermodel.h:376
Definition: albumselectcombobox.h:183
Definition: taggingaction.h:36
@ Album
Definition: coredbfields.h:58
Definition: datefolderview.cpp:43