1 /* |
|
2 * Copyright (c) 2008 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: Brand handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _CVIMPSTUIBRANDDATA_H |
|
21 #define _CVIMPSTUIBRANDDATA_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <bamdesca.h> // MDesCArray |
|
26 #include <AknIconArray.h> |
|
27 #include <gulicon.h> |
|
28 #include <f32file.h> |
|
29 #include <fbs.h> |
|
30 |
|
31 //Forward Declarations |
|
32 class CBSFactory; |
|
33 class MBSAccess; |
|
34 class MVIMPSTEngine; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Brand handler |
|
41 * |
|
42 * @lib vimpstui.dll |
|
43 * @since 5.0 |
|
44 */ |
|
45 class CVIMPSTUiBrandData : public CBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * @param aAppId : application Id |
|
52 * @param aBrandId : Brand Id |
|
53 * @param aLanguageId : Language Id |
|
54 **/ |
|
55 static CVIMPSTUiBrandData* NewL(MVIMPSTEngine& aEngine); |
|
56 |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 **/ |
|
61 virtual ~CVIMPSTUiBrandData(); |
|
62 public: // New Functions |
|
63 |
|
64 /** |
|
65 * Loads necessary icons for this decorator |
|
66 * @return Icon array. Ownership is transferred. |
|
67 **/ |
|
68 CAknIconArray* LoadIconsLC( ); |
|
69 |
|
70 |
|
71 /** |
|
72 * Loads necessary icons for Own status decorator |
|
73 * @return Icon array. Ownership is transferred. |
|
74 **/ |
|
75 CAknIconArray* LoadOwnStatusIconsLC( ); |
|
76 /** |
|
77 * Gets you bitmaps to construct branded icons |
|
78 * @param aBitmap bitmap id to be fetched from Branding server |
|
79 * @param aMask bitmap id to be fetched from Branding server |
|
80 * @return error code. |
|
81 **/ |
|
82 TInt GetBrandBitmapsL(CFbsBitmap **aBitmap, CFbsBitmap **aMask); |
|
83 |
|
84 /** |
|
85 * helper function to check branding is supported or not |
|
86 **/ |
|
87 TBool IsBrandingSupported(); |
|
88 /** |
|
89 * Get the string, To be shown as terms of use befor login. |
|
90 * ownership is transfered |
|
91 * @return ToU String.If does not find then return NULL. |
|
92 **/ |
|
93 HBufC* GetToUStringL(); |
|
94 |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * Loads necessary icons for this decorator |
|
100 * @return Icon array. |
|
101 **/ |
|
102 CAknIconArray* LoadIconsL( ); |
|
103 |
|
104 /** |
|
105 * Loads brand icons for this decorator |
|
106 * @return Icon array. Ownership is transferred. |
|
107 **/ |
|
108 CAknIconArray* LoadBrandIconsL( ); |
|
109 |
|
110 |
|
111 |
|
112 /** |
|
113 * Loads brand icons for ownstatus |
|
114 * @return Icon array. Ownership is transferred. |
|
115 **/ |
|
116 CAknIconArray* LoadBrandOwnStatusIconsLC( ); |
|
117 |
|
118 |
|
119 |
|
120 /** |
|
121 * Loads default icons for ownstatus |
|
122 * @param aMbmFile Bitmap file |
|
123 * @return Icon array. Ownership is transferred. |
|
124 **/ |
|
125 CAknIconArray* LoadDefaultOwnStatusIconsLC(const TDesC& aMbmFile ); |
|
126 |
|
127 /** |
|
128 * constructs necessary icons for this decorator |
|
129 * @param aBitmapId bitmapId |
|
130 * @param aMaskId maskId |
|
131 * @param aFullPath Bitmap path |
|
132 * @return Icon. |
|
133 **/ |
|
134 CGulIcon* LoadDefaultBitmapL( TInt aBitmapId, |
|
135 TInt aMaskId, |
|
136 const TDesC& aFullPath ); |
|
137 |
|
138 /** |
|
139 * constructs branded icons for this decorator |
|
140 * @param aId id of the bitmap to be fetchec from the Branding server. |
|
141 * @return Icon. |
|
142 **/ |
|
143 CGulIcon* LoadBrandBitmapL( const TDesC8& aId ); |
|
144 |
|
145 |
|
146 private: |
|
147 |
|
148 /** |
|
149 * C++ default constructor. |
|
150 * @param aContacts Pointer to contacts-API |
|
151 */ |
|
152 CVIMPSTUiBrandData(); |
|
153 |
|
154 /** |
|
155 * By default Symbian OS constructor is private. |
|
156 */ |
|
157 void ConstructL(MVIMPSTEngine& aEngine); |
|
158 |
|
159 /** |
|
160 * Prepares branding access |
|
161 * @return KErrNone if sucessfull, else the Error. |
|
162 * @since S60 5.0 |
|
163 */ |
|
164 TInt PrepareBrandingAccess(); |
|
165 |
|
166 /** |
|
167 * get branded string. |
|
168 * @return Branded string |
|
169 * ownership is transfered |
|
170 * @since S60 5.0 |
|
171 */ |
|
172 HBufC* GetToUBrandedStringL(); |
|
173 |
|
174 /* |
|
175 * Concatenates the two descriptors. |
|
176 */ |
|
177 HBufC* ConcatLC( TDesC& aDesc1, TDesC& aDesc2 ); |
|
178 |
|
179 private: // Data |
|
180 |
|
181 // Not own. Settings id of the service.. |
|
182 const TDesC8& iAppId; |
|
183 |
|
184 // Not own. Settings id of the service.. |
|
185 HBufC8* iBrandId; |
|
186 |
|
187 // Not own. Settings id of the service.. |
|
188 TLanguage iLanguageId; |
|
189 |
|
190 //Owns, handle to brnadingfactory. |
|
191 CBSFactory* iBrandingFactory; |
|
192 |
|
193 //Owns, handle to brandaccessor |
|
194 MBSAccess* iBrandingAccess; |
|
195 |
|
196 //stores the default MBM path |
|
197 TFileName iDefaultMbmPath; |
|
198 // owns : list of availabe icons |
|
199 CAknIconArray* iIconsArray; |
|
200 |
|
201 }; |
|
202 |
|
203 #endif // _CVIMPSTUIBRANDDATA_H |
|
204 |
|
205 // End of File |
|