mpviewplugins/mpdetailsviewplugin/tsrc/unittest_mpdetailsview/stub/src/mpquerymanager.cpp
changeset 48 af3740e3753f
parent 32 c163ef0b758d
equal deleted inserted replaced
42:79c49924ae23 48:af3740e3753f
    19 #include <QObject>
    19 #include <QObject>
    20 #include <QList>
    20 #include <QList>
    21 #include <QFile>
    21 #include <QFile>
    22 #include <QUrl>
    22 #include <QUrl>
    23 
    23 
    24 #include "mpdetailssharedialog.h"
       
    25 #include "mptrace.h"
    24 #include "mptrace.h"
    26 
    25 
    27 const int KRecommendationNum = 2;
    26 const int KRecommendationNum = 2;
    28 
    27 
    29 MpQueryManager::MpQueryManager(QObject *parent)
    28 MpQueryManager::MpQueryManager(QObject *parent)
    54     mArtist=artist;
    53     mArtist=artist;
    55     mAlbum=album;
    54     mAlbum=album;
    56     mTitle=title;
    55     mTitle=title;
    57     TX_EXIT_ARGS("STUB")    
    56     TX_EXIT_ARGS("STUB")    
    58 }
    57 }
       
    58 
       
    59 void MpQueryManager::queryLocalMusicStore()
       
    60 {
       
    61     TX_ENTRY_ARGS("STUB")
       
    62     TX_EXIT_ARGS("STUB")    
       
    63 }
       
    64 
       
    65 void MpQueryManager::reset()
       
    66 {
       
    67     TX_ENTRY_ARGS("STUB")
       
    68     TX_EXIT_ARGS("STUB")    
       
    69 }
       
    70 
       
    71 bool MpQueryManager::isLocalMusicStore() const
       
    72 {
       
    73     TX_ENTRY_ARGS("STUB - will always return TRUE")
       
    74     TX_EXIT_ARGS("STUB") 
       
    75     return true;
       
    76 }
       
    77 
    59     
    78     
    60 void MpQueryManager::queryInspireMeItems(QString artist,QString album,QString title)
    79 void MpQueryManager::queryInspireMeItems(QString artist,QString album,QString title)
    61 {
    80 {
    62     TX_ENTRY_ARGS("STUB")    
    81     TX_ENTRY_ARGS("STUB")    
    63     mArtist=artist;
    82     mArtist=artist;
    89        }
   108        }
    90     }
   109     }
    91     TX_EXIT_ARGS("STUB")    
   110     TX_EXIT_ARGS("STUB")    
    92 }
   111 }
    93 
   112 
    94 /*!
       
    95  Return recommendation songs
       
    96  */
       
    97 QStringList MpQueryManager::recommendationSongs()
       
    98 {
       
    99     TX_LOG  
       
   100     return mRecommendationSongs;
       
   101 }
       
   102 
   113 
   103 /*!
   114 /*!
   104  Return recommendation artists
   115  Return recommendation artists
   105  */
   116  */
   106 QStringList MpQueryManager::recommendationArtists()
   117 QString MpQueryManager::recommendedArtist(int index) const
   107 {
   118 {
   108     TX_LOG  
   119     QString result;
   109     return mRecommendationArtists;
   120     if( (0 <= index) && (index < mRecommendationArtists.count())) {
   110 }
   121         result = mRecommendationArtists.at(index);
   111 
   122     }
   112 /*!
   123     TX_LOG_ARGS ("recommendedArtist: " << result);    
   113  Return recommendation album arts links
   124     return result;
   114  */
       
   115 QStringList MpQueryManager::recommendationAlbumArtsLink()
       
   116 {
       
   117     TX_LOG  
       
   118     return mRecommendationAlbumArtsLink;
       
   119 }
       
   120 
       
   121 /*!
       
   122  Return map of name and pixmap
       
   123  */
       
   124 QMap<QString, QPixmap>  MpQueryManager::recommendationAlbumArtsMap()
       
   125 {
       
   126     TX_LOG  
       
   127     return mRecommendationAlbumArtsMap;
       
   128 }
   125 }
   129 
   126 
   130 /*!
   127 /*!
   131  Return the number of ready album arts
   128  Return the number of ready album arts
   132  */
   129  */
   134 {
   131 {
   135     TX_LOG  
   132     TX_LOG  
   136     return mAlbumArtsReadyCount;
   133     return mAlbumArtsReadyCount;
   137 }
   134 }
   138 
   135 
   139 /*!
   136 int MpQueryManager::recommendationsCount() const
   140  Insert one uri & pixmap item into map
       
   141  */
       
   142 void MpQueryManager::insertMapItem( const QString &uri, const QPixmap &pixmap )
       
   143 {
   137 {
   144     TX_ENTRY_ARGS("STUB Map Item URI: " << uri );
   138     TX_LOG_ARGS ("count: " << mRecommendationSongs.count());
   145     mRecommendationAlbumArtsMap.insert( uri, pixmap );
   139     return mRecommendationSongs.count();
   146     TX_EXIT_ARGS("STUB")
       
   147 }
   140 }
   148 
   141 
       
   142 QString MpQueryManager::recommendedSong(int index) const
       
   143 {
       
   144     QString result;
       
   145     if( (0 <= index) && (index < mRecommendationSongs.count())) {
       
   146         result = mRecommendationSongs.at(index);
       
   147     }
       
   148     return result; 
       
   149 }
       
   150 
       
   151 HbIcon MpQueryManager::recommendedAlbumArt(int index) const
       
   152 {
       
   153     TX_LOG_ARGS( "index = " << index )
       
   154     return mRecommendationAlbumArtsMap.value( mRecommendationAlbumArtsLink.at( index ) );
       
   155 }