|
1 /* |
|
2 * Copyright (c) 2005-2005 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: header file of control group and button group |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CBUBBLECTRL_H |
|
19 #define C_CBUBBLECTRL_H |
|
20 |
|
21 #include <peninputlayoutbasecontrol.h> |
|
22 #include <AknsConstants.h> |
|
23 #include <AknsItemID.h> |
|
24 #include <AknLayout2Def.h> |
|
25 |
|
26 class CBubbleCtrl: public CFepUiBaseCtrl |
|
27 { |
|
28 public: |
|
29 //constructor and destructor |
|
30 /** |
|
31 * Destructor. |
|
32 * |
|
33 * @since S60 V4.0 |
|
34 */ |
|
35 IMPORT_C virtual ~CBubbleCtrl(); |
|
36 |
|
37 /** |
|
38 * Factory function. |
|
39 * |
|
40 * @since S60 V4.0 |
|
41 * @param aRect The rectangle area for this control |
|
42 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
43 * @param aControlId control Id |
|
44 * @return An instance of CButtonBase class |
|
45 */ |
|
46 IMPORT_C static CBubbleCtrl* NewL(const TRect& aRect, |
|
47 CFepUiLayout* aUiLayout, |
|
48 TInt aCtrlId); |
|
49 |
|
50 IMPORT_C virtual void Draw(); |
|
51 |
|
52 IMPORT_C virtual void Hide(TBool aShowFlag); |
|
53 |
|
54 IMPORT_C void SetBitmapParam(CFbsBitmap* aBmpId, |
|
55 CFbsBitmap* aMaskBmpId, |
|
56 TAknsItemID aBgSkinId); |
|
57 IMPORT_C void SetBitmapParam(CFbsBitmap* aBmpId, |
|
58 CFbsBitmap* aMaskBmpId, |
|
59 TAknsItemID aFirstBmpId, |
|
60 TAknsItemID aMiddleBmpId, |
|
61 TAknsItemID aLastBmpId); |
|
62 /** |
|
63 * Set text line layout |
|
64 * |
|
65 * @since S60 V4.0 |
|
66 * @param aTextFormat Text line layout to be set |
|
67 * @return None |
|
68 */ |
|
69 IMPORT_C void SetTextFormat(TAknTextLineLayout aTextFormat); |
|
70 |
|
71 /** |
|
72 * Set text to be shown on button |
|
73 * |
|
74 * @since S60 V4.0 |
|
75 * @param aText Text to be shown on button |
|
76 * @return None |
|
77 */ |
|
78 IMPORT_C void SetTextL(const TDesC& aText); |
|
79 |
|
80 IMPORT_C void Popup(const TRect& aRect); |
|
81 |
|
82 IMPORT_C void Close(); |
|
83 |
|
84 IMPORT_C TBool IsShowing(); |
|
85 |
|
86 IMPORT_C void SetFrameDiff(TInt aLeftDiff,TInt aTopDiff,TInt aRightDiff,TInt aBottomDiff); |
|
87 |
|
88 void Freeze(); |
|
89 |
|
90 void UnFreeze( TBool aUpdate = ETrue ); |
|
91 inline void SetTextColorIndex( TInt aTxtClrIndex ); |
|
92 inline TInt TextColorIndex() const; |
|
93 protected: |
|
94 IMPORT_C CBubbleCtrl(const TRect& aRect, |
|
95 CFepUiLayout* aUiLayout, |
|
96 TInt aCtrlId); |
|
97 |
|
98 IMPORT_C void ConstructL(TInt aBmpId, TInt aMaskId); |
|
99 |
|
100 private: |
|
101 CFbsBitmap* iForgroundBmp; |
|
102 CFbsBitmap* iForgroundBmpMask; |
|
103 |
|
104 TAknsItemID iBgSkinId; |
|
105 TAknsItemID iFirstBmpId; |
|
106 TAknsItemID iMiddleBmpId; |
|
107 TAknsItemID iLastBmpId; |
|
108 |
|
109 |
|
110 HBufC* iText; |
|
111 |
|
112 TAknTextLineLayout iTextFormat; |
|
113 |
|
114 TBool iShowing; |
|
115 |
|
116 TInt iLeftDiff; |
|
117 TInt iTopDiff; |
|
118 TInt iRightDiff; |
|
119 TInt iBottomDiff; |
|
120 TBool iFreeze; |
|
121 TRect iInvalidRect; |
|
122 |
|
123 TBool iNeedRedraw; // redraw flag after text changed. |
|
124 TInt iTextColorIndex; |
|
125 }; |
|
126 |
|
127 inline void CBubbleCtrl::SetTextColorIndex( TInt aTxtClrIndex ) |
|
128 { |
|
129 iTextColorIndex = aTxtClrIndex; |
|
130 } |
|
131 |
|
132 inline TInt CBubbleCtrl::TextColorIndex() const |
|
133 { |
|
134 return iTextColorIndex; |
|
135 } |
|
136 |
|
137 class CTooltipBubbleCtrl: public CBubbleCtrl |
|
138 { |
|
139 public: |
|
140 //constructor and destructor |
|
141 /** |
|
142 * Destructor. |
|
143 * |
|
144 */ |
|
145 virtual ~CTooltipBubbleCtrl(); |
|
146 |
|
147 /** |
|
148 * Factory function. |
|
149 * |
|
150 * @param aRect The rectangle area for this control |
|
151 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
152 * @param aControlId control Id |
|
153 * @return An instance of CButtonBase class |
|
154 */ |
|
155 static CTooltipBubbleCtrl* NewL(const TRect& aRect, |
|
156 CFepUiLayout* aUiLayout, |
|
157 TInt aCtrlId); |
|
158 |
|
159 // From CFepUiBaseCtrl |
|
160 |
|
161 /** |
|
162 * Handle pointer up event |
|
163 * |
|
164 * @param aPoint The point position relative the layout |
|
165 * @return The control which handles the event. |
|
166 */ |
|
167 CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPoint); |
|
168 |
|
169 protected: |
|
170 CTooltipBubbleCtrl( const TRect& aRect, |
|
171 CFepUiLayout* aUiLayout, |
|
172 TInt aCtrlId ); |
|
173 private: |
|
174 }; |
|
175 |
|
176 #endif //C_CBUBBLECTRL_H |