author | hgs |
Fri, 06 Aug 2010 13:36:36 +0300 | |
changeset 71 | 1db7cc813a4e |
parent 62 | 341166945d65 |
child 86 | e4f038c420f7 |
permissions | -rw-r--r-- |
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#ifndef HSWALLPAPER_H |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#define HSWALLPAPER_H |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
|
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <HbWidget> |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include "hsdomainmodel_global.h" |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "hstest_global.h" |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
|
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
25 |
class HbIconItem; |
62 | 26 |
class HsWallpaperLoader; |
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
27 |
|
62 | 28 |
HOMESCREEN_TEST_CLASS(TestHsDomainModel) |
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
|
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
class HSDOMAINMODEL_EXPORT HsWallpaper : public HbWidget |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
{ |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
Q_OBJECT |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
|
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
public: |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
HsWallpaper(QGraphicsItem *parent = 0); |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
~HsWallpaper(); |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
|
62 | 38 |
signals: |
39 |
void imageSet(); |
|
40 |
void imageSetFailed(); |
|
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
41 |
|
62 | 42 |
public slots: |
43 |
void setImage(const QString &path); |
|
44 |
void setDefaultImage(); |
|
45 |
void remove(); |
|
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
46 |
|
62 | 47 |
protected: |
48 |
virtual QString wallpaperDirectory() const = 0; |
|
49 |
virtual QVariantHash createTargets(const QString &sourcePath) = 0; |
|
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
|
62 | 51 |
bool setExistingImage(); |
52 |
QString rootDirectory() const; |
|
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
62 | 54 |
private: |
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
Q_DISABLE_COPY(HsWallpaper) |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
|
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
57 |
private slots: |
62 | 58 |
void onLoaderFinished(); |
59 |
void onLoaderFailed(); |
|
60 |
void updateIconItem(Qt::Orientation orientation); |
|
61 |
||
62 |
protected: |
|
63 |
int mId; |
|
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
64 |
|
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
private: |
62 | 66 |
bool mIsDefaultImage; |
67 |
QString mPortraitImagePath; |
|
68 |
QString mLandscapeImagePath; |
|
69 |
HbIconItem *mIconItem; |
|
70 |
HsWallpaperLoader *mLoader; |
|
71 |
||
72 |
HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) |
|
73 |
}; |
|
74 |
||
75 |
class HsScene; |
|
76 |
class HSDOMAINMODEL_EXPORT HsSceneWallpaper : public HsWallpaper |
|
77 |
{ |
|
78 |
Q_OBJECT |
|
79 |
||
80 |
public: |
|
81 |
HsSceneWallpaper(HsScene *scene, QGraphicsItem *parent = 0); |
|
82 |
~HsSceneWallpaper(); |
|
83 |
||
84 |
HsScene *scene() const { return mScene; } |
|
85 |
void setScene(HsScene *scene); |
|
86 |
||
87 |
protected: |
|
88 |
QString wallpaperDirectory() const; |
|
89 |
QVariantHash createTargets(const QString &sourcePath); |
|
90 |
||
91 |
private: |
|
92 |
Q_DISABLE_COPY(HsSceneWallpaper) |
|
46
23b5d6a29cce
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
93 |
|
62 | 94 |
private: |
95 |
HsScene *mScene; |
|
96 |
HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) |
|
97 |
}; |
|
98 |
||
99 |
class HsPage; |
|
100 |
class HSDOMAINMODEL_EXPORT HsPageWallpaper : public HsWallpaper |
|
101 |
{ |
|
102 |
Q_OBJECT |
|
103 |
||
104 |
public: |
|
105 |
HsPageWallpaper(HsPage *page, QGraphicsItem *parent = 0); |
|
106 |
~HsPageWallpaper(); |
|
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
|
62 | 108 |
HsPage *page() const { return mPage; } |
109 |
void setPage(HsPage *page); |
|
110 |
||
111 |
protected: |
|
112 |
QString wallpaperDirectory() const; |
|
113 |
QVariantHash createTargets(const QString &sourcePath); |
|
114 |
||
115 |
private: |
|
116 |
Q_DISABLE_COPY(HsPageWallpaper) |
|
117 |
||
118 |
private: |
|
119 |
HsPage *mPage; |
|
120 |
HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) |
|
35
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
}; |
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
|
f9ce957a272c
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
#endif // HSWALLPAPER_H |