|
1 /* |
|
2 * Copyright (c) 2006 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: CBSBrandHandler.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CBSBRANDHANDLER_H__ |
|
20 #define __CBSBRANDHANDLER_H__ |
|
21 |
|
22 #include "rbsobjowningptrarray.h" |
|
23 |
|
24 #include <e32std.h> |
|
25 #include <e32base.h> |
|
26 #include <barsc.h> |
|
27 #include <bamdesca.h> |
|
28 #include <f32file.h> |
|
29 #include <s32file.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class MBSElement; |
|
33 class CBSStorageManager; |
|
34 class CBSSession; |
|
35 |
|
36 /** |
|
37 * |
|
38 * |
|
39 */ |
|
40 NONSHARABLE_CLASS( CBSBrandHandler ): public CBase |
|
41 { |
|
42 public: |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CBSBrandHandler* NewL( const TDesC& aApplicationId, |
|
47 const TDesC& aBrandId, |
|
48 const TDesC& aDefaultBrandId, |
|
49 TLanguage aLanguage, |
|
50 CBSSession* aSession, |
|
51 TInt aReserved = 0); |
|
52 |
|
53 |
|
54 |
|
55 virtual ~CBSBrandHandler(); |
|
56 |
|
57 private: // constructors |
|
58 |
|
59 void ConstructL( const TDesC& aApplicationId, |
|
60 const TDesC& aBrandId, |
|
61 const TDesC& aDefaultBrandId, |
|
62 CBSSession* aSession ); |
|
63 |
|
64 CBSBrandHandler( TLanguage aLanguage, |
|
65 TInt aReserved ); |
|
66 |
|
67 public: |
|
68 HBufC* GetTextL( const TDesC8& aId ); |
|
69 HBufC8* GetBufferL( const TDesC8& aId ); |
|
70 TInt GetIntL( const TDesC8& aId ); |
|
71 MBSElement* GetSeveralL( RBSObjOwningPtrArray<HBufC8>& aIds ); |
|
72 void GetFileL( const TDesC8& aId, RFile& aFile ); |
|
73 MBSElement* GetStructureL( TDesC8& aId ); |
|
74 void SetDefaultBrandIdL( const TDesC8& aBrandId ); |
|
75 |
|
76 |
|
77 TInt isBrandUpdateRequiredL (); |
|
78 |
|
79 private: // New methods |
|
80 |
|
81 MBSElement* ReadElementLC( const TDesC8& aId, TBool aForceDefault = EFalse ); |
|
82 |
|
83 MBSElement* ReadStreamL( const TDesC8& aId, |
|
84 RFileReadStream& aStream, |
|
85 TBool aAllowEmptyId = EFalse ); |
|
86 |
|
87 void VerifyVersionL(); |
|
88 void VerifyVersionL( RFileReadStream& aStream ); |
|
89 |
|
90 private: // data |
|
91 HBufC* iDefaultBrand; |
|
92 ///<File server session, owned |
|
93 RFs iFs; |
|
94 |
|
95 HBufC* iApplicationId; |
|
96 HBufC* iBrandId; |
|
97 HBufC* iDefaultBrandId; |
|
98 TLanguage iLanguage; |
|
99 |
|
100 TBool isDefaultBrandUsed; |
|
101 |
|
102 RFile* iHandle; |
|
103 |
|
104 CBSStorageManager* iStorageManager; |
|
105 |
|
106 // doesn't own: session |
|
107 CBSSession* iSession; |
|
108 TInt iReserved ; |
|
109 |
|
110 }; |
|
111 |
|
112 #endif // __CBSBRANDHANDLER_H__ |
|
113 |
|
114 |
|
115 // END OF FILE |
|
116 |