]> cloud.milkyroute.net Git - dolphin.git/blob - src/search/selectors/minimumratingselector.h
Clazy fix
[dolphin.git] / src / search / selectors / minimumratingselector.h
1 /*
2 SPDX-FileCopyrightText: 2025 Felix Ernst <felixernst@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6
7 #ifndef MINIMUMRATINGSELECTOR_H
8 #define MINIMUMRATINGSELECTOR_H
9
10 #include "../updatablestateinterface.h"
11
12 #include <QComboBox>
13
14 namespace Search
15 {
16
17 /**
18 * @brief Select the minimum rating search results should have.
19 * Values <= 0 mean no restriction. 1 is half a star, 2 one full star, etc. 10 is typically the maximum in KDE software.
20 * Since this box only allows selecting full star ratings, the possible values are 0, 2, 4, 6, 8, 10.
21 */
22 class MinimumRatingSelector : public QComboBox, public UpdatableStateInterface
23 {
24 Q_OBJECT
25
26 public:
27 explicit MinimumRatingSelector(std::shared_ptr<const DolphinQuery> dolphinQuery, QWidget *parent = nullptr);
28
29 /** Causes configurationChanged() to be emitted with a DolphinQuery object that does not contain any restriction settable by this class. */
30 void removeRestriction();
31
32 Q_SIGNALS:
33 /** Is emitted whenever settings have changed and a new search might be necessary. */
34 void configurationChanged(const Search::DolphinQuery &dolphinQuery);
35
36 private:
37 void updateState(const std::shared_ptr<const DolphinQuery> &dolphinQuery) override;
38 };
39
40 }
41
42 #endif // MINIMUMRATINGSELECTOR_H