summaryrefslogtreecommitdiff
path: root/models/FrequencySuggestions.hpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-09 14:12:35 +0200
committerChristoph Berg <myon@debian.org>2026-10-09 14:12:35 +0200
commitffc62c792c9a5196cb4ce7a353287dfe20db6524 (patch)
tree1269efa852935b183daae4bb33a58d1b4d2ffb53 /models/FrequencySuggestions.hpp
parent059831534c7e884f0a607ed86b582fd00d821731 (diff)
New upstream version 3.3.0~beta1+dfsgupstream/3.3.0_beta1+dfsg
Diffstat (limited to 'models/FrequencySuggestions.hpp')
-rw-r--r--models/FrequencySuggestions.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/models/FrequencySuggestions.hpp b/models/FrequencySuggestions.hpp
new file mode 100644
index 00000000..74ed2eb6
--- /dev/null
+++ b/models/FrequencySuggestions.hpp
@@ -0,0 +1,44 @@
+#ifndef FREQUENCY_SUGGESTIONS_HPP__
+#define FREQUENCY_SUGGESTIONS_HPP__
+
+#include "models/FrequencyList.hpp"
+
+#include <QSet>
+#include <QStringList>
+
+class Bands;
+
+namespace FrequencySuggestions
+{
+ using Item = FrequencyList_v2_101::Item;
+ using Items = FrequencyList_v2_101::FrequencyItems;
+
+ QString key (Item const&);
+ bool is_present (Item const&, Items const& working);
+ Items prepare_additions (Items const& selected, Items const& working, Bands const&);
+
+ class NoticeState
+ {
+ public:
+ enum class Visibility { Hidden, Available, New };
+
+ NoticeState (QStringList seen_keys = {}, bool has_seen_catalog = false);
+
+ Visibility visibility (Items const& catalog, Items const& working) const;
+ void selected_additions (Items const& additions);
+ void cancel ();
+ bool commit (Items const& catalog, Items const& committed_working);
+ bool acknowledge_present_catalog (Items const& catalog, Items const& committed_working);
+ void dismiss (Items const& catalog);
+ QStringList seen_keys () const;
+
+ private:
+ void acknowledge (Items const& catalog);
+
+ QSet<QString> seen_keys_;
+ bool has_seen_catalog_ {false};
+ Items pending_additions_;
+ };
+}
+
+#endif