inc/mpmpxcollectiondata.h
changeset 22 ecf06a08d4d9
child 29 8192e5b5c935
equal deleted inserted replaced
20:82baf59ce8dd 22:ecf06a08d4d9
       
     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: Music Player collection data.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPMPXCOLLECTIONDATA_H
       
    19 #define MPMPXCOLLECTIONDATA_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include "mpmpxcollectionviewdefs.h"
       
    24 
       
    25 class MpMpxCollectionDataPrivate;
       
    26 class CMPXMedia;
       
    27 
       
    28 #if defined(BUILD_MPDATA_LIB)
       
    29 #define MPDATA_EXPORT Q_DECL_EXPORT
       
    30 #else
       
    31 #define MPDATA_EXPORT Q_DECL_IMPORT
       
    32 #endif
       
    33 
       
    34 class MPDATA_EXPORT MpMpxCollectionData : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38     friend class MpMpxCollectionDataPrivate;
       
    39 
       
    40 public:
       
    41 
       
    42     enum DataType {
       
    43         Title,
       
    44         Uri,
       
    45         Duration,
       
    46         Count,
       
    47         Artist,
       
    48         Album,
       
    49         Genre,
       
    50         Rating,
       
    51         AlbumArtUri
       
    52     };
       
    53 
       
    54     explicit MpMpxCollectionData( QObject *parent=0 );
       
    55     virtual ~MpMpxCollectionData();
       
    56 
       
    57     TCollectionContext context() const;
       
    58 
       
    59     int count() const;
       
    60     QString collectionTitle() const;
       
    61     QString itemData( int index, MpMpxCollectionData::DataType type ) const;
       
    62 
       
    63     bool isAutoPlaylist();
       
    64     bool isAutoPlaylist( int index );
       
    65     int itemCount( int index );
       
    66     int containerId();
       
    67     int itemId(int index);
       
    68     void removeItem(int index);
       
    69     bool testCachedItem( int itemId );
       
    70     void insertCachedItem(int index);
       
    71 
       
    72     void setMpxMedia( const CMPXMedia& entries );
       
    73     const CMPXMedia& containerMedia();
       
    74 
       
    75 signals:
       
    76 
       
    77     void contextChanged( TCollectionContext context );
       
    78 private:
       
    79 
       
    80     Q_DISABLE_COPY(MpMpxCollectionData)
       
    81     MpMpxCollectionDataPrivate *d_ptr;
       
    82 
       
    83 };
       
    84 
       
    85 #endif // MPMPXCOLLECTIONDATA_H
       
    86