LeechCraft  0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
iradiostationprovider.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <memory>
12 #include <functional>
13 #include <variant>
14 #include <QMap>
15 #include <QMetaType>
16 #include <QtPlugin>
17 
18 class QModelIndex;
19 class QAbstractItemModel;
20 
21 namespace Media
22 {
23  class IRadioStation;
24  typedef std::shared_ptr<IRadioStation> IRadioStation_ptr;
25 
26  using ActionFunctor_f = std::variant<std::function<void (QModelIndex)>, std::function<void ()>>;
27 
32  enum RadioType
33  {
37 
46 
55 
59 
72 
81 
87 
94 
101  };
102 
108  {
113  ItemType = Qt::UserRole + 1,
114 
120 
127 
143 
147 
151  };
152 
161  class Q_DECL_EXPORT IRadioStationProvider
162  {
163  public:
165 
179  virtual IRadioStation_ptr GetRadioStation (const QModelIndex& item, const QString& query) = 0;
180 
196  virtual QList<QAbstractItemModel*> GetRadioListItems () const = 0;
197 
200  virtual void RefreshItems (const QList<QModelIndex>&) = 0;
201  };
202 }
203 
205 
206 Q_DECLARE_INTERFACE (Media::IRadioStationProvider, "org.LeechCraft.Media.IRadioStationProvider/1.0")
Radio of a global tag like metalcore.
The callable functor for RadioAction.
std::shared_ptr< IRadioStation > IRadioStation_ptr
A pointer to a shared instance of a IRadioStation.
The ID of the plugin for this radio item.
Interface for plugins providing radio stations.
RadioItemRole
Custom user roles for the items in the model.
Radio of artists similar to a given one.
No type (item doesn&#39;t correspond to a radio station).
A root for a list of SingleTrack or TracksList items.
A predefined list of single tracks, not a stream.
Q_DECLARE_METATYPE(QVariantList *)
The type of this radio station.
A radio station that contains user-addable streams.
RadioType
Describes the type of a radio station.
A predefined radio station like an Icecast stream.
The internal ID of the radio.
std::variant< std::function< void(QModelIndex)>, std::function< void()> > ActionFunctor_f