summaryrefslogtreecommitdiff
path: root/blacklist.h
blob: 7410b35a7f670c52c5ae13625bd8fddd59be7209 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*                                                                  -*- c++ -*-
Copyright (C) 2004-2013 Christian Wieninger

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

The author can be reached at cwieninger@gmx.de

The project's page is at http://winni.vdr-developer.org/epgsearch
*/

#ifndef __EPGSEARCHBL_H
#define __EPGSEARCHBL_H

#include <vdr/plugin.h>

class cSearchExt;
class cSearchResults;

class cBlacklist : public cListObject
{
    friend class cMenuEditSearchExt;
public:
    int      ID;
    char     search[MaxFileName];
    int      options;
    int      useTime;
    int      startTime;
    int      stopTime;
    int      useChannel;
    const cChannel *channelMin;
    const cChannel *channelMax;
    char*    channelGroup;
    int      useCase;
    int      mode;
    int      useTitle;
    int      useSubtitle;
    int      useDescription;
    int      useDuration;
    int      minDuration;
    int      maxDuration;
    int      useDayOfWeek;
    int      DayOfWeek;
    int      useExtEPGInfo;
    int      ignoreMissingEPGCats;
    char**   catvalues;
    int      fuzzyTolerance;
    int      isGlobal;
    static char *buffer;
public:
    cBlacklist(void);
    virtual ~cBlacklist(void);
    cBlacklist& operator= (const cBlacklist&);
    virtual bool operator< (const cListObject &ListObject);

    const char *Search(void) {
        return search;
    }
    int Options(void) {
        return options;
    }
    int StartTime(void) {
        return startTime;
    }
    int StopTime(void) {
        return stopTime;
    }
    int UseChannel(void) {
        return useChannel;
    }
    const cChannel *ChannelMin(void) {
        return channelMin;
    }
    const cChannel *ChannelMax(void) {
        return channelMax;
    }
    const cEvent * GetEventByBlacklist(const cSchedule *schedules, const cEvent *Start, int MarginStop = 0);
    bool MatchesExtEPGInfo(const cEvent* e);
    const char *ToText(void);
    bool Parse(const char *s);
    bool ParseExtEPGValues(const char *s);
    bool ParseExtEPGEntry(const char *s);
    bool Save(FILE *f);
    cSearchResults* Run(cSearchResults* pSearchResults = NULL, int MarginStop = 0);
    void CopyFromTemplate(const cSearchExt* templ);
};

class cBlacklists : public cConfig<cBlacklist>, public cMutex
{
public:
    int GetNewID(void);
    cBlacklist* GetBlacklistFromID(int ID);
    bool Exists(const cBlacklist* Blacklist);
};

class cBlacklistObject: public cListObject
{
public:
    cBlacklist* blacklist;
    cBlacklistObject(cBlacklist* Blacklist) : blacklist(Blacklist) {}
};

extern cBlacklists Blacklists;

#endif