summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/IAddonSupportList.h
blob: 0390a4cce6e43762a746349b61efae30eab45f18 (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
/*
 *  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>
#include <vector>

namespace KODI
{
namespace ADDONS
{

/*!
 * @brief To identify related type about entry
 */
enum class AddonSupportType
{
  /* To set if type relates to a file extension */
  Extension,

  /* Used if relates to a Internet Media Type (MIME-Type) */
  Mimetype
};

/*!
 * @brief Information structure with which a supported format of an addon can
 * be stored.
 */
struct AddonSupportEntry
{
  /* Type what this is about */
  AddonSupportType m_type;

  /* The name used for processing */
  std::string m_name;

  /* User-friendly description of the name type stored here. */
  std::string m_description;

  /* Path to use own icon about. */
  std::string m_icon;
};

/*!
 * @brief Parent class to manage all available mimetypes and file extensions of
 * the respective add-on and its types.
 *
 * This class should be integrated in the respective add-on type manager and in
 * order to get an overview of all that are intended for file processing.
 *
 * @todo Extend this class with database usage and support to activate /
 * deactivate the respective formats and thus to override add-ons if several
 * support the same.
 */
class IAddonSupportList
{
public:
  IAddonSupportList() = default;
  virtual ~IAddonSupportList() = default;

  /*!
   * @brief To give all file extensions and MIME types supported by the addon.
   *
   * @param[in] addonId Identifier about wanted addon
   * @return List of all supported parts on selected addon
   */
  virtual std::vector<AddonSupportEntry> GetSupportedExtsAndMimeTypes(
      const std::string& addonId) = 0;
};

} /* namespace ADDONS */
} /* namespace KODI */