25
|
1 |
/*
|
|
2 |
* Copyright (c) 2009, 2010 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: Shows number keypad and generates keypress event when
|
|
15 |
* buttons are pressed.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include <gulicon.h>
|
|
22 |
#include <AknUtils.h>
|
|
23 |
#include <aknbutton.h>
|
|
24 |
#include <AknControl.h>
|
|
25 |
#include <AknsUtils.h>
|
|
26 |
#include <AknsSkinInstance.h>
|
|
27 |
#include <AknsDrawUtils.h>
|
|
28 |
#include <data_caging_path_literals.hrh> // for KDC_APP_RESOURCE_DIR
|
|
29 |
#include <touchfeedback.h>
|
|
30 |
#include <aknlayoutscalable_avkon.cdl.h>
|
|
31 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
32 |
#include <AknsFrameBackgroundControlContext.h>
|
|
33 |
|
|
34 |
#include "dialercommon.h"
|
|
35 |
#include "dialertrace.h"
|
|
36 |
#include "cdialerkeypadbutton.h"
|
|
37 |
|
|
38 |
_LIT( KDialerMifFileName, "dialer.mif" );
|
|
39 |
|
|
40 |
// Keypad icon size relative to height of button.
|
|
41 |
static const TInt KIconSizePercent = 40;
|
|
42 |
|
|
43 |
// Keypad icon size used when key has already two lines
|
|
44 |
// of text, and the icon needs to be squeezed into smaller space.
|
|
45 |
static const TInt KSmallIconSizePercent = 30;
|
|
46 |
|
|
47 |
// Horizontal icon margin relative to button width.
|
|
48 |
static const TInt KIconMarginXPercent = 10;
|
|
49 |
|
|
50 |
// Vertical icon margin relative to button height.
|
|
51 |
static const TInt KIconMarginYPercent = 5;
|
|
52 |
|
|
53 |
static const TInt KCent = 100;
|
|
54 |
|
|
55 |
// Copied from CAknButton
|
|
56 |
const TInt KDragEventSensitivity = 1;
|
|
57 |
|
|
58 |
// ---------------------------------------------------------------------------
|
|
59 |
// C++ default constructor
|
|
60 |
// ---------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
CDialerKeyPadButton::CDialerKeyPadButton( const TDesC& aNumberLabel,
|
|
63 |
const TDesC& aPrimaryAlphaLabel,
|
|
64 |
const TDesC& aSecondaryAlphaLabel,
|
|
65 |
TInt aScanCode,
|
|
66 |
TInt aKeyCode,
|
|
67 |
TMifDialer aButtonIconId,
|
|
68 |
TMifDialer aButtonIconMaskId,
|
|
69 |
TInt aFlags ):
|
|
70 |
CAknButton( aFlags ),
|
|
71 |
iScanCode( aScanCode ),
|
|
72 |
iKeyCode( aKeyCode ),
|
|
73 |
iButtonIconId( aButtonIconId ),
|
|
74 |
iButtonIconMaskId( aButtonIconMaskId ),
|
|
75 |
iNumberLabel( aNumberLabel ),
|
|
76 |
iPrimaryAlphaLabel( aPrimaryAlphaLabel ),
|
|
77 |
iSecondaryAlphaLabel( aSecondaryAlphaLabel )
|
|
78 |
{
|
|
79 |
}
|
|
80 |
|
|
81 |
// -----------------------------------------------------------------------------
|
|
82 |
// CDialerKeyPadButton::NewLC
|
|
83 |
// Two-phased constructor.
|
|
84 |
// Constructs dialer button.
|
|
85 |
// -----------------------------------------------------------------------------
|
|
86 |
//
|
|
87 |
|
|
88 |
CDialerKeyPadButton* CDialerKeyPadButton::NewLC( const TDesC& aNumberLabel,
|
|
89 |
const TDesC& aPrimaryAlphaLabel,
|
|
90 |
const TDesC& aSecondaryAlphaLabel,
|
|
91 |
TInt aScanCode,
|
|
92 |
TInt aKeyCode,
|
|
93 |
TMifDialer aButtonIconId,
|
|
94 |
TMifDialer aButtonIconMaskId,
|
|
95 |
TInt aFlags )
|
|
96 |
{
|
|
97 |
CDialerKeyPadButton* self = new (ELeave) CDialerKeyPadButton( aNumberLabel,
|
|
98 |
aPrimaryAlphaLabel,
|
|
99 |
aSecondaryAlphaLabel,
|
|
100 |
aScanCode,
|
|
101 |
aKeyCode,
|
|
102 |
aButtonIconId,
|
|
103 |
aButtonIconMaskId,
|
|
104 |
aFlags );
|
|
105 |
CleanupStack::PushL( self );
|
|
106 |
self->ConstructL( aFlags );
|
|
107 |
return self;
|
|
108 |
}
|
|
109 |
|
|
110 |
// -----------------------------------------------------------------------------
|
|
111 |
// CDialerKeyPadButton::ConstructL
|
|
112 |
// Symbian 2nd phase constructor for dialer button.
|
|
113 |
// -----------------------------------------------------------------------------
|
|
114 |
//
|
|
115 |
void CDialerKeyPadButton::ConstructL( TInt aFlags )
|
|
116 |
{
|
|
117 |
CAknButton::ConstructL( NULL, NULL, NULL, NULL, KNullDesC, KNullDesC, aFlags );
|
|
118 |
UpdateIconL();
|
|
119 |
|
|
120 |
// button text color
|
|
121 |
SetTextColorIds( KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG65 );
|
|
122 |
SetIconScaleMode( EAspectRatioPreserved );
|
|
123 |
SetMargins( TMargins8(0,0,0,0) );
|
|
124 |
AknsUtils::RegisterControlPosition( this );
|
|
125 |
}
|
|
126 |
|
|
127 |
// ---------------------------------------------------------------------------
|
|
128 |
// Destructor
|
|
129 |
// ---------------------------------------------------------------------------
|
|
130 |
//
|
|
131 |
CDialerKeyPadButton::~CDialerKeyPadButton()
|
|
132 |
{
|
|
133 |
AknsUtils::DeregisterControlPosition( this );
|
|
134 |
|
|
135 |
MTouchFeedback* feedback = MTouchFeedback::Instance();
|
|
136 |
if ( feedback )
|
|
137 |
{
|
|
138 |
feedback->RemoveFeedbackForControl( this );
|
|
139 |
}
|
|
140 |
}
|
|
141 |
|
|
142 |
// ---------------------------------------------------------------------------
|
|
143 |
// Draw dialer button, text and icon.
|
|
144 |
// ---------------------------------------------------------------------------
|
|
145 |
//
|
|
146 |
void CDialerKeyPadButton::Draw( const TRect& aRect ) const
|
|
147 |
{
|
|
148 |
TAknLayoutRect centerLayout;
|
|
149 |
centerLayout.LayoutRect( aRect,
|
|
150 |
AknLayoutScalable_Avkon::toolbar_button_pane_g1().LayoutLine() );
|
|
151 |
TRect innerRect = centerLayout.Rect();
|
|
152 |
|
|
153 |
CWindowGc& gc = SystemGc();
|
|
154 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
155 |
|
|
156 |
TAknsItemID frameId = KAknsIIDQsnFrButtonNormal;
|
|
157 |
|
|
158 |
if ( iButtonPressed )
|
|
159 |
{
|
|
160 |
frameId = KAknsIIDQsnFrButtonPressed;
|
|
161 |
}
|
|
162 |
else if ( IsDimmed() )
|
|
163 |
{
|
|
164 |
frameId = KAknsIIDQsnFrButtonInactive;
|
|
165 |
}
|
|
166 |
|
|
167 |
iBgContext->SetFrame( frameId );
|
|
168 |
iBgContext->SetCenter( KAknsIIDQsnFrButtonCenterNormal );
|
|
169 |
iBgContext->SetFrameRects( aRect, innerRect );
|
|
170 |
|
|
171 |
TBool bgDrawn = AknsDrawUtils::Background( skin,
|
|
172 |
iBgContext,
|
|
173 |
NULL,
|
|
174 |
gc,
|
|
175 |
aRect,
|
|
176 |
KAknsDrawParamNoClearUnderImage );
|
|
177 |
|
|
178 |
__ASSERT_DEBUG( bgDrawn, DialerPanic( EDialerPanicDrawingError ) );
|
|
179 |
|
|
180 |
DrawIconAndText( gc );
|
|
181 |
}
|
|
182 |
|
|
183 |
// -----------------------------------------------------------------------------
|
|
184 |
// Respond to changes in the button size
|
|
185 |
// -----------------------------------------------------------------------------
|
|
186 |
//
|
|
187 |
void CDialerKeyPadButton::SizeChanged()
|
|
188 |
{
|
|
189 |
CAknButton::SizeChanged();
|
|
190 |
AknsUtils::RegisterControlPosition( this );
|
|
191 |
|
|
192 |
TRect buttonRect = Rect();
|
|
193 |
TAknLayoutRect iconLayout;
|
|
194 |
const CGulIcon* icon = GetCurrentIcon();
|
|
195 |
|
|
196 |
if ( iOperationMode == EModeEasyDialing )
|
|
197 |
{
|
|
198 |
// Number layout
|
|
199 |
TAknTextComponentLayout numLayout =
|
|
200 |
AknLayoutScalable_Apps::cell_dia3_key_num_pane_t1( iVariety );
|
|
201 |
// Center the number label if key doens't contain any alphabets or icon.
|
|
202 |
if ( !icon && !iPrimaryAlphaLabel.Length() && !iSecondaryAlphaLabel.Length() )
|
|
203 |
{
|
|
204 |
// eliminate margins, alignment takes care of correct position
|
|
205 |
numLayout.Setl( 0 );
|
|
206 |
numLayout.Setr( 0 );
|
|
207 |
numLayout.SetJ( 1 ); // ID for center alignment
|
|
208 |
}
|
|
209 |
iNumberLayout.LayoutText( buttonRect, numLayout );
|
|
210 |
|
|
211 |
// Alphabet layout is different if two rows of alphabets are given
|
|
212 |
if ( iSecondaryAlphaLabel.Length() )
|
|
213 |
{
|
|
214 |
iPrimaryAlphaLayout.LayoutText( buttonRect,
|
|
215 |
AknLayoutScalable_Apps::cell_dia3_key_num_pane_t3( iVariety ) );
|
|
216 |
iSecondaryAlphaLayout.LayoutText( buttonRect,
|
|
217 |
AknLayoutScalable_Apps::cell_dia3_key_num_pane_t4( iVariety ) );
|
|
218 |
}
|
|
219 |
else
|
|
220 |
{
|
|
221 |
iPrimaryAlphaLayout.LayoutText( buttonRect,
|
|
222 |
AknLayoutScalable_Apps::cell_dia3_key_num_pane_t2( iVariety ) );
|
|
223 |
}
|
|
224 |
}
|
|
225 |
else if ( iOperationMode == EModeDialer )
|
|
226 |
{
|
|
227 |
// Number layout
|
|
228 |
// Center number labels as only numbers are shown
|
|
229 |
TAknTextComponentLayout numLayout =
|
|
230 |
AknLayoutScalable_Apps::cell_dia3_key_num_pane_t1( iVariety );
|
|
231 |
// eliminate margins, alignment takes care of correct position
|
|
232 |
numLayout.Setl( 0 );
|
|
233 |
numLayout.Setr( 0 );
|
|
234 |
numLayout.SetJ( 1 ); // ID for center alignment
|
|
235 |
iNumberLayout.LayoutText( buttonRect, numLayout );
|
|
236 |
}
|
|
237 |
else // video mode layout
|
|
238 |
{
|
|
239 |
// Number layout
|
|
240 |
iNumberLayout.LayoutText( buttonRect,
|
|
241 |
AknLayoutScalable_Apps::cell_video_dialer_keypad_pane_t1() );
|
|
242 |
}
|
|
243 |
|
|
244 |
SetIconLayout( buttonRect );
|
|
245 |
}
|
|
246 |
|
|
247 |
// ---------------------------------------------------------------------------
|
|
248 |
// Pointer event handling. Implemented here just to detect when touch is
|
|
249 |
// dragged outside pressed button as no appropriate control event is sent
|
|
250 |
// by CAknButton when this happens.
|
|
251 |
// ---------------------------------------------------------------------------
|
|
252 |
//
|
|
253 |
void CDialerKeyPadButton::HandlePointerEventL( const TPointerEvent& aPointerEvent )
|
|
254 |
{
|
|
255 |
// Do the check before forwarding events to base class as it will update
|
|
256 |
// iButtonPressed member variable used here.
|
|
257 |
// Own drag event counter has to be used.
|
|
258 |
// Logic here to determine whether pointer is dragged outside button is
|
|
259 |
// the same as used in CAknButton.
|
|
260 |
|
|
261 |
if ( State() && IsVisible() )
|
|
262 |
{
|
|
263 |
if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
|
|
264 |
{
|
|
265 |
iDragEventCounter = 0;
|
|
266 |
}
|
|
267 |
else if ( aPointerEvent.iType == TPointerEvent::EDrag )
|
|
268 |
{
|
|
269 |
iDragEventCounter++;
|
|
270 |
if ( iDragEventCounter >= KDragEventSensitivity )
|
|
271 |
{
|
|
272 |
iDragEventCounter = 0;
|
|
273 |
|
|
274 |
TBool buttonEvent( Rect().Contains( aPointerEvent.iPosition ) );
|
|
275 |
|
|
276 |
// Pointer is dragged outside the pressed button area
|
|
277 |
if ( !buttonEvent && iButtonPressed && Observer() )
|
|
278 |
{
|
|
279 |
Observer()->HandleControlEventL( this,
|
|
280 |
static_cast<MCoeControlObserver::TCoeEvent>(
|
|
281 |
CDialerKeyPadButton::EEventDraggingOutsideButton ) );
|
|
282 |
}
|
|
283 |
}
|
|
284 |
}
|
|
285 |
}
|
|
286 |
|
|
287 |
CAknButton::HandlePointerEventL( aPointerEvent );
|
|
288 |
}
|
|
289 |
|
|
290 |
// -----------------------------------------------------------------------------
|
|
291 |
// Gets the correct text color.
|
|
292 |
// -----------------------------------------------------------------------------
|
|
293 |
//
|
|
294 |
void CDialerKeyPadButton::GetTextColors( TRgb& aPenColor, TRgb& aBrushColor ) const
|
|
295 |
{
|
|
296 |
aBrushColor = iEikonEnv->ControlColor( EColorControlBackground, *this );
|
|
297 |
|
|
298 |
if ( iButtonPressed )
|
|
299 |
{
|
|
300 |
aPenColor = iEikonEnv->ControlColor( EColorButtonTextPressed, *this );
|
|
301 |
}
|
|
302 |
else
|
|
303 |
{
|
|
304 |
aPenColor = iEikonEnv->ControlColor( EColorButtonText, *this );
|
|
305 |
}
|
|
306 |
}
|
|
307 |
|
|
308 |
// --------------------------------------------------------------------------
|
|
309 |
// Draw text and icon according to the layout.
|
|
310 |
// --------------------------------------------------------------------------
|
|
311 |
//
|
|
312 |
void CDialerKeyPadButton::DrawIconAndText( CWindowGc& aGc ) const
|
|
313 |
{
|
|
314 |
TRect parentRect( Rect() );
|
|
315 |
TAknLayoutText buttonText;
|
|
316 |
TAknLayoutRect layoutRect;
|
|
317 |
|
|
318 |
TRgb penColor;
|
|
319 |
TRgb brushColor;
|
|
320 |
GetTextColors( penColor, brushColor );
|
|
321 |
|
|
322 |
// Don't ues logical-to-visual conversion, strings in our keypad resources are already
|
|
323 |
// in visual order.
|
|
324 |
TBool logToVisConv = EFalse;
|
|
325 |
|
|
326 |
iNumberLayout.DrawText( aGc, iNumberLabel, logToVisConv, penColor );
|
|
327 |
|
|
328 |
// Draw also alphabet label(s) in Easy Dialing mode
|
|
329 |
if ( iOperationMode == EModeEasyDialing )
|
|
330 |
{
|
|
331 |
if ( iPrimaryAlphaLabel.Length() )
|
|
332 |
{
|
|
333 |
iPrimaryAlphaLayout.DrawText( aGc, iPrimaryAlphaLabel, logToVisConv, penColor );
|
|
334 |
}
|
|
335 |
if ( iSecondaryAlphaLabel.Length() )
|
|
336 |
{
|
|
337 |
iSecondaryAlphaLayout.DrawText( aGc, iSecondaryAlphaLabel, logToVisConv, penColor );
|
|
338 |
}
|
|
339 |
}
|
|
340 |
|
|
341 |
const CGulIcon* icon = GetCurrentIcon();
|
|
342 |
if ( icon )
|
|
343 |
{
|
|
344 |
CFbsBitmap* buttonBmp = icon->Bitmap();
|
|
345 |
CFbsBitmap* buttonMask = icon->Mask();
|
|
346 |
|
|
347 |
if ( buttonBmp && buttonMask )
|
|
348 |
{
|
|
349 |
aGc.BitBltMasked( iIconRect.iTl, buttonBmp,
|
|
350 |
iIconRect.Size(), buttonMask, ETrue );
|
|
351 |
}
|
|
352 |
}
|
|
353 |
}
|
|
354 |
|
|
355 |
// --------------------------------------------------------------------------
|
|
356 |
// Set layout data for text.
|
|
357 |
// --------------------------------------------------------------------------
|
|
358 |
void CDialerKeyPadButton::SetVariety( TInt aVariety )
|
|
359 |
{
|
|
360 |
iVariety = aVariety;
|
|
361 |
}
|
|
362 |
|
|
363 |
// --------------------------------------------------------------------------
|
|
364 |
// Set layout data for text.
|
|
365 |
// --------------------------------------------------------------------------
|
|
366 |
void CDialerKeyPadButton::SetOperationMode( TDialerOperationMode aMode )
|
|
367 |
{
|
|
368 |
iOperationMode = aMode;
|
|
369 |
}
|
|
370 |
|
|
371 |
// ---------------------------------------------------------------------------
|
|
372 |
//
|
|
373 |
// ---------------------------------------------------------------------------
|
|
374 |
//
|
|
375 |
void CDialerKeyPadButton::SetNumLabel( const TDesC& aLabel )
|
|
376 |
{
|
|
377 |
iNumberLabel.Set( aLabel );
|
|
378 |
}
|
|
379 |
|
|
380 |
// ---------------------------------------------------------------------------
|
|
381 |
//
|
|
382 |
// ---------------------------------------------------------------------------
|
|
383 |
//
|
|
384 |
void CDialerKeyPadButton::SetPrimaryAlphaLabel( const TDesC& aLabel )
|
|
385 |
{
|
|
386 |
iPrimaryAlphaLabel.Set( aLabel );
|
|
387 |
}
|
|
388 |
|
|
389 |
// ---------------------------------------------------------------------------
|
|
390 |
//
|
|
391 |
// ---------------------------------------------------------------------------
|
|
392 |
//
|
|
393 |
void CDialerKeyPadButton::SetSecondaryAlphaLabel( const TDesC& aLabel )
|
|
394 |
{
|
|
395 |
iSecondaryAlphaLabel.Set( aLabel );
|
|
396 |
}
|
|
397 |
|
|
398 |
// ---------------------------------------------------------------------------
|
|
399 |
//
|
|
400 |
// ---------------------------------------------------------------------------
|
|
401 |
//
|
|
402 |
TInt CDialerKeyPadButton::ScanCode() const
|
|
403 |
{
|
|
404 |
return iScanCode;
|
|
405 |
}
|
|
406 |
|
|
407 |
// ---------------------------------------------------------------------------
|
|
408 |
//
|
|
409 |
// ---------------------------------------------------------------------------
|
|
410 |
//
|
|
411 |
TInt CDialerKeyPadButton::KeyCode() const
|
|
412 |
{
|
|
413 |
return iKeyCode;
|
|
414 |
}
|
|
415 |
|
|
416 |
// ---------------------------------------------------------------------------
|
|
417 |
//
|
|
418 |
// ---------------------------------------------------------------------------
|
|
419 |
//
|
|
420 |
void CDialerKeyPadButton::MapDialerIconToSkinIcon(
|
|
421 |
TInt aDialerIcon, TAknsItemID& aItemId ) const
|
|
422 |
{
|
|
423 |
switch ( aDialerIcon )
|
|
424 |
{
|
|
425 |
case EMbmDialerQgn_indi_dialer_voicemail:
|
|
426 |
aItemId = KAknsIIDQgnIndiDialerVoicemail;
|
|
427 |
break;
|
|
428 |
default:
|
|
429 |
break;
|
|
430 |
}
|
|
431 |
}
|
|
432 |
|
|
433 |
// ---------------------------------------------------------------------------
|
|
434 |
//
|
|
435 |
// ---------------------------------------------------------------------------
|
|
436 |
//
|
|
437 |
void CDialerKeyPadButton::SetIconLayout( const TRect& aRect )
|
|
438 |
{
|
|
439 |
// Calculate icon size and placement.
|
|
440 |
TInt iconSize = aRect.Height() * KIconSizePercent / KCent;
|
|
441 |
TInt xMargin = aRect.Width() * KIconMarginXPercent / KCent;
|
|
442 |
TInt yMargin = aRect.Height() * KIconMarginYPercent / KCent;
|
|
443 |
|
|
444 |
// Adapt icon size and vertical margin. If the button has
|
|
445 |
// already two lines of text, use smaller icon size
|
|
446 |
if ( iOperationMode == EModeEasyDialing && iSecondaryAlphaLabel.Length() )
|
|
447 |
{
|
|
448 |
iconSize = aRect.Height() * KSmallIconSizePercent / KCent;
|
|
449 |
yMargin = 0;
|
|
450 |
}
|
|
451 |
|
|
452 |
if ( AknLayoutUtils::LayoutMirrored() )
|
|
453 |
{
|
|
454 |
iIconRect.SetRect( aRect.iTl.iX + xMargin,
|
|
455 |
aRect.iTl.iY + yMargin,
|
|
456 |
aRect.iTl.iX + xMargin + iconSize,
|
|
457 |
aRect.iTl.iY + iconSize + yMargin );
|
|
458 |
}
|
|
459 |
else
|
|
460 |
{
|
|
461 |
iIconRect.SetRect( aRect.iBr.iX - iconSize - xMargin,
|
|
462 |
aRect.iTl.iY + yMargin,
|
|
463 |
aRect.iBr.iX - xMargin,
|
|
464 |
aRect.iTl.iY + iconSize + yMargin );
|
|
465 |
}
|
|
466 |
SetIconSize( iIconRect.Size() );
|
|
467 |
}
|
|
468 |
|
|
469 |
// ---------------------------------------------------------------------------
|
|
470 |
// Update icon when skin is changed
|
|
471 |
// ---------------------------------------------------------------------------
|
|
472 |
//
|
|
473 |
void CDialerKeyPadButton::UpdateIconL()
|
|
474 |
{
|
|
475 |
if ( KDialerNoIcon != iButtonIconId )
|
|
476 |
{
|
|
477 |
TFileName mifPath( KDriveZ );
|
|
478 |
mifPath.Append( KDC_APP_BITMAP_DIR );
|
|
479 |
mifPath.Append( KDialerMifFileName );
|
|
480 |
|
|
481 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
482 |
CFbsBitmap* bitmap (NULL);
|
|
483 |
CFbsBitmap* mask (NULL);
|
|
484 |
|
|
485 |
// Get icon id.
|
|
486 |
TAknsItemID skinItemId( KAknsIIDNone );
|
|
487 |
MapDialerIconToSkinIcon( iButtonIconId, skinItemId );
|
|
488 |
|
|
489 |
AknsUtils::CreateColorIconLC(
|
|
490 |
skin,
|
|
491 |
skinItemId,
|
|
492 |
KAknsIIDQsnIconColors,
|
|
493 |
EAknsCIQsnIconColorsCG30,
|
|
494 |
bitmap,
|
|
495 |
mask,
|
|
496 |
mifPath,
|
|
497 |
iButtonIconId,
|
|
498 |
iButtonIconMaskId,
|
|
499 |
KRgbBlack
|
|
500 |
);
|
|
501 |
|
|
502 |
CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
|
|
503 |
CleanupStack::Pop( 2 );
|
|
504 |
|
|
505 |
State()->SetIcon( icon ); // icon ownership transfered
|
|
506 |
}
|
|
507 |
}
|
|
508 |
|
|
509 |
// ---------------------------------------------------------------------------
|
|
510 |
//
|
|
511 |
// Enable or disable audio but keep vibra feedback
|
|
512 |
// ---------------------------------------------------------------------------
|
|
513 |
//
|
|
514 |
void CDialerKeyPadButton::EnableAudioFeedback( const TBool aEnable )
|
|
515 |
{
|
|
516 |
MTouchFeedback* feedback = MTouchFeedback::Instance();
|
|
517 |
if ( feedback )
|
|
518 |
{
|
|
519 |
feedback->EnableFeedbackForControl( this, ETrue, aEnable );
|
|
520 |
}
|
|
521 |
}
|
|
522 |
|
|
523 |
// ---------------------------------------------------------------------------
|
|
524 |
//
|
|
525 |
// ---------------------------------------------------------------------------
|
|
526 |
//
|
|
527 |
void CDialerKeyPadButton::HandleResourceChange( TInt aType )
|
|
528 |
{
|
|
529 |
CAknButton::HandleResourceChange( aType );
|
|
530 |
|
|
531 |
if ( KAknsMessageSkinChange == aType )
|
|
532 |
{
|
|
533 |
TRAP_IGNORE( UpdateIconL() );
|
|
534 |
}
|
|
535 |
}
|
|
536 |
|
|
537 |
// End of File
|