24
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef RADIOHISTORYITEM_H
|
|
19 |
#define RADIOHISTORYITEM_H
|
|
20 |
|
|
21 |
// System includes
|
34
|
22 |
#include <QSharedDataPointer>
|
24
|
23 |
#include <QMetaType>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include "radiouiengineexport.h"
|
|
27 |
|
|
28 |
// Forward declarations
|
|
29 |
class RadioHistoryItemPrivate;
|
|
30 |
|
|
31 |
/*!
|
|
32 |
* Radio history item implements a song recognized from the radio broadcast
|
|
33 |
*/
|
34
|
34 |
class UI_ENGINE_DLL_EXPORT RadioHistoryItem
|
24
|
35 |
{
|
|
36 |
public:
|
|
37 |
|
|
38 |
RadioHistoryItem();
|
|
39 |
RadioHistoryItem( const QString& artist, const QString& title );
|
|
40 |
RadioHistoryItem( const RadioHistoryItem& other );
|
|
41 |
|
|
42 |
~RadioHistoryItem();
|
|
43 |
|
|
44 |
RadioHistoryItem& operator=( const RadioHistoryItem& other );
|
|
45 |
|
|
46 |
bool isValid() const;
|
|
47 |
void reset();
|
|
48 |
|
|
49 |
int id() const;
|
|
50 |
|
|
51 |
QString artist() const;
|
|
52 |
void setArtist( const QString& artist );
|
|
53 |
|
|
54 |
QString title() const;
|
|
55 |
void setTitle( const QString& title );
|
|
56 |
|
|
57 |
QString station() const;
|
|
58 |
void setStation( const QString& station );
|
|
59 |
|
|
60 |
uint frequency() const;
|
|
61 |
void setFrequency( uint frequency );
|
|
62 |
|
|
63 |
QString time() const;
|
|
64 |
void setCurrentTime();
|
|
65 |
|
|
66 |
bool isTagged() const;
|
|
67 |
|
|
68 |
bool isRecognizedByRds() const;
|
|
69 |
|
|
70 |
private: // data
|
|
71 |
|
34
|
72 |
/*!
|
24
|
73 |
* Pointer to the implicitly shared private implementation
|
|
74 |
* Own.
|
|
75 |
*/
|
34
|
76 |
QSharedDataPointer<RadioHistoryItemPrivate> mData;
|
24
|
77 |
|
|
78 |
public:
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Checks if the class is detached from implicitly shared data
|
|
82 |
* Required by many QT convenience functions for implicitly shared classes
|
|
83 |
*/
|
|
84 |
bool isDetached() const;
|
|
85 |
|
34
|
86 |
typedef QSharedDataPointer<RadioHistoryItemPrivate> DataPtr;
|
24
|
87 |
inline DataPtr &data_ptr() { return mData; }
|
|
88 |
|
|
89 |
};
|
|
90 |
|
|
91 |
Q_DECLARE_TYPEINFO( RadioHistoryItem, Q_MOVABLE_TYPE ); // Can be moved around in memory by containers if necessary
|
|
92 |
Q_DECLARE_SHARED( RadioHistoryItem ) // Uses implicit sharing
|
|
93 |
Q_DECLARE_METATYPE( RadioHistoryItem ) // To be usable in a QVariant
|
|
94 |
|
|
95 |
#endif // RADIOHISTORYITEM_H
|