musicservices/inc/musicservices.h
branchRCL_3
changeset 25 14979e23cb5e
equal deleted inserted replaced
24:26a1709b9fec 25:14979e23cb5e
       
     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 Services interface.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MUSICSERVICES_H
       
    19 #define MUSICSERVICES_H
       
    20 
       
    21 #include <xqserviceprovider.h>
       
    22 #include <QStringList>
       
    23 
       
    24 
       
    25 // Forward declarations
       
    26 class GetMusicService;
       
    27 class PlayMusicService;
       
    28 class XQSharableFile;
       
    29 
       
    30 #if defined(BUILD_MUSICSERVICES_LIB)
       
    31 #define MUSICSERVICES_EXPORT Q_DECL_EXPORT
       
    32 #else
       
    33 #define MUSICSERVICES_EXPORT Q_DECL_IMPORT
       
    34 #endif
       
    35 
       
    36 
       
    37 class MUSICSERVICES_EXPORT MusicServices : public QObject
       
    38 {
       
    39     Q_OBJECT
       
    40 
       
    41 public:
       
    42 
       
    43     /*
       
    44      * Enum reflecting the services provided 
       
    45      */
       
    46     enum MusicService
       
    47     {
       
    48         ENoService,
       
    49         EUriFetcher,
       
    50         EPlayback
       
    51     };
       
    52 
       
    53     MusicServices();
       
    54     ~MusicServices();   
       
    55     QString contextTitle() const;
       
    56     MusicServices::MusicService currentService();
       
    57     void setCurrentService( MusicServices::MusicService service );
       
    58 
       
    59 public slots:
       
    60 
       
    61     void itemSelected( QString songName );
       
    62 
       
    63 signals:
       
    64 
       
    65     void playReady( const QString& aFileName );
       
    66     void playReady( const XQSharableFile& file );
       
    67     void serviceActive( TUid hostUid );
       
    68 
       
    69 private:
       
    70     
       
    71     GetMusicService                 *mFetchService;
       
    72     PlayMusicService                *mPlayService;
       
    73     MusicServices::MusicService     mCurrentService;
       
    74     
       
    75     friend class GetMusicService;
       
    76     friend class PlayMusicService;
       
    77 };
       
    78 
       
    79 #endif // MUSICSERVICES_H