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: Store for all found skins. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PSLNSKINSTORE_H |
|
20 #define C_PSLNSKINSTORE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <AknsSrvSkinInformationPkg.h> |
|
24 |
|
25 class CPslnModel; |
|
26 class CPslnSkinEntry; |
|
27 class CPslnSkinNameEntry; |
|
28 class TAknsPkgID; |
|
29 class RFs; |
|
30 |
|
31 /** |
|
32 * Store for all found skins. |
|
33 */ |
|
34 NONSHARABLE_CLASS( CPslnSkinStore ) : public CBase |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 * @param aModel pointer to model. |
|
41 * @return new instance of CPslnSkinStore. |
|
42 */ |
|
43 static CPslnSkinStore* NewL( CPslnModel* aModel ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CPslnSkinStore(); |
|
49 |
|
50 /** |
|
51 * Tries to retrieve all skins. |
|
52 * @param aFsSession File server session. |
|
53 */ |
|
54 void UpdateAllSkinsL( RFs& aFsSession ); |
|
55 |
|
56 /** |
|
57 * Tries to find a specific skin from specified location. |
|
58 * @param aPID skin instance ID. |
|
59 * @param aLocation location from where to search (memory card, or flash) |
|
60 * @return pointer to retrieved skin instance. |
|
61 */ |
|
62 CPslnSkinEntry* Find( |
|
63 const TAknsPkgID& aPID, |
|
64 TAknSkinSrvSkinPackageLocation aLocation ); |
|
65 |
|
66 /** |
|
67 * Creates an array of skin names. |
|
68 * |
|
69 * @return Newly created array. Ownership is transferred. |
|
70 */ |
|
71 RPointerArray<CPslnSkinNameEntry>* CreateNameArrayL(); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * Updates or adds the skin into array. |
|
77 * |
|
78 * @param aInfo Information structure. Ownership is transferred. |
|
79 */ |
|
80 CPslnSkinEntry* UpdateOrAddL( |
|
81 CAknsSrvSkinInformationPkg* aInfo, |
|
82 RFs& aFsSession ); |
|
83 |
|
84 /* Updates all skins from given location. */ |
|
85 void UpdateAllSkinsL( |
|
86 TAknSkinSrvSkinPackageLocation aLocation, RFs& aFsSession ); |
|
87 |
|
88 /* Appends one entry to array. */ |
|
89 void AppendEntryL( |
|
90 RPointerArray<CPslnSkinNameEntry>& aArray, const TInt aIndex ); |
|
91 |
|
92 /** |
|
93 * C++ default constructor. |
|
94 */ |
|
95 CPslnSkinStore(); |
|
96 |
|
97 /** |
|
98 * By default Symbian 2nd phase constructor is private. |
|
99 */ |
|
100 void ConstructL( CPslnModel* aModel ); |
|
101 |
|
102 private: // Data |
|
103 |
|
104 /** |
|
105 * Pointer to model. |
|
106 * Not own. |
|
107 */ |
|
108 CPslnModel* iModel; |
|
109 |
|
110 /** |
|
111 * Skin array. |
|
112 */ |
|
113 RPointerArray<CPslnSkinEntry> iSkinArray; |
|
114 |
|
115 /** |
|
116 * Default skin PID. |
|
117 */ |
|
118 TAknsPkgID iDefaultSkinPID; |
|
119 }; |
|
120 |
|
121 #endif // C_PSLNSKINSTORE_H |
|
122 |
|
123 // End of File |
|