inc/mpsongscanner.h
changeset 41 ea59c434026a
child 55 f3930dda3342
equal deleted inserted replaced
32:c163ef0b758d 41:ea59c434026a
       
     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 song scanner.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPSONGSCANNER_H
       
    20 #define MPSONGSCANNER_H
       
    21 
       
    22 class MpMpxHarvesterFrameworkWrapper;
       
    23 
       
    24 #include <QObject>
       
    25 #include "mpmpxcommondefs.h"
       
    26 
       
    27 #if defined(BUILD_MPENGINE_LIB)
       
    28 #define MPENGINE_EXPORT Q_DECL_EXPORT
       
    29 #else
       
    30 #define MPENGINE_EXPORT Q_DECL_IMPORT
       
    31 #endif
       
    32 
       
    33 class MPENGINE_EXPORT MpSongScanner : public QObject
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37 public:
       
    38 
       
    39     enum ScanError{
       
    40         ScanErrorNone,
       
    41         ScanGeneralError,
       
    42         ScanErrorDiskFull,
       
    43         ScanInterrupted
       
    44     };
       
    45 
       
    46     explicit MpSongScanner( MpMpxHarvesterFrameworkWrapper *wrapper, QObject *parent = 0 );
       
    47     virtual ~MpSongScanner();
       
    48 
       
    49     void scan( bool automaticScan );
       
    50     bool isAutomaticScan();
       
    51 
       
    52 signals:
       
    53     void scanStarted();
       
    54     void scanCountChanged( int count );
       
    55     void scanFinished( int error, int itemsAdded );
       
    56 
       
    57 public slots:
       
    58     void cancelScan();
       
    59     void handleScanEnded( int numItemsAdded, int error );
       
    60     void handleDiskEvent( MpxDiskEvents event );
       
    61 
       
    62 private:
       
    63 
       
    64     MpMpxHarvesterFrameworkWrapper       *mMpxHarvesterWrapper;       // Not own
       
    65     bool                                 mScanning;
       
    66     bool                                 mAutomaticScan;
       
    67 
       
    68 };
       
    69 
       
    70 #endif // MPSONGSCANNER_H
       
    71