31
|
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 the License "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: cbsaccess.h
|
|
13 |
*
|
|
14 |
* Description: cbsaccess.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef __CBSACCESS_H__
|
|
21 |
#define __CBSACCESS_H__
|
|
22 |
#include <e32std.h>
|
|
23 |
#include "mbsaccess.h"
|
|
24 |
#include "cbsclient.h"
|
|
25 |
|
|
26 |
|
|
27 |
// Forward declarations
|
|
28 |
class CFbsBitmap;
|
|
29 |
|
|
30 |
/**
|
|
31 |
*
|
|
32 |
*/
|
|
33 |
NONSHARABLE_CLASS( CBSAccess ): public CBase,
|
|
34 |
public MBSAccess
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
/**
|
|
38 |
* Two-phased constructor.
|
|
39 |
*/
|
|
40 |
static CBSAccess* NewL( const TDesC8& aBrandId,
|
|
41 |
const TDesC8& aAppId,
|
|
42 |
const TDesC8& aDefaultBrandId,
|
|
43 |
TLanguage aLanguageId,
|
|
44 |
TBool aCacheData,
|
|
45 |
TInt aReserved = 0 );
|
|
46 |
|
|
47 |
// destructor
|
|
48 |
virtual ~CBSAccess();
|
|
49 |
|
|
50 |
/*
|
|
51 |
* Close
|
|
52 |
*/
|
|
53 |
void Close();
|
|
54 |
|
|
55 |
private:
|
|
56 |
|
|
57 |
void ConstructL( const TDesC8& aBrandId,
|
|
58 |
const TDesC8& aAppId,
|
|
59 |
const TDesC8& aDefaultBrandId );
|
|
60 |
CBSAccess( TLanguage aLanguageId, TBool aCacheData, TInt aReserved = 0);
|
|
61 |
|
|
62 |
|
|
63 |
private: // from MBranding
|
|
64 |
|
|
65 |
/*
|
|
66 |
* Get text type item
|
|
67 |
* @param aId ID of the item
|
|
68 |
* @return the text item
|
|
69 |
*/
|
|
70 |
HBufC* GetTextL( const TDesC8& aId );
|
|
71 |
|
|
72 |
/*
|
|
73 |
* Get text type item
|
|
74 |
* @param aId ID of the item
|
|
75 |
* @return the text item
|
|
76 |
*/
|
|
77 |
HBufC* GetTextLC( const TDesC8& aId );
|
|
78 |
|
|
79 |
/*
|
|
80 |
* Get 8-bit data type item
|
|
81 |
* @param aId ID of the item
|
|
82 |
* @return the data buffer item
|
|
83 |
*/
|
|
84 |
HBufC8* GetBufferL( const TDesC8& aId );
|
|
85 |
|
|
86 |
/*
|
|
87 |
* Get 8-bit data type item
|
|
88 |
* @param aId ID of the item
|
|
89 |
* @return the data buffer item
|
|
90 |
*/
|
|
91 |
HBufC8* GetBufferLC( const TDesC8& aId );
|
|
92 |
|
|
93 |
/*
|
|
94 |
* Get integer type item
|
|
95 |
* @param aId ID of the item
|
|
96 |
* @return the integer item
|
|
97 |
*/
|
|
98 |
TInt GetIntL( const TDesC8& aId );
|
|
99 |
|
|
100 |
|
|
101 |
/*
|
|
102 |
* Get an array of items
|
|
103 |
* @param aIds ID's of the items
|
|
104 |
* @return the items
|
|
105 |
*/
|
|
106 |
MBSElement* GetSeveralL( MDesC8Array& aIds );
|
|
107 |
|
|
108 |
/*
|
|
109 |
* Get a file item
|
|
110 |
* @param aId ID of the item
|
|
111 |
* @param aFile on return will contain an open file handle
|
|
112 |
* to the file
|
|
113 |
*/
|
|
114 |
void GetFileL( const TDesC8& aId, RFile& aFile );
|
|
115 |
|
|
116 |
/*
|
|
117 |
* Get a structure type item
|
|
118 |
* @param aIds ID of the item
|
|
119 |
* @param aFile on return will contain the strucure type item
|
|
120 |
* @return structure branding element
|
|
121 |
*/
|
|
122 |
MBSElement* GetStructureL( const TDesC8& aId );
|
|
123 |
|
|
124 |
/*
|
|
125 |
* Register to observer brand data updates
|
|
126 |
* @param aObserver the observer interface
|
|
127 |
*/
|
|
128 |
void RegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver );
|
|
129 |
|
|
130 |
/*
|
|
131 |
* Unregister a brand data update observer
|
|
132 |
* @param aObserver the observer interface
|
|
133 |
*/
|
|
134 |
void UnRegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver);
|
|
135 |
|
|
136 |
/*
|
|
137 |
* Get a bitmap type item
|
|
138 |
* @param aBitmapId the ID of the bitmap item itself
|
|
139 |
* @param aBitmap on return will contain the bitmap
|
|
140 |
* @param aMask on return will contain the mask
|
|
141 |
*/
|
|
142 |
void GetBitmapL( const TDesC8& aBitmapId,
|
|
143 |
CFbsBitmap*& aBitmap,
|
|
144 |
CFbsBitmap*& aMask );
|
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
TInt isBrandUpdateRequiredL ();
|
|
149 |
|
|
150 |
|
|
151 |
public: // New methods
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
private: // data
|
|
156 |
HBufC8* iBrand;
|
|
157 |
HBufC8* iDefaultBrand;
|
|
158 |
HBufC8* iAppId;
|
|
159 |
TLanguage iLanguageId;
|
|
160 |
TBool iUseCache;
|
|
161 |
RBSClient iClient;
|
|
162 |
TInt iReserved;
|
|
163 |
};
|
|
164 |
|
|
165 |
#endif // __CBSACCESS_H__
|
|
166 |
|
|
167 |
|
|
168 |
// END OF FILE
|
|
169 |
|