|
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 status icons handler |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CSERVICEWIDGETBRANDHANDLER_H |
|
22 #define CSERVICEWIDGETBRANDHANDLER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <gulicon.h> |
|
26 #include "servicewidgetenums.hrh" |
|
27 |
|
28 // farword declarations |
|
29 //Forward Declarations |
|
30 class CBSFactory; |
|
31 class MBSAccess; |
|
32 class CSPSettings; |
|
33 /** |
|
34 * TODO : Temp solution until homescreenfw support the bitmap and mask publishing |
|
35 * @since 5.0 |
|
36 */ |
|
37 |
|
38 // class defnitions |
|
39 class CServiceWidgetBrandHandler : public CBase |
|
40 { |
|
41 |
|
42 friend class Cservicewidgetdatapublisher_ut; |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CServiceWidgetBrandHandler* NewL(TInt aServiceId ); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 */ |
|
54 static CServiceWidgetBrandHandler* NewLC(TInt aServiceId ); |
|
55 |
|
56 /** |
|
57 * Standard C++ destructor |
|
58 */ |
|
59 ~CServiceWidgetBrandHandler(); |
|
60 |
|
61 public: |
|
62 |
|
63 |
|
64 /** |
|
65 * @return bitmap path for status icons |
|
66 */ |
|
67 void GetStatusBitmapL(TWSPresenceStatus aIndex, TInt& aBitmapHandle, TInt& aMaskHandle); |
|
68 |
|
69 |
|
70 private: // Implementation |
|
71 |
|
72 /** |
|
73 * Standard C++ constructor |
|
74 */ |
|
75 CServiceWidgetBrandHandler(TInt aServiceId ); |
|
76 |
|
77 /** |
|
78 * Load the bitmaps from branding server |
|
79 * @since S60 5.0 |
|
80 */ |
|
81 void LoadBrandingBitmapsL() ; |
|
82 |
|
83 /** |
|
84 * Load the bitmaps from branding server |
|
85 * @return CGulIcon if sucessfull, else the Null. |
|
86 * @param aIndex - index of the TWSPresenceStatus enum |
|
87 * @since S60 5.0 |
|
88 */ |
|
89 CGulIcon* LoadBitmapL(TInt aIndex) ; |
|
90 |
|
91 /** |
|
92 * Performs the 2nd phase of construction. |
|
93 * @param aServiceName, service name |
|
94 */ |
|
95 void ConstructL(); |
|
96 |
|
97 /** |
|
98 * Prepares branding access |
|
99 * @return KErrNone if sucessfull, else the Error. |
|
100 * @since S60 5.0 |
|
101 */ |
|
102 TInt PrepareBrandingAccess(); |
|
103 |
|
104 /** |
|
105 * get the brand info from settings |
|
106 * @return KErrNone if sucessfull, else the Error. |
|
107 * @since S60 5.0 |
|
108 */ |
|
109 TInt GetBrandInfoL(TLanguage& aBrandLanguage, |
|
110 TInt &aBrandVersion, TDes8& aBrandId); |
|
111 |
|
112 |
|
113 private: // Data |
|
114 |
|
115 // Not own. Settings id of the service.. |
|
116 const TDesC8& iAppId; |
|
117 |
|
118 // Not own. Settings id of the service.. |
|
119 HBufC8* iBrandId; |
|
120 |
|
121 // Not own. Settings id of the service.. |
|
122 TLanguage iLanguageId; |
|
123 |
|
124 //Owns, handle to brnadingfactory. |
|
125 CBSFactory* iBrandingFactory; |
|
126 |
|
127 //Owns, handle to brandaccessor |
|
128 MBSAccess* iBrandingAccess; |
|
129 |
|
130 // owns : service id |
|
131 TInt iServiceId; |
|
132 |
|
133 RPointerArray <CGulIcon> iBrandIcons; |
|
134 }; |
|
135 |
|
136 #endif /*CSERVICEWIDGETBRANDHANDLER_H*/ |