62 |
64 |
63 /** 2nd phase constructor */ |
65 /** 2nd phase constructor */ |
64 void ConstructL(); |
66 void ConstructL(); |
65 |
67 |
66 public: // API |
68 public: // API |
67 |
69 |
68 /** |
70 /** |
69 * Number of portal buttons (1 or more) |
71 * Number of Stores |
70 */ |
72 */ |
71 TInt PortalButtonCount(); |
73 TInt StoreCount(); |
72 |
74 |
73 /** |
75 /** |
74 * Label text to be displayed on a portal button |
76 * Returns Store configuration array ref |
75 * @param aIndex index of the button, starting at 0 |
77 */ |
76 */ |
78 const RPointerArray<CWmConfItem>& StoreConfArray(); |
77 const TDesC& PortalButtonText( TInt aIndex ); |
79 |
78 |
80 /** |
79 /** |
81 * To compare orders |
80 * Icon to be displayed on a portal button |
82 */ |
81 * Logo syntax follows the widget icon syntax in CWmImageConverter |
83 static TInt CompareStoreOrder( |
82 * @param aIndex index of the button, starting at 0 |
84 const CWmConfItem& aItemOne, const CWmConfItem& aItemTwo ); |
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 |
85 |
132 private: // New functions |
86 private: // New functions |
133 |
87 |
134 void LoadConfigurationL(); |
88 void LoadConfigurationL(); |
135 TInt FindCorrectLanguageId(); |
89 TInt FindCorrectLanguageId(); |
136 HBufC* ReadDescParameterL( TInt aKey ); |
90 HBufC* ReadDescParameterL( TInt aKey ); |
137 void ReadInt32Parameter( TInt aKey, TInt32& aValue ); |
91 void ReadInt32Parameter( TInt aKey, TInt32& aValue ); |
138 void ReadIntParameter( TInt aKey, TInt& aValue ); |
92 void ReadIntParameter( TInt aKey, TInt& aValue ); |
139 HBufC* ReadLocalisedParameterL( TInt aOffset ); |
93 HBufC* ReadLocalisedParameterL( TInt aOffset ); |
140 void ReadOperatorApplicationInfoL(); |
94 void ReadApplicationInfoL( TInt aKey, CWmConfItem& aConfItem ); |
141 TUid StringToUid( const TDesC& aStr ); |
95 TUid StringToUid( const TDesC& aStr ); |
142 |
96 |
143 /** Returns uid of the widget with a particular bundle identifier. */ |
97 /** Returns uid of the widget with a particular bundle identifier. */ |
144 TUid FetchWidgetUidFromRegistryL( const TDesC& aBundleId ); |
98 TUid FetchWidgetUidFromRegistryL( const TDesC& aBundleId ); |
145 |
99 |
146 /** sets operator icon to button if not already defined */ |
100 /** sets Store icon to if not already defined */ |
147 void SetOperatorIconL( TUid aUid ); |
101 void SetStoreIconL( CWmConfItem& aConfItem ); |
148 |
102 |
149 private: |
103 private: |
150 |
104 |
151 /** |
105 /** |
152 * the central repository |
106 * the central repository |
153 */ |
107 */ |
161 /** |
115 /** |
162 * The index in cenrep that matches current |
116 * The index in cenrep that matches current |
163 * system language |
117 * system language |
164 */ |
118 */ |
165 TInt iLanguageIndex; |
119 TInt iLanguageIndex; |
166 |
120 |
167 /** |
121 /** |
168 * OVI store button text |
122 * Array of configuration items. Array is in order as they should appear in UI |
169 */ |
123 */ |
170 HBufC* iOviButtonTitle; |
124 RPointerArray<CWmConfItem> iConfItems; |
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 }; |
125 }; |
232 |
126 |
|
127 |
|
128 /** |
|
129 * Configuration item class for Widget Manager |
|
130 * |
|
131 * @class CWmConfiguration |
|
132 */ |
|
133 NONSHARABLE_CLASS( CWmConfItem ) : public CBase |
|
134 { |
|
135 public: // constructors and destructor |
|
136 |
|
137 /** Two-phased constructors. */ |
|
138 static CWmConfItem* NewL(); |
|
139 |
|
140 static CWmConfItem* NewLC(); |
|
141 |
|
142 /** Destructor */ |
|
143 ~CWmConfItem(); |
|
144 |
|
145 private: |
|
146 /** constructor */ |
|
147 CWmConfItem(); |
|
148 |
|
149 /** 2nd phase constructor */ |
|
150 void ConstructL(); |
|
151 |
|
152 public: // API |
|
153 /** |
|
154 * Returns Store id |
|
155 */ |
|
156 CWmStore::TStoreId Id(); |
|
157 |
|
158 /** |
|
159 * Returns Label text to be displayed on a Store |
|
160 */ |
|
161 const TDesC& Title(); |
|
162 |
|
163 /** |
|
164 * Returns Icon to be displayed on a Store |
|
165 * Logo syntax follows the widget icon syntax in CWmImageConverter |
|
166 */ |
|
167 const TDesC& Icon(); |
|
168 |
|
169 /** |
|
170 * Returns Order of Store |
|
171 */ |
|
172 TInt Order(); |
|
173 |
|
174 /** |
|
175 * Returns url to for browser |
|
176 */ |
|
177 const TDesC& BrowserUrl(); |
|
178 |
|
179 /** |
|
180 * Returns application type |
|
181 */ |
|
182 CWmConfiguration::TStoreAppType AppType(); |
|
183 |
|
184 /** |
|
185 * Returns application uid |
|
186 */ |
|
187 TUid AppUid(); |
|
188 |
|
189 /** |
|
190 * Returns application parameter by index |
|
191 */ |
|
192 const TDesC& AppParam(); |
|
193 |
|
194 private: |
|
195 /** |
|
196 * Store Id |
|
197 */ |
|
198 CWmStore::TStoreId iId; |
|
199 |
|
200 /** |
|
201 * Store text |
|
202 */ |
|
203 HBufC* iTitle; |
|
204 |
|
205 /** |
|
206 * Store icon |
|
207 */ |
|
208 HBufC* iIcon; |
|
209 |
|
210 /** |
|
211 * Store order |
|
212 */ |
|
213 TInt iOrder; |
|
214 |
|
215 /** |
|
216 * Store browser Url |
|
217 */ |
|
218 HBufC* iUrl; |
|
219 |
|
220 /** |
|
221 * Application type |
|
222 */ |
|
223 CWmConfiguration::TStoreAppType iAppType; |
|
224 |
|
225 /** |
|
226 * Application uid |
|
227 */ |
|
228 TUid iAppUid; |
|
229 |
|
230 /** |
|
231 * Application parameter |
|
232 */ |
|
233 HBufC* iAppParam; |
|
234 |
|
235 friend class CWmConfiguration; |
|
236 }; |
233 #endif // WMCONFIGURATION_H |
237 #endif // WMCONFIGURATION_H |
234 |
238 |
235 // End of File |
239 // End of File |