4 * Copyright (C) 2012-2013 Team XBMC
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)
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.
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/>.
23 #include "XBDateTime.h"
31 #define EPG_SEARCH_UNSET (-1)
33 /** Filter to apply with on a CEpgInfoTag */
35 struct EpgSearchFilter
37 static int FilterRecordings(CFileItemList &results);
38 static int FilterTimers(CFileItemList &results);
41 * @brief Clear this filter.
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.
50 virtual bool FilterEntry(const CEpgInfoTag &tag) const;
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;
60 static int RemoveDuplicates(CFileItemList &results);
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 */
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 */