|
1 /* |
|
2 * Copyright (c) 2007-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: Compatibility mode keyboard UI component |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __AKNCOMPAKB_H__ |
|
20 #define __AKNCOMPAKB_H__ |
|
21 |
|
22 #include <AknControl.h> |
|
23 |
|
24 #include "akncompautils.h" |
|
25 #include "akncompasrvclient.h" |
|
26 #include "akncompabutton.h" |
|
27 |
|
28 class CAknCompaSide; |
|
29 class CAknsBasicBackgroundControlContext; |
|
30 class TAknWindowComponentLayout; |
|
31 class TAknLayoutScalableParameterLimits; |
|
32 class CRepository; |
|
33 |
|
34 /** |
|
35 * Compatibility mode keyboard component. |
|
36 * |
|
37 * The component is used by CAknAppUiBase to present a keyboard |
|
38 * for compatibility mode application. |
|
39 * |
|
40 * @lib compamode.lib |
|
41 * @since S60 v5.0 |
|
42 */ |
|
43 NONSHARABLE_CLASS(CAknCompaKb) : public CAknControl, |
|
44 public MCoeForegroundObserver |
|
45 { |
|
46 enum |
|
47 { |
|
48 EButtonsGranularity = 24, |
|
49 }; |
|
50 |
|
51 public: // constructors and destructor |
|
52 |
|
53 static CAknCompaKb* NewL(TInt aCompaScreenMode, TBool aMakeVisible); |
|
54 |
|
55 ~CAknCompaKb(); |
|
56 |
|
57 public: // new functions |
|
58 |
|
59 void SimulateKeyPressL(TInt aScanCode, TBool aDown); |
|
60 |
|
61 void SetPenButtonUpL(); |
|
62 |
|
63 void SetButtonsUpL(); |
|
64 |
|
65 TBool IsForeground(); |
|
66 |
|
67 void DisaTransEffects(bool aDisable); |
|
68 |
|
69 private: // new functions |
|
70 |
|
71 CAknCompaKb(TInt aCompaScreenMode); |
|
72 |
|
73 void ConstructL(TBool aMakeVisible); |
|
74 |
|
75 void SkinChanged(); |
|
76 |
|
77 TRect RectFromLayout(const TRect& aParent, |
|
78 const TAknWindowComponentLayout& aComponentLayout); |
|
79 |
|
80 void LayoutControl(); |
|
81 |
|
82 void LayoutButtonControls(); |
|
83 |
|
84 void LayoutButtonGrid(TRect aParentRect, TInt& aButtonCount, |
|
85 TInt aRows, TInt aColumns); |
|
86 |
|
87 void SetSkinBackground(); |
|
88 |
|
89 TBool InCompaScreenMode(); |
|
90 private: // from CCoeControl |
|
91 |
|
92 TInt CountComponentControls() const; |
|
93 |
|
94 CCoeControl* ComponentControl(TInt aIndex) const; |
|
95 |
|
96 void Draw(const TRect& aRect) const; |
|
97 |
|
98 void HandleResourceChange(TInt aType); |
|
99 |
|
100 void ActivateL(); |
|
101 |
|
102 void MakeVisible(TBool aVisible); |
|
103 |
|
104 private: // from MCoeForegroundObserver |
|
105 |
|
106 void HandleGainingForeground(); |
|
107 void HandleLosingForeground(); |
|
108 |
|
109 private: // data |
|
110 |
|
111 TRgb iSkinColor; |
|
112 CFbsBitGc* iBitGc; |
|
113 |
|
114 CFbsBitmapDevice* iBitmapDevice; |
|
115 |
|
116 TRect iCompaRect; |
|
117 |
|
118 // Background bitmap, owned |
|
119 CFbsBitmap* iSkinBmp; |
|
120 |
|
121 // Background context |
|
122 CAknsBasicBackgroundControlContext* iBgContext; |
|
123 |
|
124 TInt iCompaScreenMode; |
|
125 TInt iRockerGridSize; |
|
126 // Button controls. Owned |
|
127 RPointerArray<CAknCompaButton> iButtons; |
|
128 TInt iPenButtonIndex; // button array index of pen button |
|
129 |
|
130 // Controls to fill sides of compa-mode window |
|
131 CAknCompaSide* iLeftSide; |
|
132 CAknCompaSide* iRightSide; |
|
133 |
|
134 RAknCompaSrvSession iCompaSrvSession; |
|
135 |
|
136 CRepository* iThemesCenRep; // repository controlling transition effects |
|
137 struct |
|
138 { |
|
139 bool iInEikSrv:1; // running in eikon server |
|
140 bool iInAknCapSrv:1; // running in AknCap server |
|
141 bool iInGlobalUiSrv:1; // running in akncapserver/aknnfysrv/eiksrv |
|
142 bool iLayoutDone:1; // control size/position has been set |
|
143 bool iEffectsDisa:1; // transition effects are disabled |
|
144 bool iForeground:1; // application is foreground |
|
145 } iFlags; |
|
146 }; |
|
147 |
|
148 #endif // __AKNCOMPAKB_H__ |