diff -r 80ef3a206772 -r 48780e181b38 Symbian3/SDK/Source/GUID-62DF565C-8121-429F-99D0-B5FBDE634AA9.dita --- a/Symbian3/SDK/Source/GUID-62DF565C-8121-429F-99D0-B5FBDE634AA9.dita Fri Jul 16 17:23:46 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-62DF565C-8121-429F-99D0-B5FBDE634AA9.dita Tue Jul 20 12:00:49 2010 +0100 @@ -1,78 +1,78 @@ - - - - - -Using -long-tap events -

Long-tap events allow you to specify functions performed when the user -taps and holds the button for a specified period of time. An example of a -long-tap function is fast forwarding in a media player application by tapping -and holding down a button.

-

To receive long-tap events, use the class CAknLongTapDetector in the Touch -UI utilities API.

-

To enable the handling of long tap events in your CAknButton , -set the flag KAknButtonReportOnLongPress for the button. -When the long tap event starts,CAknButton::ELongPressEvent() is -reported to the button observer (MCoeControlObserver). When -the long tap event ends, CAknButton::ELongPressEndedEvent() is -reported.

-

To define the period for which the button needs to be held down for a long-tap -event, use the method SetLongPressInterval() in the class CAknButton.

-void CMyAppContainer::ConstructL() -{ -… -iButton = CAknButton::NewL( NULL, NULL, NULL, NULL, - -KNullDesC, KNullDesC , KAknButtonReportOnLongPress, 0 ); - -iButton->SetContainerWindowL( *this ); -iButton->SetObserver( this ); -… -} - -void CMyAppContainer::HandleControlEventL( CCoeControl* aControl, - TCoeEvent aEventType ) - { - switch ( aEventType ) - { - -// Button is pressed for a long time - - case CAknButton::ELongPressEvent: - if ( aControl == iButton ) - -{ - - … - -} - - break; - -// Button long press ended - - case CAknButton::ELongPressEndedEvent: - if ( aControl == iButton ) - -{ - - … - -} - - break; - - default: - break; - } - } - - + + + + + +Using +long-tap events +

Long-tap events allow you to specify functions performed when the user +taps and holds the button for a specified period of time. An example of a +long-tap function is fast forwarding in a media player application by tapping +and holding down a button.

+

To receive long-tap events, use the class CAknLongTapDetector in the Touch +UI utilities API.

+

To enable the handling of long tap events in your CAknButton , +set the flag KAknButtonReportOnLongPress for the button. +When the long tap event starts, CAknButton::ELongPressEvent is +reported to the button observer (MCoeControlObserver). When +the long tap event ends, CAknButton::ELongPressEndedEvent is +reported.

+

To define the period for which the button needs to be held down for a long-tap +event, use the method SetLongPressInterval() in the class CAknButton.

+void CMyAppContainer::ConstructL() +{ +… +iButton = CAknButton::NewL( NULL, NULL, NULL, NULL, + +KNullDesC, KNullDesC , KAknButtonReportOnLongPress, 0 ); + +iButton->SetContainerWindowL( *this ); +iButton->SetObserver( this ); +… +} + +void CMyAppContainer::HandleControlEventL( CCoeControl* aControl, + TCoeEvent aEventType ) + { + switch ( aEventType ) + { + +// Button is pressed for a long time + + case CAknButton::ELongPressEvent: + if ( aControl == iButton ) + +{ + + … + +} + + break; + +// Button long press ended + + case CAknButton::ELongPressEndedEvent: + if ( aControl == iButton ) + +{ + + … + +} + + break; + + default: + break; + } + } + +
\ No newline at end of file