digiKam
filtersidebarwidget.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 : 2000-12-05
7  * Description : filters view for the right sidebar
8  *
9  * Copyright (C) 2009-2010 by Johannes Wienke <languitar at semipol dot de>
10  * Copyright (C) 2010-2011 by Andi Clemens <andi dot clemens at gmail dot com>
11  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  * Copyright (C) 2011 by Michael G. Hansen <mike at mghansen dot de>
13  * Copyright (C) 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
14  *
15  * This program is free software; you can redistribute it
16  * and/or modify it under the terms of the GNU General
17  * Public License as published by the Free Software Foundation;
18  * either version 2, or (at your option)
19  * any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * ============================================================ */
27 
28 #ifndef DIGIKAM_FILTER_SIDE_BAR_WIDGET_H
29 #define DIGIKAM_FILTER_SIDE_BAR_WIDGET_H
30 
31 // Qt includes
32 
33 #include <QWidget>
34 
35 // Local includes
36 
37 #include "itemfiltersettings.h"
38 #include "statesavingobject.h"
39 #include "textfilter.h"
40 #include "digikam_globals.h"
41 
42 namespace Digikam
43 {
44 
46 {
47  TEXT = 0,
51  LABELS
52 };
53 
54 class TagModel;
55 class TAlbum;
56 
62 class FilterSideBarWidget : public DVBox,
63  public StateSavingObject
64 {
65  Q_OBJECT
66 
67 public:
68 
75  explicit FilterSideBarWidget(QWidget* const parent, TagModel* const tagFilterModel);
76 
80  ~FilterSideBarWidget() override;
81 
82  void setConfigGroup(const KConfigGroup& group) override;
83  void doLoadState() override;
84  void doSaveState() override;
85 
86  void setFocusToTextFilter();
87 
88 Q_SIGNALS:
89 
100  void signalTagFilterChanged(const QList<int>& includedTags,
101  const QList<int>& excludedTags,
103  bool showUnTagged,
104  const QList<int>& clTagIds,
105  const QList<int>& plTagIds);
106 
111 
112 public Q_SLOTS:
113 
117  void slotResetFilters();
118 
119  void slotFilterMatchesForText(bool);
120 
121 private Q_SLOTS:
122 
123  void slotCheckedTagsChanged(const QList<TAlbum*>& includedTags,
124  const QList<TAlbum*>& excludedTags);
125  void slotColorLabelFilterChanged(const QList<ColorLabel>&);
126  void slotPickLabelFilterChanged(const QList<PickLabel>&);
127  void slotWithoutTagChanged(int newState);
128  void slotItemExpanded(int id, bool b);
129  void slotTagOptionsTriggered(QAction*);
130  void slotTagOptionsMenu();
131 
132 private:
133 
134  void checkFilterChanges();
135 
136 private:
137 
138  class Private;
139  Private* const d;
140 };
141 
142 } // nameSpace Digikam
143 
144 #endif // DIGIKAM_FILTER_SIDE_BAR_WIDGET_H
Definition: dlayoutbox.h:75
Definition: filtersidebarwidget.h:64
~FilterSideBarWidget() override
Definition: filtersidebarwidget.cpp:327
void doSaveState() override
Definition: filtersidebarwidget.cpp:525
void slotFilterMatchesForText(bool)
Definition: filtersidebarwidget.cpp:362
void signalSearchTextFilterChanged(const SearchTextFilterSettings &)
void signalRatingFilterChanged(int, ItemFilterSettings::RatingCondition, bool)
void slotResetFilters()
Definition: filtersidebarwidget.cpp:367
FilterSideBarWidget(QWidget *const parent, TagModel *const tagFilterModel)
Definition: filtersidebarwidget.cpp:138
void doLoadState() override
Definition: filtersidebarwidget.cpp:489
void setFocusToTextFilter()
Definition: filtersidebarwidget.cpp:357
void signalTagFilterChanged(const QList< int > &includedTags, const QList< int > &excludedTags, ItemFilterSettings::MatchingCondition matchingCond, bool showUnTagged, const QList< int > &clTagIds, const QList< int > &plTagIds)
void setConfigGroup(const KConfigGroup &group) override
Definition: filtersidebarwidget.cpp:483
void signalGeolocationFilterChanged(ItemFilterSettings::GeolocationCondition)
GeolocationCondition
Possible logical matching condition used to sort geolocation.
Definition: itemfiltersettings.h:118
RatingCondition
Possible conditions used to filter rating: >=, =, <=.
Definition: itemfiltersettings.h:110
MatchingCondition
Possible logical matching condition used to sort tags id.
Definition: itemfiltersettings.h:103
Definition: itemfiltersettings.h:61
Definition: statesavingobject.h:76
Definition: albummodel.h:63
Definition: datefolderview.cpp:43
FilterType
Definition: filtersidebarwidget.h:46
@ LABELS
Definition: filtersidebarwidget.h:51
@ TAGS
Definition: filtersidebarwidget.h:50
@ MIME
Definition: filtersidebarwidget.h:48
@ TEXT
Definition: filtersidebarwidget.h:47
@ GEOLOCATION
Definition: filtersidebarwidget.h:49