73 |
73 |
74 const TInt KLongTapStartShortDelay( 150000 ); // 0.15s for Sk |
74 const TInt KLongTapStartShortDelay( 150000 ); // 0.15s for Sk |
75 const TInt KLongTapStartLongDelay( 500000 ); // 0.5s |
75 const TInt KLongTapStartLongDelay( 500000 ); // 0.5s |
76 const TInt KLongTapTimeShortDelay( 600000 ); // 0.6s for SK |
76 const TInt KLongTapTimeShortDelay( 600000 ); // 0.6s for SK |
77 const TInt KLongTapTimeLongDelay( 1500000 ); // 1.5s |
77 const TInt KLongTapTimeLongDelay( 1500000 ); // 1.5s |
78 _LIT( KWidgetBg, "SKIN(268458534 9916)" ); |
|
79 |
78 |
80 // LOCAL FUNCTION PROTOTYPES |
79 // LOCAL FUNCTION PROTOTYPES |
81 static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness ); |
80 static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness ); |
82 static void ConvertRgbToHsl( TRgb aRGB, TUint& aHue, TUint& aSaturation, |
81 static void ConvertRgbToHsl( TRgb aRGB, TUint& aHue, TUint& aSaturation, |
83 TUint& aLightness ); |
82 TUint& aLightness ); |
4056 #ifdef RD_TACTILE_FEEDBACK |
4054 #ifdef RD_TACTILE_FEEDBACK |
4057 MTouchFeedback* feedback( MTouchFeedback::Instance() ); |
4055 MTouchFeedback* feedback( MTouchFeedback::Instance() ); |
4058 |
4056 |
4059 if ( feedback ) |
4057 if ( feedback ) |
4060 { |
4058 { |
4061 feedback->InstantFeedback( ETouchFeedbackBasic ); |
4059 feedback->InstantFeedback( iAdapter, ETouchFeedbackBasic, |
|
4060 ETouchFeedbackVibra, |
|
4061 aPointerEvent ); |
4062 } |
4062 } |
4063 #endif |
4063 #endif |
4064 node->SetStateL( XnPropertyNames::style::common::KActive ); |
4064 node->SetStateL( XnPropertyNames::style::common::KActive ); |
4065 } |
4065 } |
4066 } |
4066 } |
4088 if ( iAdapter->IsFocused() ) |
4088 if ( iAdapter->IsFocused() ) |
4089 { |
4089 { |
4090 DrawFocusAppearance( node, aGc ); |
4090 DrawFocusAppearance( node, aGc ); |
4091 } |
4091 } |
4092 |
4092 |
|
4093 // Draw plus sign for empty plugins in edit mode. |
|
4094 if( node.UiEngine()->EditMode()->EditState() ) |
|
4095 { |
|
4096 const_cast< CXnControlAdapterImpl* >( this )->DrawPlusSign( node, aGc ); |
|
4097 } |
|
4098 |
4093 if ( iAnimation ) |
4099 if ( iAnimation ) |
4094 { |
4100 { |
4095 TRect rect = iComponent->Node()->Rect(); |
4101 TRect rect = iComponent->Node()->Rect(); |
4096 iAnimation->Render( aGc, rect ); |
4102 iAnimation->Render( aGc, rect ); |
4097 } |
4103 } |
4174 const TDesC8& widgetType = aNode.DomNode()->Name(); |
4178 const TDesC8& widgetType = aNode.DomNode()->Name(); |
4175 if( widgetType == XnPropertyNames::KPlugin ) |
4179 if( widgetType == XnPropertyNames::KPlugin ) |
4176 { |
4180 { |
4177 TRect rect = aNode.PaddingRect(); |
4181 TRect rect = aNode.PaddingRect(); |
4178 DrawBackgroundSkin( KAknsIIDQgnHomeEditBgWidget, aGc, rect ); |
4182 DrawBackgroundSkin( KAknsIIDQgnHomeEditBgWidget, aGc, rect ); |
4179 |
4183 } |
4180 CXnPluginData& data( aNode.UiEngine()->ViewManager()->ActiveViewData().Plugin( &aNode ) ); |
4184 } |
4181 if( !data.Occupied() ) // Empty widget |
4185 |
|
4186 // ----------------------------------------------------------------------------- |
|
4187 // CXnControlAdapterImpl::DrawPlusSign |
|
4188 // |
|
4189 // ----------------------------------------------------------------------------- |
|
4190 // |
|
4191 void CXnControlAdapterImpl::DrawPlusSign( CXnNode& aNode, CWindowGc& aGc ) |
|
4192 { |
|
4193 const TDesC8& widgetType = aNode.DomNode()->Name(); |
|
4194 if( widgetType == XnPropertyNames::KPlugin ) |
|
4195 { |
|
4196 CXnPluginData* data( aNode.UiEngine()->ViewManager()->ActiveViewData().Plugin( &aNode ) ); |
|
4197 if( data && !data->Occupied() ) // Empty widget |
4182 { |
4198 { |
4183 // Draw + -icon |
4199 // Draw + -icon |
4184 // Make rect as 50% of the widget's height. |
4200 // Make rect as 50% of the widget's height. |
4185 // It needs to be square in order to keep aspect ratio. |
4201 // It needs to be square in order to keep aspect ratio. |
|
4202 TRect rect = aNode.PaddingRect(); |
4186 TInt w = rect.Width(); |
4203 TInt w = rect.Width(); |
4187 TInt h = rect.Height(); |
4204 TInt h = rect.Height(); |
4188 rect.Shrink( ( w - h * 0.5 ) * 0.5, h * 0.25 ); |
4205 rect.Shrink( ( w - h * 0.5 ) * 0.5, h * 0.25 ); |
4189 DrawBackgroundSkin( KAknsIIDQgnHomeAdd, aGc, rect ); |
4206 DrawBackgroundSkin( KAknsIIDQgnHomeAdd, aGc, rect ); |
4190 } |
4207 } |
4285 if( aRect == TRect::EUninitialized ) |
4302 if( aRect == TRect::EUninitialized ) |
4286 { |
4303 { |
4287 aRect = aNode.PaddingRect(); |
4304 aRect = aNode.PaddingRect(); |
4288 } |
4305 } |
4289 |
4306 |
4290 //CXnProperty* colorProperty( aNode.BackgroundColorL() ); |
|
4291 CXnProperty* colorProperty( aBgColor ); |
4307 CXnProperty* colorProperty( aBgColor ); |
4292 if ( colorProperty ) |
4308 if ( colorProperty ) |
4293 { |
4309 { |
4294 HBufC* skinID = colorProperty->StringValueL(); |
4310 HBufC* skinID = colorProperty->StringValueL(); |
4295 CleanupStack::PushL( skinID ); |
4311 CleanupStack::PushL( skinID ); |
4296 |
|
4297 // Widget background should not be drawn in edit mode |
|
4298 if( aNode.UiEngine()->EditMode()->EditState() && |
|
4299 skinID->Des() == KWidgetBg ) |
|
4300 { |
|
4301 CleanupStack::PopAndDestroy( skinID ); |
|
4302 return; |
|
4303 } |
|
4304 |
4312 |
4305 if ( skinID->Length() != 0 ) |
4313 if ( skinID->Length() != 0 ) |
4306 { |
4314 { |
4307 TAknsItemID itemID; |
4315 TAknsItemID itemID; |
4308 StripQuotes( skinID ); |
4316 StripQuotes( skinID ); |