summaryrefslogtreecommitdiff
path: root/MessageFilterLogic.hpp
blob: 32cc2d6b3128f5d7b69c7cce7722b118cce99661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef MESSAGEFILTERLOGIC_HPP
#define MESSAGEFILTERLOGIC_HPP

#include <QString>
#include <QStringList>

#include "AutoRespondPolicy.hpp"
#include "SpecialOperatingActivity.hpp"

class DecodedText;
class LogBook;

class MessageFilterLogic
{
public:
    struct FilterContext {
        SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE};
        bool bypass {false};
        bool filtersForWord2 {false};
        bool filtersForWaitAndPounceOnly {false};
        bool alwaysPass {false};
        bool blacklisted {false};
        bool whitelisted {false};
        QStringList passKeywords;
        QStringList blacklistKeywords;
        QStringList whitelistKeywords;
        
        // Geographical/B4 filters
        bool hideTerritory1 {false};
        bool hideTerritory2 {false};
        bool hideTerritory3 {false};
        bool hideTerritory4 {false};
        bool hideB4 {false};
        bool hideEU {false};
        bool hideAS {false};
        bool hideNA {false};
        bool hideSA {false};
        bool hideAF {false};
        bool hideOC {false};
        bool hideAN {false};
        
        QString territory1;
        QString territory2;
        QString territory3;
        QString territory4;
        
        QString currentBand;
        QString mode;

        bool pounce {false};
        AutoRespondPolicy respondPolicy {AutoRespondPolicy::None};
    };

    struct FilterResult {
        bool filtered {false};
        bool shouldReturn {false};
        bool resetPoints {false};
    };

    static FilterResult evaluateMSK144(const DecodedText& decodedtext, const FilterContext& ctx, LogBook* logbook);
};

#endif // MESSAGEFILTERLOGIC_HPP