|
1 /* |
|
2 * Copyright (c) 2004-2007 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: Class defining a specific skin within Psln. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PSLNSKINENTRY_H |
|
20 #define C_PSLNSKINENTRY_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <babitflags.h> |
|
24 #include <AknsSrvSkinInformationPkg.h> |
|
25 |
|
26 #include "PslnSkinNameEntry.h" |
|
27 |
|
28 /** |
|
29 * Class defining a specific skin within Psln. |
|
30 */ |
|
31 NONSHARABLE_CLASS( CPslnSkinEntry ) : public CPslnSkinNameEntry |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 * @param aInfo skin information package. |
|
38 * @return new instance of CPslnSkinEntry. |
|
39 */ |
|
40 static CPslnSkinEntry* NewL( CAknsSrvSkinInformationPkg* aInfo ); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 virtual ~CPslnSkinEntry(); |
|
46 |
|
47 /** |
|
48 * Gets skin path. |
|
49 * @param aDst copies skin path to this descriptor. |
|
50 */ |
|
51 IMPORT_C void GetSkinPath( TDes& aDst ) const; |
|
52 |
|
53 /** |
|
54 * Checks if skin entry has corrupted flag set. |
|
55 * @return ETrue if corrupted flag is set. |
|
56 */ |
|
57 IMPORT_C TBool IsCorrupted() const; |
|
58 |
|
59 /** |
|
60 * Checks if skin entry has animation background support. |
|
61 * @return ETrue if supprot animation background. |
|
62 */ |
|
63 IMPORT_C TBool IsSupportAnimBg() const; |
|
64 /** |
|
65 * Returns protection type of skin. |
|
66 * @return protection type of the skin (@see AknsSrvSkinInformatioPkg.h) |
|
67 */ |
|
68 IMPORT_C TAknsSkinSrvSkinProtectionType Protection() const; |
|
69 |
|
70 /** |
|
71 * Returns full name of the skin. |
|
72 * @return full name of the skin. |
|
73 */ |
|
74 IMPORT_C TDesC& FullName() const; |
|
75 |
|
76 /** |
|
77 * Returns ETrue if skin is on mass drive, |
|
78 * @return is skin on mass drive. |
|
79 * |
|
80 * @since 5.0 |
|
81 */ |
|
82 IMPORT_C TBool IsOnMassDrive() const; |
|
83 |
|
84 /** |
|
85 * Returns ETrue if skin is on memory card, |
|
86 * @return is skin on memory card. |
|
87 * |
|
88 * @since 5.0 |
|
89 */ |
|
90 IMPORT_C TBool IsOnMemoryCard() const; |
|
91 |
|
92 /** |
|
93 * Gets ini-file path. |
|
94 * @param aDst copies ini-file path to this descriptor. |
|
95 */ |
|
96 void GetIniPath( TDes& aDst ) const; |
|
97 |
|
98 /** |
|
99 * Sets protection type for the skin. |
|
100 * @param aProtection protection type for the skin. |
|
101 */ |
|
102 void SetProtection( const TAknsSkinSrvSkinProtectionType aProtection ); |
|
103 |
|
104 /** |
|
105 * Sets delete flag. |
|
106 */ |
|
107 void SetDeleteFlag( const TBool& aValue ); |
|
108 |
|
109 /** |
|
110 * Checks is delete flag has been set. |
|
111 * @return ETrue if delete flag has been set. |
|
112 */ |
|
113 TBool IsDeleteFlag() const; |
|
114 |
|
115 /** |
|
116 * Checks the order of the items. The least of items should |
|
117 * be first in the skin list, followed by 'greater' items. |
|
118 * @param aFirst first skin entry |
|
119 * @param aSecond second skin entry |
|
120 * @return zero, if items are equal, |
|
121 * -1, if first item is 'less' than second item. |
|
122 * 1, if first item is 'greater' than second one item |
|
123 */ |
|
124 static TInt LinearOrder( |
|
125 const CPslnSkinEntry& aFirst, |
|
126 const CPslnSkinEntry& aSecond ); |
|
127 |
|
128 /** |
|
129 * Sets memory card flag. |
|
130 * @param aValue new flag value, |
|
131 * @since 5.0 |
|
132 */ |
|
133 void SetMemoryCardFlag( const TBool& aValue ); |
|
134 |
|
135 /** |
|
136 * Sets mass drive flag. |
|
137 * @param aValue new flag value, |
|
138 * @since 5.0 |
|
139 */ |
|
140 void SetMassDriveFlag( const TBool& aValue ); |
|
141 |
|
142 private: |
|
143 |
|
144 /** |
|
145 * C++ default constructor. |
|
146 */ |
|
147 CPslnSkinEntry(); |
|
148 |
|
149 /** |
|
150 * By default Symbian 2nd phase constructor is private. |
|
151 */ |
|
152 void ConstructL(); |
|
153 |
|
154 private: // Data |
|
155 |
|
156 /** |
|
157 * Protection type of the skin. |
|
158 */ |
|
159 TAknsSkinSrvSkinProtectionType iProtection; |
|
160 |
|
161 /** |
|
162 * Skin information package. |
|
163 * Own. |
|
164 */ |
|
165 CAknsSrvSkinInformationPkg* iInfo; |
|
166 |
|
167 /* |
|
168 * Internal state of the class. |
|
169 */ |
|
170 enum TPslnSkinEntryState |
|
171 { |
|
172 // initial state |
|
173 EPslnSkinEntryStateInitial = 0x00000000, |
|
174 // skin has been marked as deleted. |
|
175 EPslnSkinEntryStateDeleted = 0x00000001, |
|
176 // skin is on memory card |
|
177 EPslnSkinEntryStateMemoryCard = 0x00000002, |
|
178 // skin is mass drive |
|
179 EPslnSkinEntryStateMassDrive = 0x00000004 |
|
180 }; |
|
181 TBitFlags iInternalState; |
|
182 |
|
183 }; |
|
184 |
|
185 #endif // C_PSLNSKINENTRY_H |
|
186 |
|
187 // End of File |