homescreenapp/hsdomainmodel/inc/hswallpaperloader.h
changeset 62 341166945d65
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
       
     1 /*
       
     2 * Copyright (c) 2010 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HSWALLPAPERLOADER_H
       
    19 #define HSWALLPAPERLOADER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QVariantHash>
       
    23 
       
    24 #include "hsdomainmodel_global.h"
       
    25 #include "hstest_global.h"
       
    26 
       
    27 HOMESCREEN_TEST_CLASS(TestHsDomainModel)
       
    28 
       
    29 class QThread;
       
    30 
       
    31 class HsWallpaperLoaderThread;
       
    32 
       
    33 class HSDOMAINMODEL_EXPORT HsWallpaperLoader : public QObject
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37 public:
       
    38     HsWallpaperLoader(QObject *parent = 0);
       
    39     ~HsWallpaperLoader();
       
    40 
       
    41     void setSourcePath(const QString &path) { mSourcePath = path; }
       
    42     
       
    43     QVariantHash targets() const { return mTargets; }
       
    44     void setTargets(const QVariantHash &targets) { mTargets = targets; }
       
    45     
       
    46     bool isRunning() const { return mIsRunning; }
       
    47 
       
    48 signals:
       
    49     void finished();
       
    50     void failed();
       
    51 
       
    52 public slots:
       
    53     void start();
       
    54     void cancel();
       
    55 
       
    56 private:
       
    57     Q_DISABLE_COPY(HsWallpaperLoader)
       
    58     void cleanup();
       
    59     
       
    60 private slots:
       
    61     void onThreadFinished();
       
    62 
       
    63 private:
       
    64     bool mIsRunning;
       
    65     QString mSourcePath;
       
    66     QVariantHash mTargets;    
       
    67     QList<HsWallpaperLoaderThread *> mThreads;
       
    68     int mNumberOfFinishedThreads;
       
    69     
       
    70     HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
       
    71 };
       
    72 
       
    73 #endif // HSWALLPAPERLOADER_H