Merge pull request #5039 from CEikermann/patch-1
[vuplus_xbmc] / xbmc / epg / EpgSearchFilter.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2012-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "XBDateTime.h"
24
25 class CFileItemList;
26
27 namespace EPG
28 {
29   class CEpgInfoTag;
30
31   #define EPG_SEARCH_UNSET (-1)
32
33   /** Filter to apply with on a CEpgInfoTag */
34
35   struct EpgSearchFilter
36   {
37     static int FilterRecordings(CFileItemList &results);
38     static int FilterTimers(CFileItemList &results);
39
40     /*!
41      * @brief Clear this filter.
42      */
43     virtual void Reset();
44
45     /*!
46      * @brief Check if a tag will be filtered or not.
47      * @param tag The tag to check.
48      * @return True if this tag matches the filter, false if not.
49      */
50     virtual bool FilterEntry(const CEpgInfoTag &tag) const;
51
52     virtual bool MatchGenre(const CEpgInfoTag &tag) const;
53     virtual bool MatchDuration(const CEpgInfoTag &tag) const;
54     virtual bool MatchStartAndEndTimes(const CEpgInfoTag &tag) const;
55     virtual bool MatchSearchTerm(const CEpgInfoTag &tag) const;
56     virtual bool MatchChannelNumber(const CEpgInfoTag &tag) const;
57     virtual bool MatchChannelGroup(const CEpgInfoTag &tag) const;
58     virtual bool MatchBroadcastId(const CEpgInfoTag &tag) const;
59
60     static int RemoveDuplicates(CFileItemList &results);
61
62     CStdString    m_strSearchTerm;            /*!< The term to search for */
63     bool          m_bIsCaseSensitive;         /*!< Do a case sensitive search */
64     bool          m_bSearchInDescription;     /*!< Search for strSearchTerm in the description too */
65     int           m_iGenreType;               /*!< The genre type for an entry */
66     int           m_iGenreSubType;            /*!< The genre subtype for an entry */
67     int           m_iMinimumDuration;         /*!< The minimum duration for an entry */
68     int           m_iMaximumDuration;         /*!< The maximum duration for an entry */
69     CDateTime     m_startDateTime;            /*!< The minimum start time for an entry */
70     CDateTime     m_endDateTime;              /*!< The maximum end time for an entry */
71     bool          m_bIncludeUnknownGenres;    /*!< Include unknown genres or not */
72     bool          m_bPreventRepeats;          /*!< True to remove repeating events, false if not */
73
74     /* PVR specific filters */
75     int           m_iChannelNumber;           /*!< The channel number in the selected channel group */
76     bool          m_bFTAOnly;                 /*!< Free to air only or not */
77     int           m_iChannelGroup;            /*!< The group this channel belongs to */
78     bool          m_bIgnorePresentTimers;     /*!< True to ignore currently present timers (future recordings), false if not */
79     bool          m_bIgnorePresentRecordings; /*!< True to ignore currently active recordings, false if not */
80     int           m_iUniqueBroadcastId;       /*!< The broadcastid to search for */
81   };
82 }