summaryrefslogtreecommitdiffstats
path: root/xbmc/guilib/guiinfo/IGUIInfoProvider.h
blob: 4560b08dd2c8180f902af4cd97e6840e9d6dc638 (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
/*
 *  Copyright (C) 2005-2018 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 <string>

class CFileItem;
class CGUIListItem;

struct AudioStreamInfo;
struct VideoStreamInfo;

namespace KODI
{
namespace GUILIB
{
namespace GUIINFO
{

class CGUIInfo;

class IGUIInfoProvider
{
public:
  virtual ~IGUIInfoProvider() = default;

  /*!
   * @brief Init a new current guiinfo manager item. Gets called whenever the active guiinfo manager item changes.
   * @param item The new item.
   * @return True if the item was inited by the provider, false otherwise.
   */
  virtual bool InitCurrentItem(CFileItem *item) = 0;

  /*!
   * @brief Get a GUIInfoManager label string.
   * @param value Will be filled with the requested value.
   * @param item The item to get the value for. Can be nullptr.
   * @param contextWindow The context window. Can be 0.
   * @param info The GUI info (label id + additional data).
   * @param fallback A fallback value. Can be nullptr.
   * @return True if the value was filled successfully, false otherwise.
   */
  virtual bool GetLabel(std::string &value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const = 0;

  /*!
   * @brief Get a GUIInfoManager label fallback string. Will be called if none of the registered
   * provider's GetLabel() implementation has returned success.
   * @param value Will be filled with the requested value.
   * @param item The item to get the value for. Can be nullptr.
   * @param contextWindow The context window. Can be 0.
   * @param info The GUI info (label id + additional data).
   * @param fallback A fallback value. Can be nullptr.
   * @return True if the value was filled successfully, false otherwise.
   */
  virtual bool GetFallbackLabel(std::string& value,
                                const CFileItem* item,
                                int contextWindow,
                                const CGUIInfo& info,
                                std::string* fallback) = 0;

  /*!
   * @brief Get a GUIInfoManager integer value.
   * @param value Will be filled with the requested value.
   * @param item The item to get the value for. Can be nullptr.
   * @param contextWindow The context window. Can be 0.
   * @param info The GUI info (label id + additional data).
   * @return True if the value was filled successfully, false otherwise.
   */
  virtual bool GetInt(int& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const = 0;

  /*!
   * @brief Get a GUIInfoManager bool value.
   * @param value Will be filled with the requested value.
   * @param item The item to get the value for. Can be nullptr.
   * @param contextWindow The context window. Can be 0.
   * @param info The GUI info (label id + additional data).
   * @return True if the value was filled successfully, false otherwise.
   */
  virtual bool GetBool(bool& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const = 0;

  /*!
   * @brief Set new audio/video stream info data.
   * @param audioInfo New audio stream info.
   * @param videoInfo New video stream info.
   */
  virtual void UpdateAVInfo(const AudioStreamInfo& audioInfo, const VideoStreamInfo& videoInfo, const SubtitleStreamInfo& subtitleInfo) = 0;
};

} // namespace GUIINFO
} // namespace GUILIB
} // namespace KODI