mpviewplugins/mpmediawallviewplugin/tsrc/unittest_mpmediawallview/stub/inc/mpengine.h
changeset 48 af3740e3753f
child 55 f3930dda3342
equal deleted inserted replaced
42:79c49924ae23 48:af3740e3753f
       
     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 engine stub for testing mpmediawallview
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPENGINE_H
       
    19 #define MPENGINE_H
       
    20 
       
    21 #include <QObject>
       
    22 #include "mpmpxcollectionviewdefs.h"
       
    23 #include "mpmpxcommondefs.h"
       
    24 #include "mpcommondefs.h"
       
    25 
       
    26 class MpMpxCollectionData;
       
    27 class MpPlaybackData;
       
    28 class MpSongData;
       
    29 class XQSharableFile;
       
    30 class MpEngine : public QObject
       
    31 {
       
    32     Q_OBJECT
       
    33 
       
    34     friend class MpEngineFactory;
       
    35 
       
    36 public:
       
    37     enum EngineMode{
       
    38         StandAlone,
       
    39         Fetch,
       
    40         Embedded,
       
    41         MediaBrowsing
       
    42     };
       
    43     
       
    44 private:
       
    45 
       
    46     enum UsbBlockingState {
       
    47         USB_NotConnected,          // Not connected
       
    48         USB_Connected,             // Connected in MTP mode but not synchronizing
       
    49         USB_Synchronizing          // Connected in MassStorage mode or MTP mode and synchronizing
       
    50     };
       
    51 
       
    52 private:
       
    53     explicit MpEngine();
       
    54 
       
    55 public:
       
    56 
       
    57     virtual ~MpEngine();
       
    58 
       
    59     // Harvester related
       
    60     void refreshLibrary();
       
    61     bool verifyUsbBlocking( bool showMessage = false );
       
    62     void checkForSystemEvents();
       
    63     
       
    64     // Collection related
       
    65 
       
    66     void openCollection( TCollectionContext context );
       
    67     void openCollectionItem( int index );
       
    68     void back();
       
    69     void findPlaylists( QStringList &playlists );
       
    70     void createPlaylist( QString &playlistName, QList<int> &selection, MpMpxCollectionData* collectionData = 0  );
       
    71     void saveToPlaylist( int playlistIndex, QList<int> &selection );
       
    72     void saveToCurrentPlaylist( QList<int> &selection, MpMpxCollectionData *collectionData );    
       
    73     void renamePlaylist( QString &newName, int index );
       
    74     void renamePlaylist( QString &newName );
       
    75     void deleteSongs( QList<int> &selection );
       
    76 
       
    77     void previewItem( int index );
       
    78     void openIsolatedCollection( TCollectionContext context );
       
    79     void releaseIsolatedCollection();
       
    80 
       
    81     void findAlbumSongs( int index );
       
    82     void playAlbumSongs( int albumIndex, int songIndex, MpMpxCollectionData* collectionData = 0 );
       
    83 
       
    84     MpMpxCollectionData *collectionData();
       
    85     
       
    86     // Playback related  
       
    87     MpPlaybackData *playbackData();
       
    88     
       
    89     // Details related
       
    90     MpSongData *songData();
       
    91     void retrieveSong();
       
    92 
       
    93 
       
    94 public slots:
       
    95 
       
    96     // Collection related
       
    97     void reopenCollection();
       
    98     void reorderPlaylist( int playlistId, int songId, int originalOrdinal, int newOrdinal );
       
    99 
       
   100     // Playback related
       
   101     void playEmbedded( QString aFilename );
       
   102     void playEmbedded( const XQSharableFile&  file );
       
   103     void playPause();
       
   104     void stop();
       
   105     void skipForward();
       
   106     void skipBackward();
       
   107     void setPosition( int position );
       
   108     void setShuffle( bool mode );
       
   109     void setRepeat( bool mode );
       
   110 
       
   111 public:
       
   112     //for stubs
       
   113     int mOpenCollectionCalled;
       
   114 
       
   115 private:
       
   116 
       
   117     Q_DISABLE_COPY( MpEngine )
       
   118 
       
   119 };
       
   120 
       
   121 #endif // MPENGINE_H