Symbian3/SDK/Source/GUID-E1A2872E-6E8D-4C02-B3C0-23213FD56106.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-E1A2872E-6E8D-4C02-B3C0-23213FD56106" xml:lang="en"><title>Handling
       
    13 button events</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>Use the <codeph>MCoeControlObserver</codeph> observer interface to observe
       
    15 button events. Set the button container to be its observer.</p>
       
    16 <p>For more information on events, see <xref href="GUID-A9330FEF-C559-4E2B-B064-0151FDADEA8C.dita">Event
       
    17 handling</xref>.</p>
       
    18 <codeblock xml:space="preserve">void CMyAppContainer::HandleControlEventL( CCoeControl* aControl, 
       
    19                                                   TCoeEvent aEventType ) 
       
    20     { 
       
    21         switch ( aEventType ) 
       
    22             { 
       
    23 
       
    24 // Button state changed (button was pressed) 
       
    25 
       
    26             case EEventStateChanged: 
       
    27
       
    28                 break; 
       
    29 
       
    30 // Button is pressed for a long time (in case of 
       
    31 // a KAknButtonReportOnLongPress flagged button) 
       
    32 
       
    33             case CAknButton::ELongPressEvent: 
       
    34
       
    35                 break; 
       
    36 
       
    37 // Button long press ended (in case of 
       
    38 // a KAknButtonReportOnLongPress flagged button) 
       
    39 
       
    40             case CAknButton::ELongPressEndedEvent: 
       
    41
       
    42                 break; 
       
    43 
       
    44             default: 
       
    45                 break; 
       
    46             } 
       
    47     } 
       
    48 
       
    49 </codeblock>
       
    50 </conbody></concept>