inc/mpsongdata.h
changeset 29 8192e5b5c935
child 32 c163ef0b758d
equal deleted inserted replaced
25:3ec52facab4d 29:8192e5b5c935
       
     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: Metadata of song for details view.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPSONGDATA_H
       
    19 #define MPSONGDATA_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QString>
       
    23 #include <QPixmap>
       
    24 
       
    25 //forward declartions
       
    26 class ThumbnailManager;
       
    27 class HbIcon;
       
    28 
       
    29 #if defined(BUILD_MPDATA_LIB)
       
    30 #define MPDATA_EXPORT Q_DECL_EXPORT
       
    31 #else
       
    32 #define MPDATA_EXPORT Q_DECL_IMPORT
       
    33 #endif
       
    34 
       
    35 //class declaration
       
    36 class MPDATA_EXPORT MpSongData : public QObject
       
    37 {
       
    38     Q_OBJECT
       
    39 
       
    40 public:
       
    41     explicit MpSongData( QObject *parent=0 );
       
    42     virtual ~MpSongData();
       
    43     
       
    44     bool setTitle( const QString &title );
       
    45     bool setAlbum( const QString &album );
       
    46     bool setArtist( const QString &artist );
       
    47     bool setComment( const QString &comment );
       
    48     void setAlbumArtUri( const QString &albumArtUri );
       
    49     bool setYear( int date );
       
    50     bool setGenre( const QString &genre );
       
    51     bool setComposer( const QString &compoer );
       
    52     bool setAlbumTrack( const QString &albumtrack );
       
    53     void setLink( const QString &link );
       
    54     bool setFileName( const QString &fileName );
       
    55     bool setMimeType( const QString &mimeType );
       
    56     bool setDuration( int duration );
       
    57     bool setBitRate( int bitRate);
       
    58     bool setSampleRate( int sampleRate );
       
    59     bool setSize( int size );
       
    60     bool setModified( const QString &modified );
       
    61     bool setCopyright( const QString &copyright );
       
    62     bool setMusicURL( const QString &musicURL );
       
    63     bool setDrmProtected( bool drmProtected );
       
    64     
       
    65     // inform details view when basic information is ready to accelerate UI update
       
    66     void commitPlaybackInfo();
       
    67     // inform details view when details information is ready
       
    68     void commitSongDetailInfo();
       
    69 
       
    70 public slots:
       
    71     void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
       
    72     
       
    73     int reservedLength() const { return mLink.length() + mTitle.length() + mArtist.length(); }
       
    74 
       
    75     QString title() const;
       
    76     QString album() const;
       
    77     QString artist() const;
       
    78     QString comment() const;
       
    79     void albumArt( HbIcon& icon ) const;
       
    80     QString year() const;
       
    81     QString genre() const;
       
    82     QString composer() const;
       
    83     QString albumTrack() const;
       
    84     QString link() const;
       
    85     
       
    86     QString fileName() const;
       
    87     QString mimeType() const;
       
    88     QString duration() const;
       
    89     QString bitRate() const;
       
    90     QString sampleRate() const;
       
    91     QString size() const;
       
    92     QString modified() const;
       
    93     QString copyright() const;
       
    94     QString musicURL() const;
       
    95     bool isDrmProtected() const;
       
    96     
       
    97     QString albumArtBase64() const;
       
    98 
       
    99 signals:
       
   100     void albumArtReady();
       
   101     void playbackInfoChanged();
       
   102 	void songDetailInfoChanged();	
       
   103 
       
   104 private:
       
   105     QString                  mTitle;
       
   106     QString                  mAlbum;
       
   107     QString                  mArtist;
       
   108     QString                  mComment;
       
   109     QString                  mComposer;
       
   110     QString                  mGenre;
       
   111     QString                  mYear;
       
   112     QString                  mAlbumTrack;
       
   113     HbIcon                   *mAlbumArt;
       
   114     ThumbnailManager         *mThumbnailManager; //owned
       
   115     TInt                     mReqId;
       
   116     QString                  currentAAUri; 
       
   117     HbIcon                   *mDefaultAlbumArt;
       
   118     QString                  mLink;
       
   119     QString                  mFileName;
       
   120     QString                  mMimeType;
       
   121     QString                  mDuration;
       
   122     QString                  mBitRate;
       
   123     QString                  mSampleRate;
       
   124     QString                  mSize;
       
   125     QString                  mModified;
       
   126     QString                  mCopyright;
       
   127     QString                  mMusicURL;
       
   128     bool                     mDrmProtected;
       
   129     
       
   130     Q_DISABLE_COPY(MpSongData)
       
   131 };
       
   132 
       
   133 #endif // MPSONGDATA_H