1
/****************************************************************************************
2
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> *
4
* This program is free software; you can redistribute it and/or modify it under *
5
* the terms of the GNU General Public License as published by the Free Software *
6
* Foundation; either version 2 of the License, or (at your option) any later *
9
* This program is distributed in the hope that it will be useful, but WITHOUT ANY *
10
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
11
* PARTICULAR PURPOSE. See the GNU General Public License for more details. *
13
* You should have received a copy of the GNU General Public License along with *
14
* this program. If not, see <http://www.gnu.org/licenses/>. *
15
****************************************************************************************/
17
#ifndef ECHONEST_CATALOG_ITEM_H
18
#define ECHONEST_CATALOG_ITEM_H
20
#include "CatalogUpdateEntry.h"
21
#include "echonest_export.h"
25
#include <QSharedPointer>
28
class CatalogItemData;
33
* Since catalog items can be artists or songs, and we don't know sometimes until after we parse them,
34
* but we need to gather a list of them. A poor man's traits class? A rich man's interface? Far from either.
37
class ECHONEST_EXPORT CatalogItem
41
CatalogItem( const CatalogItem& other );
42
CatalogItem& operator=( const CatalogItem& other );
43
virtual ~CatalogItem();
46
* The type of this item.
48
virtual Echonest::CatalogTypes::Type type() const = 0;
51
* The foreign id of this item in the catalog. e.g. CAOFUDS12BB066268E:artist:ARUI8651187B9ACF52
53
* See The Echo Nest API docs for more information.
55
QByteArray foreignId() const;
56
void setForeignId( const QByteArray& id );
59
* The request that generated this catalog item
61
CatalogUpdateEntry request() const;
62
void setRequest( const CatalogUpdateEntry& request );
65
* The date and time when this item was added to the catalog
67
QDateTime dateAdded() const;
68
void setDateAdded( const QDateTime& dt );
71
* The rating of this item.
74
void setRating( int rating );
77
* The play count of this item.
79
int playCount() const;
80
void setPlayCount( int count );
83
QSharedPointer<CatalogItemData> dd;
86
typedef QVector< CatalogItem > CatalogItems;