|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * WidgetManager configuration class |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef WMCONFIGURATION_H |
|
20 #define WMCONFIGURATION_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CRepository; |
|
27 class CWmResourceLoader; |
|
28 |
|
29 /** |
|
30 * Configuration class for Widget Manager |
|
31 * |
|
32 * @class CWmConfiguration |
|
33 */ |
|
34 NONSHARABLE_CLASS( CWmConfiguration ) : public CBase |
|
35 { |
|
36 |
|
37 public: // constructors and destructor |
|
38 |
|
39 /** Operator Application type */ |
|
40 enum TOpAppType |
|
41 { |
|
42 EUnknown, |
|
43 ES60, |
|
44 ECwrt, |
|
45 EWrt, |
|
46 EJava, |
|
47 EQt, |
|
48 EReserved |
|
49 }; |
|
50 |
|
51 /** Two-phased constructor. */ |
|
52 static CWmConfiguration* NewL( |
|
53 CWmResourceLoader& aResourceLoader ); |
|
54 |
|
55 /** Destructor */ |
|
56 virtual ~CWmConfiguration(); |
|
57 |
|
58 private: |
|
59 /** constructor */ |
|
60 CWmConfiguration( |
|
61 CWmResourceLoader& aResourceLoader ); |
|
62 |
|
63 /** 2nd phase constructor */ |
|
64 void ConstructL(); |
|
65 |
|
66 public: // API |
|
67 |
|
68 /** |
|
69 * Number of portal buttons (1 or more) |
|
70 */ |
|
71 TInt PortalButtonCount(); |
|
72 |
|
73 /** |
|
74 * Label text to be displayed on a portal button |
|
75 * @param aIndex index of the button, starting at 0 |
|
76 */ |
|
77 const TDesC& PortalButtonText( TInt aIndex ); |
|
78 |
|
79 /** |
|
80 * Icon to be displayed on a portal button |
|
81 * Logo syntax follows the widget icon syntax in CWmImageConverter |
|
82 * @param aIndex index of the button, starting at 0 |
|
83 */ |
|
84 const TDesC& PortalButtonIcon( TInt aIndex ); |
|
85 |
|
86 /** |
|
87 * Returns url to for browser by button index |
|
88 * @param aIndex index of the button, starting at 0 |
|
89 */ |
|
90 const TDesC& PortalButtonBrowserUrl( TInt aIndex ); |
|
91 |
|
92 /** |
|
93 * Returns client uid by button index |
|
94 * @param aIndex index of the button, starting at 0 |
|
95 */ |
|
96 TUid PortalButtonClientUid( TInt aIndex ); |
|
97 |
|
98 /** |
|
99 * Returns client parameter by button index |
|
100 * @param aIndex index of the button, starting at 0 |
|
101 */ |
|
102 const TDesC& PortalButtonClientParam( TInt aIndex ); |
|
103 |
|
104 /** |
|
105 * Returns bool if buttons are mirrored. |
|
106 * @return true when operator button on left on portraid and |
|
107 * on top on landscape. |
|
108 */ |
|
109 TBool PortalButtonsMirrored(); |
|
110 |
|
111 /** |
|
112 * Returns application type by button index |
|
113 * @param aIndex button index |
|
114 * @return application type |
|
115 */ |
|
116 TOpAppType PortalButtonApplicationType( TInt aIndex ); |
|
117 |
|
118 /** |
|
119 * Returns application id as string |
|
120 * @param aIndex button index |
|
121 * @param aOperatorAppId string to get app id |
|
122 */ |
|
123 void PortalButtonApplicationId( TInt aIndex, TDes& aOperatorAppId ); |
|
124 |
|
125 /** |
|
126 * Returns application id as uid |
|
127 * @param aIndex button index |
|
128 * @param aOperatorAppId uid to get app id |
|
129 */ |
|
130 void PortalButtonApplicationId( TInt aIndex, TUid& aOperatorAppId ); |
|
131 |
|
132 private: // New functions |
|
133 |
|
134 void LoadConfigurationL(); |
|
135 TInt FindCorrectLanguageId(); |
|
136 HBufC* ReadDescParameterL( TInt aKey ); |
|
137 void ReadInt32Parameter( TInt aKey, TInt32& aValue ); |
|
138 void ReadIntParameter( TInt aKey, TInt& aValue ); |
|
139 HBufC* ReadLocalisedParameterL( TInt aOffset ); |
|
140 void ReadOperatorApplicationInfoL(); |
|
141 TUid StringToUid( const TDesC& aStr ); |
|
142 |
|
143 /** Returns uid of the widget with a particular bundle identifier. */ |
|
144 TUid FetchWidgetUidFromRegistryL( const TDesC& aBundleId ); |
|
145 |
|
146 /** sets operator icon to button if not already defined */ |
|
147 void SetOperatorIconL( TUid aUid ); |
|
148 |
|
149 private: |
|
150 |
|
151 /** |
|
152 * the central repository |
|
153 */ |
|
154 CRepository* iRepository; |
|
155 |
|
156 /** |
|
157 * the resource loader |
|
158 */ |
|
159 CWmResourceLoader& iResourceLoader; |
|
160 |
|
161 /** |
|
162 * The index in cenrep that matches current |
|
163 * system language |
|
164 */ |
|
165 TInt iLanguageIndex; |
|
166 |
|
167 /** |
|
168 * OVI store button text |
|
169 */ |
|
170 HBufC* iOviButtonTitle; |
|
171 |
|
172 /** |
|
173 * OVI store button icon |
|
174 */ |
|
175 HBufC* iOviButtonIcon; |
|
176 |
|
177 /** |
|
178 * OVI store button widget client param |
|
179 */ |
|
180 HBufC* iOviStoreClientParam; |
|
181 |
|
182 /** |
|
183 * OVI store laucher uid |
|
184 */ |
|
185 TUid iOviStoreUid; |
|
186 |
|
187 /** |
|
188 * OPERATOR button text |
|
189 */ |
|
190 HBufC* iOperatorButtonTitle; |
|
191 |
|
192 /** |
|
193 * OPERATOR store icon |
|
194 */ |
|
195 HBufC* iOperatorButtonIcon; |
|
196 |
|
197 /** |
|
198 * OPERATOR store button browser Url |
|
199 */ |
|
200 HBufC* iOperatorButtonUrl; |
|
201 |
|
202 /** |
|
203 * OPERATOR store button application parameter |
|
204 */ |
|
205 HBufC* iOperatorParam; |
|
206 |
|
207 /** |
|
208 * OPERATOR store application id as string. Used for java |
|
209 */ |
|
210 HBufC* iOperatorAppIdStr; |
|
211 |
|
212 /** |
|
213 * OPERATOR store application id as uid. |
|
214 */ |
|
215 TUid iOperatorAppIdUid; |
|
216 |
|
217 /** |
|
218 * OPERATOR store application type |
|
219 */ |
|
220 TOpAppType iOperatorAppType; |
|
221 |
|
222 /** |
|
223 * Tells if operator button is enabled. |
|
224 */ |
|
225 TBool iOperatorButtonEnabled; |
|
226 |
|
227 /** |
|
228 * Tells if buttons need to be mirrored for operator. |
|
229 */ |
|
230 TBool iButtonsMirrored; |
|
231 }; |
|
232 |
|
233 #endif // WMCONFIGURATION_H |
|
234 |
|
235 // End of File |