|
1 /******************************************************************************* |
|
2 * Copyright (c) 2007, 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. This program and the accompanying materials |
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
|
5 * which accompanies this distribution, and is available at |
|
6 * http://www.eclipse.org/legal/epl-v10.html |
|
7 * |
|
8 * Contributors: |
|
9 * Nokia Corporation - S60 implementation |
|
10 *******************************************************************************/ |
|
11 |
|
12 |
|
13 #ifndef SWTLAFFACADE_H |
|
14 #define SWTLAFFACADE_H |
|
15 |
|
16 |
|
17 #include <AknUtils.h> |
|
18 |
|
19 /** |
|
20 * CSwtLafFacade |
|
21 * Class for providing layout-related functionality not found in S60 SDK for eSWT. |
|
22 * @lib eswtapifacade.dll |
|
23 */ |
|
24 class CSwtLafFacade |
|
25 : public CBase |
|
26 { |
|
27 public: |
|
28 |
|
29 // Default scroll span, thumb span and thumb position for ScrollBar. |
|
30 static const TInt KSwtDefaultScrollBarModelScrollSpan = 100; |
|
31 static const TInt KSwtDefaultScrollBarModelThumbSpan = 50; |
|
32 static const TInt KSwtDefaultScrollBarModelThumbposition = 0; |
|
33 |
|
34 // Layout information structure returned by GetChoiceListPaneLayout. |
|
35 struct TSwtLafFacadeWindowLineLayout |
|
36 { |
|
37 TInt16 iC; |
|
38 TInt16 il; |
|
39 TInt16 it; |
|
40 TInt16 ir; |
|
41 TInt16 ib; |
|
42 TInt16 iW; |
|
43 TInt16 iH; |
|
44 }; |
|
45 |
|
46 // Layout information structure returned by GetChoiceListPaneT1Layout. |
|
47 struct TSwtLafFacadeTextLineLayout |
|
48 { |
|
49 TInt16 iC; |
|
50 TInt16 il; |
|
51 TInt16 ir; |
|
52 TInt16 iB; |
|
53 TInt16 iW; |
|
54 TInt16 iJ; |
|
55 TInt32 iFont; |
|
56 }; |
|
57 |
|
58 // Component id's for GetLayoutRect. |
|
59 enum TSwtLafFacadeRectId |
|
60 { |
|
61 EUndefinedRectId, |
|
62 |
|
63 /** |
|
64 * main_eswt_pane(0): classic status pane |
|
65 * main_eswt_pane(1): small status pane |
|
66 * main_eswt_pane(2): no status pane |
|
67 * main_eswt_pane(3): full screen |
|
68 */ |
|
69 EMainEswtPane, |
|
70 |
|
71 EControlButtonPaneG2, |
|
72 EToolbarButtonPaneG2, |
|
73 EToolbarButtonPaneG5, |
|
74 EInputFieldSkinPlacingGeneralLine2, |
|
75 EInputFieldSkinPlacingGeneralLine5, |
|
76 EEswtControlPaneG1, |
|
77 EEswtControlPaneG2, |
|
78 EEswtControlPaneG3, |
|
79 EEswtControlPaneG4, |
|
80 EPopupWindowsSkinPlacingFrameGeneralLine2, |
|
81 EPopupWindowsSkinPlacingFrameGeneralLine5, |
|
82 EForm2MidpLabelPane, |
|
83 ESeparatorVerticalPane, |
|
84 ESeparatorVerticalPaneG1, |
|
85 ESeparatorVerticalPaneG2, |
|
86 ESeparatorVerticalPaneG3, |
|
87 ESeparatorHorizontalPane, |
|
88 ESeparatorHorizontalPaneG1, |
|
89 ESeparatorHorizontalPaneG2, |
|
90 ESeparatorHorizontalPaneG3, |
|
91 EListScrollGenPane, |
|
92 EListGenPane, |
|
93 EListSinglePane, |
|
94 EListSinglePaneG1, |
|
95 EListSinglePaneG1Cp2, |
|
96 EListSingleNumberPane, |
|
97 EListSingleNumberPaneG1, |
|
98 EListSingleGraphicH1Pane, |
|
99 EListSingleGraphicPane, |
|
100 EListSingleGraphicPaneG1, |
|
101 EListSingleGraphicPaneG2, |
|
102 EListSingleLargeGraphicPane, |
|
103 EListSingleLargeGraphicPaneG1, |
|
104 EListSingleLargeGraphicPaneG2, |
|
105 EListSingle2GraphicPaneG1Cp4, |
|
106 EListSingleHeadingPane, |
|
107 EListSingleHeadingPaneG1, |
|
108 EListSingle2HeadingMsgPane, |
|
109 EListSingle2HeadingMsgPaneG1, |
|
110 EListSingle2HeadingMsgPaneG2, |
|
111 EListSingleNumberHeadingPane, |
|
112 EListSingleNumberHeadingPaneG1, |
|
113 EListSingleGraphicHeadingPane, |
|
114 EListSingleGraphicHeadingPaneG1, |
|
115 EListSingleGraphicHeadingPaneG4, |
|
116 EListDoublePane, |
|
117 EListDoublePaneG1, |
|
118 EListDoubleNumberPane, |
|
119 EListDoubleNumberPaneG1, |
|
120 EListDoubleGraphicPane, |
|
121 EListDoubleGraphicPaneG1, |
|
122 EListDoubleGraphicPaneG2, |
|
123 EListDoubleLargeGraphicPane, |
|
124 EListDoubleLargeGraphicPaneG1, |
|
125 EListDoubleLargeGraphicPaneG2, |
|
126 EESwtCtrlWaitPane, |
|
127 EESwtCtrlWaitPaneH, |
|
128 EWaitBorderPaneG1, |
|
129 EWaitBorderPaneG2, |
|
130 EWaitBorderPaneG3, |
|
131 ECellEswtAppPane, |
|
132 ECellEswtAppPaneG1, |
|
133 ECellEswtAppPaneG2, |
|
134 EListHighlightSkinPlacingGeneralLine2, |
|
135 EListHighlightSkinPlacingGeneralLine5, |
|
136 EButtonValueAdjustPane, |
|
137 EButtonValueAdjustPaneG1, |
|
138 EButtonValueAdjustPaneG2, |
|
139 ESliderSetPaneCP3, |
|
140 ESliderSetPaneG1, |
|
141 ESliderSetPaneG2, |
|
142 EListSettingNumberPane, |
|
143 ESetValuePaneVC, |
|
144 ESetValuePane, |
|
145 EBgSetOptPane, |
|
146 EBgSetOptPaneG2, |
|
147 EBgSetOptPaneG5, |
|
148 EChildShellWithTitlePane, |
|
149 EChildShellWithoutTitlePane, |
|
150 EMenuItemPane, |
|
151 ESubMenuItemPane, |
|
152 |
|
153 /** |
|
154 * popup_eswt_tasktip_window(0): task tip bar + label |
|
155 * popup_eswt_tasktip_window(1): task tip bar or label only |
|
156 */ |
|
157 EPopupEswtTasktipWindow, |
|
158 |
|
159 /** |
|
160 * wait_bar_pane_cp71(0): progress bar in task tip bar + label |
|
161 * wait_bar_pane_cp71(1): progress bar in task tip bar or label only |
|
162 */ |
|
163 EWaitBarPaneCp71, |
|
164 |
|
165 EChildShellTitleImagePane, |
|
166 EFindPane, |
|
167 EPopupMidpNoteAlarmWindowG1, |
|
168 EPopupWindowGeneral, |
|
169 EHeadingPane, |
|
170 |
|
171 ECellHcAppPane, |
|
172 ECellHcAppPaneG1, |
|
173 ECellHcAppPaneG2, |
|
174 ECellAppPane, |
|
175 ECellAppPaneG1, |
|
176 ECellAppPaneG2, |
|
177 |
|
178 EAreaBottomPane, |
|
179 }; |
|
180 |
|
181 // Component id's for GetLayoutText. |
|
182 enum TSwtLafFacadeTextId |
|
183 { |
|
184 EUndefinedTextId, |
|
185 EListSinglePaneT1, |
|
186 EListSinglePaneT1Cp2, |
|
187 EListSingleGraphicPaneT1, |
|
188 EListSingleLargeGraphicPaneT1, |
|
189 EListSingleNumberPaneT1, |
|
190 EListSingleHeadingPaneT1, |
|
191 EListSingle2HeadingMsgPaneT1, |
|
192 EListSingleNumberHeadingPaneT1, |
|
193 EListSingleGraphicHeadingPaneT1, |
|
194 EListSinglePopupSubmenuPaneT1, |
|
195 EListDoublePaneT1, |
|
196 EListDoublePaneT2, |
|
197 EListDoubleGraphicPaneT1, |
|
198 EListDoubleGraphicPaneT2, |
|
199 EListDoubleNumberPaneT2, |
|
200 EListDoubleNumberPaneT3, |
|
201 EListDoubleLargeGraphicPaneT1, |
|
202 EListDoubleLargeGraphicPaneT2, |
|
203 ECellEswtAppPaneT1, |
|
204 EFormDataWideGraphicFieldTextsLine2, |
|
205 |
|
206 /** |
|
207 * popup_eswt_tasktip_window_t1(0): label in task tip bar + label |
|
208 * popup_eswt_tasktip_window_t1(1): label in task tip bar or label only |
|
209 */ |
|
210 EPopupEswtTasktipWindowT1, |
|
211 ETabs4ActivePaneT1, |
|
212 |
|
213 ECellHcAppPaneT1, |
|
214 ECellAppPaneT1, |
|
215 }; |
|
216 |
|
217 // Component id's for GetFondId. |
|
218 enum TSwtLafFacadeFontId |
|
219 { |
|
220 EUndefinedFontId, |
|
221 EForm2MidpLabelPaneT1Font, |
|
222 EFont2MidpTextPaneT1Font, |
|
223 EFont2MidpTimePaneT1Font, |
|
224 ECellEswtAppPaneT1Font, |
|
225 EListSingleGraphicPaneT1Font, |
|
226 |
|
227 ECellHcAppPaneT1Font, |
|
228 ECellAppPaneT1Font, |
|
229 }; |
|
230 |
|
231 enum TSwtComposeLayoutRectId |
|
232 { |
|
233 EUndefinedComposeLayoutId, |
|
234 EButtonValueAdjustPaneG1Compose, |
|
235 EButtonValueAdjustPaneG2Compose, |
|
236 EMainPaneCompose |
|
237 }; |
|
238 |
|
239 // Id's for GetConstant. |
|
240 enum TSwtLafFacadeConstantId |
|
241 { |
|
242 EBrowserFreeRam, |
|
243 EBrowserMemoryGood, |
|
244 EBrowserCRCommonFlags, |
|
245 EBrowserCRCdmaFlags, |
|
246 EMIDletSuiteAPNNotSpecified, |
|
247 EJavaDefaultAPNKey, |
|
248 EJavaAPNRepositoryUid, |
|
249 EBrowserConnectionDialogs, |
|
250 EBrowserNGPopupBlocking, |
|
251 EBrowserFormDataSaving, |
|
252 EBrowserMultipleWindows, |
|
253 EBrowserGraphicalPage, |
|
254 EBrowserGraphicalHistory, |
|
255 EBrowserAutoFormFill, |
|
256 EBrowserAccessKeys, |
|
257 ESwtAknExplicitStartupEffectCompletion, // CAknAppUiBase::EAknExplicitStartupEffectCompletion |
|
258 ESwtBrowserGenericParamURL, // TGenericParamIdValue::EGenericParamURL |
|
259 ESwtBrowserGenericParamMIMEType, // TGenericParamIdValue::EGenericParamMIMEType |
|
260 ESwtBrowserGenericParamCharSet, // TGenericParamIdValue::EGenericParamCharSet |
|
261 ESwtBrowserGenericParamAccessPoint, // TGenericParamIdValue::EGenericParamAccessPoint |
|
262 ESwtBrowserGenericParamReferringURI, // TGenericParamIdValue::EGenericParamReferringURI |
|
263 ESwtBrowserGenericParamAllowSave, // TGenericParamIdValue::EGenericParamAllowSave |
|
264 ESwtBrowserGenericParamAllowMove // TGenericParamIdValue::EGenericParamAllowMove |
|
265 }; |
|
266 |
|
267 public: |
|
268 /** |
|
269 * Get layout rectangle for given component id. |
|
270 * |
|
271 * @param aRectId Id of the component. |
|
272 * @param aParentRect Parent rectangle. |
|
273 * @param aArg1 Optional argument for the internal function. |
|
274 * @param aArg2 Optional argument for the internal function. |
|
275 * @param aArg3 Optional argument for the internal function. |
|
276 * @return Layout rectangle for the component. |
|
277 */ |
|
278 IMPORT_C static TAknLayoutRect GetLayoutRect( |
|
279 TSwtLafFacadeRectId aRectId, const TRect& aParentRect, |
|
280 TInt aArg1 = 0, TInt aArg2 = 0, TInt aArg3 = 0); |
|
281 |
|
282 /** |
|
283 * Get layout rectangle for given component id. This version composes the |
|
284 * rectangle and returns the resulting rectangle. |
|
285 * |
|
286 * @param aRectId Id of the component. |
|
287 * @param aParentRect Parent rectangle. |
|
288 * @param aArg1 Optional argument for the internal function. |
|
289 * @param aArg2 Optional argument for the internal function. |
|
290 * @param aArg3 Optional argument for the internal function. |
|
291 * @return Layout rectangle for the component. |
|
292 */ |
|
293 IMPORT_C static TAknLayoutRect GetComposeAndLayoutRect( |
|
294 TSwtComposeLayoutRectId aRectId, const TRect& aParentRect, |
|
295 TInt aArg1 = 0, TInt aArg2 = 0, TInt aArg3 = 0); |
|
296 |
|
297 /** |
|
298 * Get layout text rectangle for given component id. |
|
299 * |
|
300 * @param aTextId Id of the component. |
|
301 * @param aParentRect Parent rectangle. |
|
302 * @param aArg1 Optional argument for the internal function. |
|
303 * @return Layout rectangle for the component. |
|
304 */ |
|
305 IMPORT_C static TAknLayoutText GetLayoutText( |
|
306 TSwtLafFacadeTextId aTextId, const TRect& aParentRect, |
|
307 TInt aArg1 = 0); |
|
308 |
|
309 /** |
|
310 * Get layout font id for given component id. |
|
311 * |
|
312 * @param aFontId Id of the component. |
|
313 * @param aArg1 Optional argument for the internal function. |
|
314 * @param aArg2 Optional argument for the internal function. |
|
315 * @return System font id for the component. |
|
316 */ |
|
317 IMPORT_C static TInt GetFontId(TSwtLafFacadeFontId aFontId, |
|
318 TInt aArg1 = 0, TInt aArg2 = 0); |
|
319 |
|
320 /** |
|
321 * Get choice list pane layout information. |
|
322 * |
|
323 * @return Layout information. |
|
324 */ |
|
325 IMPORT_C static TSwtLafFacadeWindowLineLayout GetChoiceListPaneLayout(); |
|
326 |
|
327 /** |
|
328 * Get choice list pane text layout information. |
|
329 * |
|
330 * @return Layout information. |
|
331 */ |
|
332 IMPORT_C static TSwtLafFacadeTextLineLayout GetChoiceListPaneT1Layout(); |
|
333 |
|
334 /** |
|
335 * Get screen orientation. |
|
336 * |
|
337 * @return ETrue if landscape, EFalse otherwise. |
|
338 */ |
|
339 IMPORT_C static TBool IsLandscapeOrientation(); |
|
340 |
|
341 /** |
|
342 * Get java apnid. |
|
343 * |
|
344 * @return apnid. |
|
345 */ |
|
346 IMPORT_C static TUint32 JavaAPNL(TUint32 aAppId); |
|
347 |
|
348 /** |
|
349 * Window layout line |
|
350 */ |
|
351 IMPORT_C static TSwtLafFacadeWindowLineLayout WindowLineLayout( |
|
352 TSwtLafFacadeRectId aRectId, TInt aVariety = 0); |
|
353 |
|
354 /** |
|
355 * Text layout line |
|
356 */ |
|
357 IMPORT_C static TSwtLafFacadeTextLineLayout TextLineLayout( |
|
358 TSwtLafFacadeTextId aTextId, TInt aVariety = 0); |
|
359 |
|
360 /** |
|
361 * Get constant for given id. |
|
362 * |
|
363 * @param aConstantId eSwt defined id for a specific constant |
|
364 * @return contant for given id. |
|
365 */ |
|
366 IMPORT_C static TInt GetConstant(TSwtLafFacadeConstantId aConstantId); |
|
367 |
|
368 /** |
|
369 * Get TUint constant for given id. |
|
370 * |
|
371 * @param aConstantId eSwt defined id for a specific constant |
|
372 * @return TUint contant for given id. |
|
373 */ |
|
374 IMPORT_C static TUint GetUintConstant(TSwtLafFacadeConstantId aConstantId); |
|
375 |
|
376 /** |
|
377 * Gets Enumerator for mobile device flip status. |
|
378 */ |
|
379 IMPORT_C static TInt GetFlipWatchEnumerationStatus(); |
|
380 |
|
381 /** |
|
382 * Gets flip status for Mobile Device. |
|
383 */ |
|
384 IMPORT_C static TUint32 GetFlipWatchStatus(); |
|
385 |
|
386 /** |
|
387 * Gets UID for Flip Watch. |
|
388 */ |
|
389 IMPORT_C static TUid GetFlipWatchUid(); |
|
390 |
|
391 /** |
|
392 * Gets the current or cashe language for TextExtension. |
|
393 */ |
|
394 IMPORT_C static TLanguage GetLanguage(); |
|
395 |
|
396 /** |
|
397 * Initialize feature manager. |
|
398 * |
|
399 */ |
|
400 IMPORT_C static void InitFeatureManagerL(); |
|
401 |
|
402 /** |
|
403 * Uninitialize feature manager. |
|
404 * |
|
405 */ |
|
406 IMPORT_C static void UnInitFetureManager(); |
|
407 |
|
408 /** |
|
409 * Fetches information whether a certain feature is supported. |
|
410 * |
|
411 * @param aFeature feature ID |
|
412 * @return feature support status |
|
413 */ |
|
414 IMPORT_C static TBool FeatureSupported(TInt aFeature); |
|
415 |
|
416 /** |
|
417 * Sets inputCapability for password text. |
|
418 * |
|
419 * @param aCapabilities InputCapability of text |
|
420 */ |
|
421 IMPORT_C static void SetPasswordCapability(TCoeInputCapabilities aInputCapabilities); |
|
422 |
|
423 /** |
|
424 * Signals the transition effects engine for the second phase of the |
|
425 * full screen transition. |
|
426 */ |
|
427 IMPORT_C static void SignalFullScreenTransitionReady(); |
|
428 |
|
429 private: |
|
430 // Private constructors to prevent the facade class from being instantiated |
|
431 CSwtLafFacade(); |
|
432 CSwtLafFacade(const CSwtLafFacade&); |
|
433 ~CSwtLafFacade(); |
|
434 }; |
|
435 |
|
436 #endif // SWTLAFFACADE_H |