|
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: |
|
15 * |
|
16 */ |
|
17 #ifndef CPTHEMEINFO_H_ |
|
18 #define CPTHEMEINFO_H_ |
|
19 |
|
20 |
|
21 #include <QString> |
|
22 |
|
23 #include <hbicon.h> |
|
24 |
|
25 class CpThemeInfo { |
|
26 |
|
27 public: |
|
28 |
|
29 Q_ENUMS(ThemeListItemType) |
|
30 |
|
31 enum ThemeListItemType { |
|
32 ThemeListItemType_default = 0, |
|
33 ThemeListItemType_URL, |
|
34 ThemeListItemType_APP |
|
35 }; |
|
36 |
|
37 CpThemeInfo(); |
|
38 ~CpThemeInfo(); |
|
39 |
|
40 QString name() const; |
|
41 void setName(const QString& newName); |
|
42 |
|
43 ThemeListItemType itemType() const; |
|
44 void setItemType(ThemeListItemType type); |
|
45 |
|
46 QString itemData() const; |
|
47 void setItemData(const QString& data); |
|
48 |
|
49 HbIcon icon() const; |
|
50 void setIcon(const HbIcon& newIcon); |
|
51 |
|
52 HbIcon portraitPreviewIcon() const; |
|
53 void setPortraitPreviewIcon(const HbIcon& newIcon); |
|
54 |
|
55 HbIcon landscapePreviewIcon() const; |
|
56 void setLandscapePreviewIcon(const HbIcon& newIcon); |
|
57 |
|
58 bool operator < (const CpThemeInfo &other) const { |
|
59 return mName.toCaseFolded().localeAwareCompare(other.mName.toCaseFolded()) < 0; |
|
60 } |
|
61 bool operator == (const CpThemeInfo &other) const { |
|
62 return mName.localeAwareCompare(other.mName) == 0; |
|
63 } |
|
64 |
|
65 private: |
|
66 CpThemeInfo::ThemeListItemType mItemType; |
|
67 QString mItemData; |
|
68 QString mName; |
|
69 HbIcon mIcon; |
|
70 HbIcon mPortraitPreviewIcon; |
|
71 HbIcon mLandscapePreviewIcon; |
|
72 |
|
73 }; |
|
74 Q_DECLARE_METATYPE(CpThemeInfo::ThemeListItemType) |
|
75 |
|
76 |
|
77 #endif /* CPTHEMEINFO_H_ */ |