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 HSSELECTBACKGROUNDSTATESTATE_H |
|
19 #define HSSELECTBACKGROUNDSTATESTATE_H |
|
20 |
|
21 #include <QState> |
|
22 #include <QStringList> |
|
23 |
|
24 #include "hstest_global.h" |
|
25 #include "hswallpaperimagereader.h" |
|
26 |
|
27 HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest) |
|
28 |
|
29 class QThread; |
|
30 class HbView; |
|
31 class HbProgressDialog; |
|
32 #ifdef Q_OS_SYMBIAN |
|
33 class HsImageFetcherClient; |
|
34 #else |
|
35 class XQAIWGetImageClient; |
|
36 #endif |
|
37 class HsImageRender; |
|
38 |
|
39 class HsSelectBackgroundState : public QState |
|
40 { |
|
41 Q_OBJECT |
|
42 |
|
43 public: |
|
44 HsSelectBackgroundState(QState *parent = 0); |
|
45 ~HsSelectBackgroundState(); |
|
46 |
|
47 private: |
|
48 Q_DISABLE_COPY(HsSelectBackgroundState) |
|
49 |
|
50 enum ImageProcessingState { |
|
51 NotRunning, |
|
52 ProcessPortraitAsFirst, |
|
53 ProcessLandscapeAsFirst, |
|
54 ProcessPortraitAsSecond, |
|
55 ProcessLandscapeAsSecond, |
|
56 Error |
|
57 }; |
|
58 |
|
59 signals: |
|
60 void event_waitInput(); |
|
61 void handleError(); |
|
62 |
|
63 private slots: |
|
64 void action_selectWallpaper(); |
|
65 void action_disconnectImageFetcher(); |
|
66 |
|
67 void onFetchComplete(QStringList imageStringList); |
|
68 void onFetchFailed(int error); |
|
69 void onImageProcessed(); |
|
70 void onShowAnimation(); |
|
71 void onHandleError(); |
|
72 |
|
73 // for S60 API |
|
74 #ifdef Q_OS_SYMBIAN |
|
75 void fetchCompleted(const QString&); |
|
76 void fetchFailed(int, const QString&); |
|
77 #endif |
|
78 |
|
79 private: |
|
80 |
|
81 #ifdef Q_OS_SYMBIAN |
|
82 HsImageFetcherClient *mImageFetcher; |
|
83 #else |
|
84 XQAIWGetImageClient *mImageFetcher; |
|
85 #endif |
|
86 |
|
87 HbView *mSourceView; |
|
88 QThread *mWallpaperImageReaderThread; |
|
89 HsWallpaperImageReader *mWallpaperImageReader; |
|
90 HbProgressDialog *mProgressDialog; |
|
91 ImageProcessingState mImageProcessingState; |
|
92 bool mShowAnimation; |
|
93 |
|
94 HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest) |
|
95 }; |
|
96 |
|
97 #endif |
|