summaryrefslogtreecommitdiffstats
path: root/xbmc/pvr/filesystem/PVRGUIDirectory.h
blob: 462c55360c0f32bb88b0da7b1bdd5ec778e84733 (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
/*
 *  Copyright (C) 2012-2019 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "URL.h"

#include <string>

class CFileItemList;

namespace PVR
{

class CPVRGUIDirectory
{
public:
  /*!
   * @brief PVR GUI directory ctor.
   * @param url The directory's URL.
   */
  explicit CPVRGUIDirectory(const CURL& url) : m_url(url) {}

  /*!
   * @brief PVR GUI directory ctor.
   * @param path The directory's path.
   */
  explicit CPVRGUIDirectory(const std::string& path) : m_url(path) {}

  /*!
   * @brief PVR GUI directory dtor.
   */
  virtual ~CPVRGUIDirectory() = default;

  /*!
   * @brief Check existence of this directory.
   * @return True if the directory exists, false otherwise.
   */
  bool Exists() const;

  /*!
   * @brief Obtain the directory listing.
   * @param results The list to fill with the results.
   * @return True on success, false otherwise.
   */
  bool GetDirectory(CFileItemList& results) const;

  /*!
   * @brief Check if this directory supports file write operations.
   * @return True if the directory supports file write operations, false otherwise.
   */
  bool SupportsWriteFileOperations() const;

  /*!
   * @brief Check if any TV recordings are existing.
   * @return True if TV recordings exists, false otherwise.
   */
  static bool HasTVRecordings();

  /*!
   * @brief Check if any deleted TV recordings are existing.
   * @return True if deleted TV recordings exists, false otherwise.
   */
  static bool HasDeletedTVRecordings();

  /*!
   * @brief Check if any radio recordings are existing.
   * @return True if radio recordings exists, false otherwise.
   */
  static bool HasRadioRecordings();

  /*!
   * @brief Check if any deleted radio recordings are existing.
   * @return True if deleted radio recordings exists, false otherwise.
   */
  static bool HasDeletedRadioRecordings();

  /*!
   * @brief Get the list of channel groups.
   * @param bRadio If true, obtain radio groups, tv groups otherwise.
   * @param bExcludeHidden If true exclude hidden groups, include hidden groups otherwise.
   * @param results The file list to store the results in.
   * @return True on success, false otherwise..
   */
  static bool GetChannelGroupsDirectory(bool bRadio, bool bExcludeHidden, CFileItemList& results);

  /*!
   * @brief Get the list of channels.
   * @param results The file list to store the results in.
   * @return True on success, false otherwise..
   */
  bool GetChannelsDirectory(CFileItemList& results) const;

private:
  bool GetTimersDirectory(CFileItemList& results) const;
  bool GetRecordingsDirectory(CFileItemList& results) const;
  bool GetSavedSearchesDirectory(bool bRadio, CFileItemList& results) const;

  const CURL m_url;
};

} // namespace PVR